A community-driven registry for Claude, Cursor, Windsurf, Cline & more. Not affiliated with Anthropic.
Are you the author? Sign in to claim
Intercept LLM API traffic and visualize token usage in a real-time terminal dashboard. Track costs, debug prompts,
Token Tracker for LLM CLI Tools
Installation • Quick Start • Features • Commands • Contributing
tokentap tracks token usage for LLM CLI tools with a live terminal dashboard. See exactly how many tokens you're using in real-time.
pip install tokentap
Or install from source:
git clone https://github.com/jmuncor/tokentap.git
cd tokentap
pip install -e .
tokentap start
You'll be prompted to choose where to save captured prompts, then the dashboard appears:
┌─────────────────────────────────────────────────────────────┐
│ TOKENTAP - LLM Traffic Inspector │
├─────────────────────────────────────────────────────────────┤
│ Context Usage ████████████░░░░░░░░░░░░░░░░ 42% │
│ (84,231 / 200,000 tokens) │
├─────────────────────────────────────────────────────────────┤
│ Time Provider Model Tokens │
│ 14:23:01 Anthropic claude-sonnet-4-20250514 12,847 │
│ 14:23:45 Anthropic claude-sonnet-4-20250514 8,234 │
│ 14:24:12 Anthropic claude-sonnet-4-20250514 15,102 │
├─────────────────────────────────────────────────────────────┤
│ Last Prompt: "Can you help me refactor this function..." │
└─────────────────────────────────────────────────────────────┘
# For Claude Code
tokentap claude
# For Gemini CLI (see known issues)
tokentap gemini
# For OpenAI Codex
tokentap codex
# For MiniMax-powered tools
tokentap run --provider minimax python my_app.py
That's it! Watch the dashboard update in real-time as you work.
Real-time token tracking with color-coded fuel gauge:
Every intercepted request is saved to your chosen directory:
When you exit, see your total usage:
Session complete. Total: 84,231 tokens across 12 requests.
| Command | Description |
|---|---|
tokentap start | Start the proxy and dashboard |
tokentap claude | Run Claude Code with proxy configured |
tokentap gemini | Run Gemini CLI with proxy configured |
tokentap codex | Run OpenAI Codex CLI with proxy configured |
tokentap run --provider <name> <cmd> | Run any command with proxy configured |
Supported providers for --provider: anthropic, openai, gemini, minimax
tokentap start [OPTIONS]
Options:
-p, --port NUM Proxy port (default: 8080)
-l, --limit NUM Token limit for fuel gauge (default: 200000)
tokentap claude [OPTIONS] [ARGS]...
Options:
-p, --port NUM Proxy port (default: 8080)
┌─────────────────────────────────────────────────────────────────┐
│ Terminal 1: tokentap start │
│ ┌─────────────────────────────────────────────────────────────┐│
│ │ HTTP Proxy (localhost:8080) ││
│ │ + Dashboard ││
│ │ + Prompt Archive ││
│ └─────────────────────────────────────────────────────────────┘│
└───────────────────────────────┬─────────────────────────────────┘
│ HTTP
│
┌───────────────────────────────┴─────────────────────────────────┐
│ Terminal 2: tokentap claude │
│ ┌─────────────────────────────────────────────────────────────┐│
│ │ Sets ANTHROPIC_BASE_URL=http://localhost:8080 ││
│ │ Runs: claude ││
│ └─────────────────────────────────────────────────────────────┘│
└─────────────────────────────────────────────────────────────────┘
│
│ HTTPS
▼
┌───────────────────┐
│ api.anthropic.com │
└───────────────────┘
For OpenAI-compatible providers like MiniMax, tokentap uses path-prefix routing so requests are forwarded to the correct upstream API:
tokentap run --provider minimax python my_app.py
→ sets OPENAI_BASE_URL=http://localhost:8080/minimax/v1
→ requests arrive at /minimax/v1/chat/completions
→ proxy strips prefix, forwards to https://api.minimax.io/v1/chat/completions
| Provider | Command | Status |
|---|---|---|
| Anthropic (Claude Code) | tokentap claude | Supported |
| Google (Gemini CLI) | tokentap gemini | Blocked by upstream issue |
| OpenAI (Codex) | tokentap codex | Supported |
| MiniMax | tokentap run --provider minimax <cmd> | Supported |
Gemini CLI currently has a known issue where it ignores custom base URLs when using OAuth authentication. tokentap's Gemini support will work automatically once the Gemini CLI team fixes this issue.
Contributions are welcome! Here's how you can help:
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)git clone https://github.com/jmuncor/tokentap.git
cd tokentap
python -m venv venv
source venv/bin/activate
pip install -e .
This project is licensed under the MIT License - see the LICENSE file for details.
See what's really being sent to the LLM. Track. Learn. Optimize.
Native macOS app to monitor Claude AI usage limits and watch your coding sessions live
npx CLI installing 100+ agents, commands, hooks, and integrations in one command
干净、强大、属于你的 AI Agent 平台 --AI agents, without the clutter.
Pocket Flow: Codebase to Tutorial