Real-time token & spend visibility in your terminal.
Track active sessions, subagents, cache efficiency, and API spend across Claude Code, Codex, Gemini CLI, Antigravity CLI, Pi, and OpenCode. 100% local SQLite index. Zero telemetry.
$/bin/sh -c "$(curl -fsSL https://tokenhawk.dev/install.sh)" $go install github.com/polera/tokenhawk@latest $gh release download -R polera/tokenhawk Releases ↗
One terminal interface. Five purpose-built views.
Switch views inside the interactive TUI with keyboard numbers 1 to 4 or Tab. Inspect real session metrics below.





Why cache hits dictate your monthly AI bill.
Modern coding agents replay thousands of lines of context on every turn. Prompt caching discounts cached tokens by up to 90%. When cache breaks, costs multiply rapidly.
Tokenhawk flags sessions with 100,000+ input tokens and < 80% cache hit ratio with an immediate LOW CACHE alert in the dashboard and live status line.
Granular telemetry without the overhead.
Built as a zero-dependency Bubble Tea terminal application. Indexes files already on disk.
Multi-Provider Aggregation
Read session logs across Claude Code, Codex, Gemini CLI, Antigravity CLI, Pi, and OpenCode simultaneously.
Subagent Hierarchy
Break out parent agent sessions from spawned subagents. Track running status, token consumption, and child costs individually.
Low-Cache Alarms
Instant visual warning when cache invalidations cause prompt recomputation on large contexts.
Time-Windowed Spend
Analyze spend by day, model, or provider across relative windows like 24h, 7d, 30d, mtd, or custom dates.
Transcript Search
Instant on-demand literal or regex search across all local transcripts. View chronological message history directly in the TUI.
Headless Export & CLI
Pipe structured JSON or CSV data into reporting scripts, billing pipelines, or CI runs without launching the interactive UI.
Discovery paths & integration points
Tokenhawk reads local storage roots out of the box with zero required provider setup.
| Provider | Default Storage Location | Pricing Method | Subagents | Status Integration |
|---|---|---|---|---|
| Claude Code | ~/.claude/projects/**/*.jsonl | API List Rate / Admin API | Supported | Native statusline hook |
| Codex | $CODEX_HOME/sessions/**/*.jsonl | API List Rate | Supported | Universal wrapper / tmux |
| Gemini CLI | ~/.gemini/tmp/*/chats/session-*.json | API List Rate | N/A | Universal wrapper / tmux |
| Antigravity CLI (agy) | ~/.gemini/antigravity-cli/conversations/*.db | Underlying Model Rate | N/A | Native statusline hook |
| Pi | ~/.pi/agent/sessions/**/*.jsonl | Provider-Reported | N/A | Universal wrapper / tmux |
| OpenCode | ~/.local/share/opencode/opencode.db | Reported / Model Rate | Supported | Universal wrapper / tmux |
Keep live metrics in your prompt.
Embed Tokenhawk directly in Claude Code, Antigravity CLI, or run any tool with our built-in terminal wrapper.
// ~/.claude/settings.json
{
"statusLine": {
"type": "command",
"command": "tokenhawk statusline claude",
"refreshInterval": 2,
"padding": 0
}
}Your code and prompts stay on your machine.
Tokenhawk indexes only session metadata (timestamps, token counts, model names, cost estimates). Prompts, completions, tool call arguments, and credentials are never indexed or transmitted anywhere.
Transcript searches read raw session files into memory strictly on demand during user queries and are never persisted to Tokenhawk's SQLite database.
Read full privacy specification →- Session & model identifiers
- Input / Cached / Output token counters
- Session start & update timestamps
- Parent and subagent hierarchy
- API catalog rate calculations
- Project directory paths
- Prompt text and user queries
- Model responses and completions
- Tool arguments and execution results
- API keys or authentication tokens
- Telemetry or analytics beacons
- Remote cloud sync / accounts
Start monitoring your agents in seconds.
Install the precompiled binary with one command. Compatible with macOS, Linux, and Windows.
$/bin/sh -c "$(curl -fsSL https://tokenhawk.dev/install.sh)"