Saturday, September 26, 2026

cost-xray

★2,163Must watch

Wire-level X-ray for Claude Code and Codex — see the real API request and what each part costs, not just a session total.

cost-xray

Why it matters

cost-xray sits as a local capture hop in front of Claude Code and Codex. It records the actual request bytes the model receives — system prompt, tool schemas, MCP blocks, tool results, cache reads and writes, thinking — then attributes tokens and dollars back to those sources down to individual tool calls. A TUI lets you drill agent → project → session → category → MCP server → tool → turn. Capture is local-only, no account, and wrappers self-heal so a dead proxy never breaks the agent.

Log-based spend tools answer how much you spent. They miss the request-time prefix that never lands in the transcript: injected schemas, MCP catalogs, reminders. That invisible half of the context is often what bloats the bill and crowds the window. Founders running heavy agent days need to know which MCP is dead weight and which tool call owns the dollars.

How it works

Install with the one-line script, pick Claude Code, Codex, or both, open a new terminal, and work as usual. Run cx for the live dashboard, cx stop to pause capture, cx status to check services. Drill from session totals into context-window occupancy and per-source cost with cache split on every cell.

Unlike CodeBurn and other transcript ledgers, cost-xray reads the wire, not the log. That is how it prices schemas and unused MCP overhead that never appear in local history — session spend tools still matter for multi-app totals; this is the microscope under a single coding-agent request.

agentsobservabilitycostclaude-codecodex
Source ↗

Via github

X