Skip to main content

Track your Claude session + weekly usage. Never waste limits again.

Project description

claude-budget $$

Stop losing 10-15% of your weekly Claude limit to wasted sessions.

A lightweight CLI that tracks your Claude 5-hour session windows and 7-day weekly usage so you can make every message count.


The problem this solves

Claude's usage model has two layers:

  • 5-hour rolling sessions - starts when you send your first message, expires 5 hours later whether you use them or not
  • 7-day weekly cap - total usage across all surfaces (claude.ai, Claude Code, Desktop)
  • Peak hours - since March 2026, sessions drain faster during 5am–11am PT on weekdays

If you're careful all week but start sessions you don't finish, or accidentally run heavy work during peak hours, you lose budget you already paid for. This tool surfaces that waste and helps you avoid it.


Install

pip install claude-budget

Or from source:

git clone https://github.com/AravindKurapati/claude-budget
cd claude-budget
pip install -e .

Requirements: Python 3.9+ - no API keys needed, everything is local.


Usage

Start a session (run before opening Claude)

claude-budget start --label "RAG pipeline" --task coding

Output:

🟢 Session Started  2026-04-09 09:00 UTC
Label: RAG pipeline  |  Task: coding
Window: 5h rolling
✓ off-peak - good time for heavy work

Weekly sessions used: ██░░░░░░░░░░░░░░░░░░░░░░░░░░░░  3/50 est. (6%)

Check status mid-session

claude-budget status

End a session and log usage

claude-budget end --messages 45 --tokens 30000

Get personalised waste-reduction advice

claude-budget advice

Output example:

💡 Short sessions: You left ~3.2h unused across 2 sessions. Front-load heavier
   tasks so each 5h window is fully used.

⚡ Peak hours: 4/7 sessions were during peak (5am-11am PT). Shifting heavy
   sessions to evenings gives you the same window but it drains slower.

View history

claude-budget history --days 7

Configure your plan

claude-budget config --plan max_5x --tz 3   # ET = PT+3
claude-budget config --plan pro              # or max_20x
claude-budget config --show

All commands

Command What it does
start Begin tracking a new session (--project to tag)
end Close session, log messages + token estimate
status Current session + weekly budget at a glance
history Session log for last N days (--project to filter)
week Project end-of-week budget based on burn pace
estimate Estimate questions remaining by size and model
export Export session history to CSV
advice Personalised tips based on your usage patterns
config Set plan and timezone
reset Wipe history (keeps config)

Peak hours

Since March 26, 2026, Anthropic burns through your 5-hour session limit faster during weekday peak hours:

  • Peak: Mon–Fri, 5am–11am PT (1pm–7pm GMT)
  • Off-peak: Evenings, nights, weekends - same window lasts longer

claude-budget status always shows whether you're in peak hours right now, so you can time your heavy sessions accordingly.


How usage is stored

Everything is local - a SQLite database at ~/.claude_budget/usage.db. No data leaves your machine. Config lives at ~/.claude_budget/config.json.

Token estimates are manual (you enter them when ending a session) because Anthropic doesn't expose token counts through the claude.ai interface. Even rough estimates are enough to see patterns over time.


Tips to reduce waste

From the advice command, and from building this tool:

  1. Don't end sessions early - a 5h window is already burned the moment you start it. Use /clear within Claude to reset context without starting a new session.
  2. Front-load heavy tasks - open with your most token-intensive work, not quick questions.
  3. Avoid peak hours for big jobs - same 5h window, but it drains slower off-peak.
  4. Batch your messages - Claude counts messages, not just tokens. One well-constructed message with 5 questions is more efficient than 5 separate messages.
  5. Use sub-agents for research - Claude Code sub-agents do research without bloating your main context window.

PRs welcome. If you've found other patterns that reduce waste, open an issue.


License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_burnrate-0.1.0.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claude_burnrate-0.1.0-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file claude_burnrate-0.1.0.tar.gz.

File metadata

  • Download URL: claude_burnrate-0.1.0.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for claude_burnrate-0.1.0.tar.gz
Algorithm Hash digest
SHA256 65dac1b318fd783527e89e5213b9708bc91fc06745a12fdc95ebced26a077b10
MD5 ebe844e0e0e881748e257c707ef30991
BLAKE2b-256 0f8b06f76fb932f40f4c1295d4f027f26abc0b63f72fe7c7be7a3e097df43e1b

See more details on using hashes here.

File details

Details for the file claude_burnrate-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for claude_burnrate-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 62e5b9b7248ff4ec4b14a96feafe1e66c5897a99c4f2d17020b5d9cbde7ba98f
MD5 b51a39920735ce3cf39e8fefb133e2d2
BLAKE2b-256 d2b8a76c53b815ba32c15b6b0efb15fdca8017bc287a15e5181e3e10e8e7f31d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page