Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

claude-token

A Claude Code plugin that displays a compact status box after every Claude response:

╭─ Claude Status ─────────────────────────────────╮
│ Context  █░░░░░░░░░  10%  ~1200 turns left       │
│ Tokens   97k / 1.0M                              │
│ Today    █░░░░░░░░░  92k used  /  1.9M left  2x  │
│ Week     ░░░░░░░░░░  92k used  /  9.9M left  2x  │
╰───────────────────────────────────────────────────╯

What it shows:

  • Context — how much of the 1M token context window is used, with estimated turns remaining
  • Tokens — raw token count for the current session
  • Today / Week — output tokens accumulated vs your configured budget
  • 2x badge — appears automatically during Anthropic's off-peak hours promotions

Color coding: green → yellow → red as usage approaches limits.


Installation

1. Clone into Claude's plugin directory

git clone https://github.com/SomSamantray/Claude-Code-Token-Limit \
  ~/.claude/plugins/marketplaces/community/plugins/claude-token

2. Copy and configure your limits

cp ~/.claude/plugins/marketplaces/community/plugins/claude-token/config.default.json \
   ~/.claude/claude-token-config.json

Then edit ~/.claude/claude-token-config.json:

{
  "dailyLimit": 1000000,
  "weeklyLimit": 5000000
}

Set dailyLimit and weeklyLimit to whatever token budget feels right for your plan. Anthropic doesn't publish fixed token limits — use these as personal pacing guardrails.

3. Register the community marketplace

Add to ~/.claude/plugins/known_marketplaces.json:

{
  "community": {
    "source": { "source": "local" },
    "installLocation": "/Users/YOUR_USERNAME/.claude/plugins/marketplaces/community"
  }
}

Replace YOUR_USERNAME with your macOS username.

4. Enable the plugin

Add to ~/.claude/settings.json under enabledPlugins:

{
  "enabledPlugins": {
    "claude-token@community": true
  }
}

Configuration

All config lives in ~/.claude/claude-token-config.json (outside the plugin dir, so it survives updates).

Field Default Description
dailyLimit 1000000 Daily output token budget
weeklyLimit 5000000 Weekly output token budget
offPeakMultiplier 2 Multiplier applied during off-peak promo hours
promoStartDate "2026-03-13" Start of the 2x promo period
promoEndDate "2026-03-28" End of the 2x promo period (exclusive)

To disable the 2x feature entirely, set "offPeakMultiplier": 1.


How it works

The plugin hooks into Claude Code's Stop event — fired after every response before you type your next message. It reads Claude Code's own session transcript (a JSONL file Claude writes locally) to get the real API token counts, accumulates them in ~/.claude/usage.json, and prints the box to stderr.

No external APIs. No estimated values. Real token data from Claude Code's own logs.


Uninstall

Remove "claude-token@community": true from ~/.claude/settings.json.

About

Claude Code plugin: shows context window %, turns remaining, and daily/weekly token budgets after every response

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages