OpenTab: A Lazygit-Style TUI for Tracking AI Coding Spend
OpenTab reads local records from AI coding tools like OpenCode, Claude Code, Codex, and Copilot to show your token spend by month, day, project, and model.
OpenTab is a lazygit-style terminal UI that visualizes how much developers are spending in tokens and money across AI coding assistants. It works by reading the local records these tools already keep — OpenCode's SQLite database, Claude Code and Codex session transcripts, GitHub Copilot (CLI and VS Code), Hermes, pi-agent, OpenClaw, and generic CSV/JSONL request logs — then breaks down spend by month, day, project, session, model, and even recursive subagent trees.
Key features include daily/weekly/monthly trend charts, a calendar-style spend heatmap, fzf-style live fuzzy filtering, quick date-range rescoping, and CSV export. For subscription or credit-based usage that shows as $0, a 'what-if' pricing mode reprices those tokens against models.dev's list rates to estimate true metered cost. OpenTab can also generate a self-contained, shareable HTML report (--html) or run a local live web server (--serve) mirroring the same drill-down experience.
Architecturally, OpenTab runs entirely on Python's standard library (curses and sqlite3), avoiding Node.js, npx, or any backend service. It opens all source files read-only, with no network access, telemetry, or accounts — making it usable even in locked-down environments. It's installable via pipx, Homebrew, or from source, and includes a --demo mode that runs on anonymized synthetic data for anyone without real AI-tool history to inspect.