claudeers.

🔓 unclaimed — this page was auto-generated from GitHub. Are you the creator?

Claim this page →
// Developer Tools

tokentap

Intercept LLM API traffic and visualize token usage in a real-time terminal dashboard. Track costs, debug prompts, and monitor context window usage acr…

// Developer Tools[ cli ][ api ][ claude ]#claude#ai-tools#anthropic#cli#developer-tools#itmproxy#llm#m#devtoolsMIT$open-sourceupdated 15 days ago
Actively maintained
100/100
last commit 18 days ago
last release 3 months ago
releases 2
open issues 0
// install
git clone https://github.com/jmuncor/tokentap

Tokentap (formerly Sherlock)

Token Tracker for LLM CLI Tools

InstallationQuick StartFeaturesCommandsContributing


tokentap tracks token usage for LLM CLI tools with a live terminal dashboard. See exactly how many tokens you're using in real-time.

Why tokentap?

  • Track Token Usage: See exactly how many tokens each request consumes
  • Monitor Context Windows: Visual fuel gauge shows cumulative usage against your limit
  • Debug Prompts: Automatically saves every prompt as markdown and JSON for review
  • Zero Configuration: No certificates, no setup - just install and go

Installation

pip install tokentap

Or install from source:

git clone https://github.com/jmuncor/tokentap.git
cd tokentap
pip install -e .

Requirements

  • Python 3.10+

Quick Start

Terminal 1: Start the Dashboard

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..."   │
└─────────────────────────────────────────────────────────────┘

Terminal 2: Run Your LLM Tool

# 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.

Features

Live Terminal Dashboard

Real-time token tracking with color-coded fuel gauge:

  • Green: < 50% of limit
  • Yellow: 50-80% of limit
  • Red: > 80% of limit

Prompt Archive

Every intercepted request is saved to your chosen directory:

  • Markdown - Human-readable format with metadata
  • JSON - Raw API request body for debugging

Session Summary

When you exit, see your total usage:

Session complete. Total: 84,231 tokens across 12 requests.

Commands

CommandDescription
tokentap startStart the proxy and dashboard
tokentap claudeRun Claude Code with proxy configured
tokentap geminiRun Gemini CLI with proxy configured
tokentap codexRun 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

Options

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)

How It Works

┌─────────────────────────────────────────────────────────────────┐
│  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

Supported Providers

ProviderCommandStatus
Anthropic (Claude Code)tokentap claudeSupported
Google (Gemini CLI)tokentap geminiBlocked by upstream issue
OpenAI (Codex)tokentap codexSupported
MiniMaxtokentap run --provider minimax <cmd>Supported

Known Issues

Gemini CLI

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.

Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Setup

git clone https://github.com/jmuncor/tokentap.git
cd tokentap
python -m venv venv
source venv/bin/activate
pip install -e .

License

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.

tokentap.ai

// compatibility

Platformscli, api
Operating systems
AI compatibilityclaude
LicenseMIT
Pricingopen-source
LanguagePython

// faq

What is tokentap?

Intercept LLM API traffic and visualize token usage in a real-time terminal dashboard. Track costs, debug prompts, and monitor context window usage across your AI development sessions. . It is open-source on GitHub.

Is tokentap free to use?

tokentap is open-source under the MIT license, so it is free to use.

What category does tokentap belong to?

tokentap is listed under devtools in the Claudeers registry of Claude-compatible tools.

0 views
808 stars
unclaimed
updated 15 days ago

// embed badge

tokentap on Claudeers
[![Claudeers](https://claudeers.com/api/badge/tokentap.svg)](https://claudeers.com/tokentap)

// retro hit counter

tokentap hit counter
[![Hits](https://claudeers.com/api/counter/tokentap.svg)](https://claudeers.com/tokentap)

// reviews

// guestbook

0/500

// related in Developer Tools

🔓

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Curs…

// devtoolsaffaan-m/JavaScript225,699MIT[ claude ]
🔓

Use Garry Tan's exact Claude Code setup: 23 opinionated tools that serve as CEO, Designer, Eng Manager, Release Manager, Doc Engineer, and QA

// devtoolsgarrytan/TypeScript119,234MIT[ claude ]
🔓

🙌 OpenHands: AI-Driven Development

// devtoolsOpenHands/Python79,324NOASSERTION[ claude ]
🔓

Makes your AI agent think like the laziest senior dev in the room. The best code is the code you never wrote.

// devtoolsDietrichGebert/JavaScript73,042MIT[ claude ]
→ see how tokentap connects across the ecosystem