cd /news/ai-tools/how-much-are-claude-code-codex-openc… · home › topics › ai-tools › article
[ARTICLE · art-170657] src=ainexusdaily.vercel.app ↗ pub= topic=ai-tools verified=true sentiment=· neutral

How Much Are Claude Code, Codex & OpenCode Actually Costing You? (Zero-Dependency Local Spend Auditor)

A developer released audit_ai_spend.py, a zero-dependency, read-only Python standard-library script that aggregates local token telemetry from Claude Code, OpenAI Codex CLI, Google Antigravity, OpenCode, xAI Grok CLI, Cline and Roo Code to compute real 30-day AI coding spend without uploading prompts or file paths. The author reports that scanning only uncompressed ~/.codex/sessions missed over 60% of 30-day Codex calls rotated into .jsonl.zst archives, that naive token calculators overestimate agent bills by 4x–6x by ignoring 90%+ prompt-cache hit rates, and that a dedicated 24GB GPU pod only beats pay-as-you-go APIs once post-cache spend crosses about $125/month. The companion web tool at ai-cost-radar-nlu.pages.dev lets users drag-and-drop .jsonl/.csv logs locally and export a LiteLLM config.yaml, with code under an MIT license on GitHub.

read3 min views4 publishedNov 16, 2026
How Much Are Claude Code, Codex & OpenCode Actually Costing You? (Zero-Dependency Local Spend Auditor)
Image: Ainexusdaily (auto-discovered)

If you bounce between Claude Code, OpenAI Codex CLI, Google Antigravity, OpenCode, xAI Grok CLI, and Cline / Roo Code, you quickly run into a blind spot: every agent stores local token telemetry in a completely different format — and even uses incompatible prompt-cache accounting rules. Anthropic / Antigravity / OpenCode log uncached input, cache_read, and cache_write as separate additive buckets (total_input = input + cache_read + cache_write). OpenAI / Codex CLI / Grok CLI log cached_tokens as an inclusive subset already inside input_tokens (plus Codex silently compresses older sessions into ~/.codex/archived_sessions/*.jsonl.zst, while OpenCode v2 migrated from JSON files to a local SQLite opencode.db). To see my real 30-day token burn without up a single prompt or file path anywhere, I built a zero-dependency, 100% read-only Python stdlib auditor (audit_ai_spend.py) + an open-source API vs. GPU Break-Even Calculator.

pip install, 100% Local Read-Only) curl -fsSL https://ai-cost-radar-nlu.pages.dev/audit_ai_spend.py | python3 - --days 30 --lang en --region global (Security tip: you can inspect the script first with curl -fsSL https://ai-cost-radar-nlu.pages.dev/audit_ai_spend.py | less — it uses only Python's standard library json, sqlite3 in ?mode=ro read-only URI mode, and in-memory zstd decoding.) Client Local Telemetry Source Accounting Nuance Handled Claude Code ~/.claude/projects//*.jsonl Streaming message.id dedupe + additive cache math OpenAI Codex ~/.codex/sessions//.jsonl + archived_sessions/.jsonl.zst In-memory .zst decode + response_id retry dedupe (skips duplicate event_msg:token_count) Google Antigravity ~/.gemini/antigravity/brain//.system_generated/logs/transcript.jsonl Reads PLANNER_RESPONSE steps & skips transcript_full.jsonl to prevent 2x double-counting OpenCode ~/.local/share/opencode/opencode.db + legacy JSON Read-only SQLite ?mode=ro with per-row timestamp cutoff + legacy JSON ID dedupe xAI Grok CLI ~/.grok/sessions///updates.jsonl + summary.json Filters turn_completed events with inclusive inputTokens + cacheCreationTokens Cline / Roo Code globalStorage/.../tasks//ui_messages.json Extracts api_req_started cost & additive cache reads/writes WorkBuddy / Qwen ~/.workbuddy, ~/.codebuddy, ~/.qwen, ~/.qoder Multi-turn JSONL & read-only SQLite session aggregation Codex .jsonl.zst archives hide most of your 30-day history: Scanning only uncompressed ~/.codex/sessions missed over 60% of my 30-day Codex calls that had been rotated into .jsonl.zst. 90%+ prompt-cache hit rates completely change the API vs. Self-Hosted GPU math: Naive token calculators multiply total context tokens by full uncached input rates, overestimating agent bills by 4x–6x. Once you account for real cache read discounts, renting a dedicated 24GB GPU pod (e.g., RTX 4090 / A100 on RunPod) only beats Pay-As-You-Go APIs when post-cache spend crosses ~$125/month — below that, Pay-As-You-Go or a lightweight ~$5/month LiteLLM semantic-cache proxy wins.

A single runaway debug loop can eat 25% of your monthly budget: In the companion web tool, you can drag-and-drop multiple .jsonl / .csv logs locally in your browser (zero server upload) and toggle "Exclude #1 Spike Session" to compare your steady-state daily burn and export a zero-code LiteLLM config.yaml. Live Calculator & Spend Auditor (English / USD): https://ai-cost-radar-nlu.pages.dev/ai-coding-spend-auditor/ GitHub Repository (MIT, Python 3.12+ stdlib + Vanilla ES2024): https://github.com/huangbuqubunao-alt/ai-cost-radar (Transparency note: the open-source repo has zero trackers; selected cloud host cards on the web directory may carry partner referral links at identical official catalog prices.) If your daily-driver coding CLI stores token logs in another path or schema, drop a comment below and I'll add exact parser support for it!

Key Takeaways #

  • •OpenAI / Codex CLI / Grok CLI log cached_tokens as an inclusive subset already inside input_tokens (plus Codex silently compresses older sessions into ~/.codex/archived_sessions/*.jsonl.zst, while OpenCode v2 migrated from JSON files to a local SQLite opencode.db).
  • •This story was reported by Dev.to , covering developments in thedev space.
  • •AI advancements continue to reshape industries — read the full article on Dev.to for complete coverage.

📖 Continue reading the full article:

Read Full Article on Dev.to →

── more in #ai-tools 4 stories · sorted by recency
── more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/how-much-are-claude-…] indexed:0 read:3min 2026-11-16 · —