Skip to content

πŸ”₯ Claude Code usage limits β€” TUI with burn-up charts, compact mode for status bars, JSON for automation

License

Notifications You must be signed in to change notification settings

JuanjoFuchs/ccburn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

34 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”₯ ccburn

CI Release npm PyPI Python GitHub Release WinGet npm downloads PyPI downloads GitHub downloads License

Burning tokens

Watch your tokens burn β€” before you get burned.

TUI and CLI for Claude Code usage limits β€” burn-up charts, compact mode for status bars, JSON for automation.

ccburn screenshot

Features

  • Real-time burn-up charts β€” Visualize session and weekly usage with live-updating terminal graphics
  • Pace indicators β€” 🧊 Cool. πŸ”₯ On pace. 🚨 Too hot.
  • Multiple output modes β€” Full TUI, compact single-line for status bars, or JSON for scripting
  • Automatic data persistence β€” SQLite-backed history for trend analysis
  • Dynamic window title β€” Terminal tab shows current usage at a glance
  • Zoom views β€” Focus on recent activity with --since

Installation

Run claude and login first to refresh credentials.

WinGet (pending approval)

winget install JuanjoFuchs.ccburn

npx

npx ccburn

npm

npm install -g ccburn

pip

pip install ccburn

From Source

git clone https://github.com/JuanjoFuchs/ccburn.git
cd ccburn
pip install -e ".[dev]"

Quick Start

  1. Run Claude Code first to ensure credentials are fresh:
    claude
  2. Run ccburn:
    ccburn              # Session limit (default)
    ccburn weekly       # Weekly limit
    ccburn weekly-sonnet # Weekly Sonnet limit

Usage Examples

# Full TUI with burn-up chart (default)
ccburn

# Weekly usage view
ccburn weekly

# Compact output for tmux/status bars
ccburn --compact
# Output: Session: πŸ”₯ 45% (2h14m) | Weekly: 🧊 12% | Sonnet: 🧊 3%

# JSON output for scripting/automation
ccburn --json

# Zoom to last 30 minutes
ccburn --since 30m

# Single snapshot (no live updates)
ccburn --once

# Custom refresh interval (seconds)
ccburn --interval 10

Command Line Reference

Usage: ccburn [OPTIONS] [LIMIT]

Arguments:
  [LIMIT]  Which limit to display [default: session]
           Options: session, weekly, weekly-sonnet

Options:
  -i, --interval INTEGER  Refresh interval in seconds [default: 5/30]
  -s, --since TEXT        Only show data since (e.g., 30m, 2h, 1d)
  -j, --json              Output JSON and exit
  -o, --once              Print once and exit (no live updates)
  -c, --compact           Single-line output for status bars
  --debug                 Show debug information
  --version               Show version and exit
  --help                  Show this message and exit

Pace Indicators

Emoji Status Meaning
🧊 Behind pace Usage below expected budget β€” you have headroom
πŸ”₯ On pace Usage tracking with expected budget
🚨 Ahead of pace Usage above expected budget β€” slow down!

Requirements

  • Python 3.10+
  • Claude Code installed with valid credentials
  • Terminal with Unicode support (for charts and emojis)

How It Works

ccburn reads your Claude Code credentials and fetches usage data from the Anthropic API. It calculates:

  • Budget pace β€” Where you "should" be based on time elapsed in the window
  • Burn rate β€” How fast you're consuming your limit
  • Time to limit β€” Estimated time until you hit 100% (if current rate continues)

Data is stored locally in SQLite for historical analysis and to minimize API calls when running multiple instances.

Troubleshooting

"Credentials not found"

Ensure Claude Code is installed and you've logged in at least once:

claude  # This will prompt for login if needed

Chart not displaying correctly

Ensure your terminal supports Unicode and has a monospace font with emoji support. Recommended terminals:

  • Windows: Windows Terminal
  • macOS: iTerm2, Terminal.app
  • Linux: Kitty, Alacritty, GNOME Terminal

Stale data indicator

If you see "(stale)" in the header, ccburn couldn't reach the API. It will continue showing cached data and retry automatically.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT

Acknowledgments

  • Rich β€” Beautiful terminal formatting
  • Plotext β€” Terminal plotting
  • Typer β€” CLI framework

About

πŸ”₯ Claude Code usage limits β€” TUI with burn-up charts, compact mode for status bars, JSON for automation

Resources

License

Stars

Watchers

Forks

Packages

No packages published