AI Deck

Tokentap — An open-source CLI that visualizes token usage from Claude Code and Codex in real time

Tokentap is an open-source tool that shows, in a terminal dashboard, how many tokens AI coding CLIs such as Claude Code and OpenAI Codex are actually sending and receiving in real time. It is developed by Juan Munoz (GitHub: jmuncor). It works by routing API requests through a local HTTP proxy, so no certificate installation and no configuration file are required. Just wrap your usual command, as in tokentap claude, and it starts working. The first PyPI release was in February 2026, and the license is MIT. The repository notes “formerly Sherlock,” reflecting a rename during development.

When you work with AI coding agents, it is easy to lose track of how much context you have consumed and how much a single exchange cost. Tokentap fills that blind spot with a color-coded gauge and a line-by-line log.

Key Features

  • Live dashboard with a fuel gauge: tokentap start launches a dashboard that shows context usage as a bar. It is green below 50%, yellow between 50% and 80%, and red above 80%, so you can see at a glance when the limit is approaching
  • Per-request log: Time, provider, model name, and token count stack up one line at a time, letting you trace which exchange was the heavy one
  • Automatic prompt archive: Every intercepted request is saved in two formats — Markdown (human-readable, with metadata) and JSON (the raw API request body) — into a directory you choose at startup. Useful when you want to verify what the agent is sending behind the scenes
  • Zero-config wrapper approach: tokentap claude points ANTHROPIC_BASE_URL at the local proxy and then launches claude. No MITM certificate is needed, and the environment variable disappears when you are done
  • Multiple providers: In addition to Anthropic (Claude Code) and OpenAI (Codex), you can measure OpenAI-compatible APIs such as MiniMax with tokentap run --provider <name> <command>. A subcommand for Gemini CLI is also provided
  • Session summary: On exit, it prints the total token count and request count, which is handy for reviewing how heavy a session was

The startup options are minimal: tokentap start accepts a proxy port (-p, default 8080) and a token limit for the gauge (-l, default 200,000). Matching the limit to the context length of the model you actually use makes the gauge meaningful.

Pricing

PlanPriceWhat you get
Open source (MIT license)$0All features. Install with pip install tokentap; requires Python 3.10 or later

Tokentap itself is free, and no paid plan or hosted service is confirmed in the publicly available information. Of course, the usage fees for the tools it measures — Claude Code, Codex, and so on — are billed separately.

Pricing is current as of August 2026. Please check the official repository for the latest information.

Pros & Cons

Pros

  • Lightweight to adopt — pip install tokentap plus wrapping your existing command, with no config file and no certificate
  • It watches actual API traffic rather than reading logs after the fact, so it is genuinely real time
  • Prompts are preserved as Markdown and JSON, giving you material for debugging agent behavior and improving prompts
  • MIT-licensed open source that you can read and verify; the proxy runs entirely on your machine
  • Claude Code, Codex, and OpenAI-compatible APIs can all be measured through the same lens

⚠️ Cons

  • Gemini CLI cannot be measured at the moment. Gemini CLI has a known issue where it ignores a custom base URL under OAuth authentication, and the repository states that support is waiting on an upstream fix
  • Supported platforms are macOS and Linux; Windows is not included in the repository badges
  • The version is still in the 0.1 series, so features and behavior may change
  • It uses two terminals — one for the dashboard, one for the tool — which is awkward on a small screen
  • Prompts are written to local disk as-is, so if you handle business data you need to manage the archive directory carefully

Comparison with Similar Services

CriteriaTokentaptokentabtokitokscale
Measurement methodIntercepts API traffic via a local proxyParses session logs (JSONL)Parses session logs (JSONL)Parses session logs
Real-timeHigh (updates on every request)Mostly after-the-fact aggregationFast reports via a resident daemonMostly after-the-fact aggregation
Prompt archivingAuto-saved as Markdown / JSONNot coveredNot coveredNot covered
Main outputLive context usage gaugeCost by model, project, and dayUsage reportsUsage totals and a global leaderboard
ImplementationPython (3.10+)Rust

Roughly speaking, Tokentap is a tool for seeing what is happening in the current session, while the other three aggregate how much you have used so far. If your goal is monthly cost accounting, a log-parsing tool fits; if it is avoiding context overflow or verifying prompts, Tokentap fits.

Who Is It For

  • People running Claude Code or Codex for long stretches who want early warning before the context fills up
  • People who want to confirm, from raw requests, what an AI agent is actually sending
  • People who want to trim their own prompts and tool definitions while comparing token counts as numbers
  • People who also want to watch consumption from their own scripts built on OpenAI-compatible APIs
  • People looking for a light tool that needs no certificates or cloud integration and adds few dependencies

Summary

Tokentap pulls the invisible cost of AI coding CLIs — token consumption — out into the terminal. Because it works as a proxy, it gives you real-time visibility and the original prompts, which log-parsing tools cannot provide; in exchange, you have to accept the lack of Gemini CLI support and the youth of a 0.1-series release. A good way to try it is to replace your usual claude with tokentap claude and watch the gauge for a single session.

← Blog