tigerless-labs/cost-xray
A local proxy that captures API traffic from Claude Code and Codex to attribute token and dollar costs to each request component.

cost-xray runs as a local MITM proxy in front of Claude Code and Codex, intercepting the actual API requests those agents send. It breaks down each turn’s tokens and cost by source — system prompts, tool schemas, MCP blocks, tool results, cache reads/writes, and prior thinking blocks — and presents them in a web UI grouped by agent, project, and session. The tool is local-only, requires no telemetry, and is intended to help developers understand why a given agent turn cost what it did.
Frequently asked
- What is tigerless-labs/cost-xray?
- A local proxy that captures API traffic from Claude Code and Codex to attribute token and dollar costs to each request component.
- Is cost-xray open source?
- Yes — tigerless-labs/cost-xray is open source, released under the MIT license.
- What language is cost-xray written in?
- tigerless-labs/cost-xray is primarily written in Python.
- How popular is cost-xray?
- tigerless-labs/cost-xray has 3.1k stars on GitHub.
- Where can I find cost-xray?
- tigerless-labs/cost-xray is on GitHub at https://github.com/tigerless-labs/cost-xray.