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.3.0.tar.gz (18.1 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.3.0-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: claude_burnrate-0.3.0.tar.gz
  • Upload date:
  • Size: 18.1 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.3.0.tar.gz
Algorithm Hash digest
SHA256 388bdeac88a6e6c9df470fd2019d87435a575058504069d50c53b30059657da3
MD5 e1380c08160cae0ddfba5bf80d075c11
BLAKE2b-256 2b5846e2e4a8d4f68310a5f09357c4db53ce90994d9cdd8286dee6758aaec2e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for claude_burnrate-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 25cf2ca650b8288c6f6b138b31f85ddb8bde54407804beebb377ff64085246fd
MD5 d5b085508315b824d80659fb637c230f
BLAKE2b-256 93cd083b624056c3c1ae564b78eb77e251886254af4896f26e9ecdfa7e387f08

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