AI Token Usage — Local Claude, Codex & Gemini Tracker
100% local, zero-network, privacy-first VS Code extension that tracks daily, weekly, and monthly AI token usage across Claude Code, OpenAI Codex CLI, Gemini CLI, and custom local AI tools—paired with a built-in local project reverse-engineering engine that maps token consumption onto your codebase's module dependency graph.
Highlights
- 100% Offline & Privacy-First: Zero runtime dependencies, zero telemetry, and strict Webview CSP (
default-src 'none'). Reads only numeric token counts, timestamps, and file path mentions from local JSONL logs—prompt and code contents are never stored.
- Sub-25ms Incremental Refresh: Byte-offset file cursors (
token-index.json) and mtimeMs caching (arch-index.json) keep memory under 15 MB with zero background polling loops.
- Multi-Tool Local Log Discovery:
- Claude Code:
~/.claude/projects/**/*.jsonl
- OpenAI Codex CLI:
~/.codex/sessions/**/*.jsonl
- Gemini CLI:
~/.gemini/tmp/**/*.jsonl
- Custom Local Tools:
~/.ai-token-usage/custom/*.jsonl
- Built-In Reverse-Engineering Engine: Discovers architectural modules across TypeScript/JavaScript, Python, Go, Rust, Java/Kotlin, and C/C++/C#, classifies module roles (Hub, Entry, Bridge, Leaf), optionally enriches with
graphify-out/graph.json, and attributes AI token consumption per module.
- Rich Status Bar & Sidebar Dashboard: Live status bar pill with an inline 7-day SVG hover chart, circular daily goal ring, radial SVG dependency graph, 7-day bar chart, and 28-day consistency heatmap.
Commands
AI Token Usage: Refresh Usage & Architecture (ai-token-usage.refresh)
AI Token Usage: Open Dashboard (ai-token-usage.openDashboard)
Extension Settings
| Setting |
Type |
Default |
Description |
aiTokenUsage.dailyGoal |
number |
150000 |
Daily token target for progress bar and motivational feedback. |
Drop .jsonl files into ~/.ai-token-usage/custom/*.jsonl with lines shaped like:
{"provider": "Ollama", "tokens": {"input": 1200, "output": 450}, "cwd": "/path/to/project", "ts": "2026-12-05T14:20:00Z"}
License
MIT
| |