Description
cost-xray shows what Claude Code and Codex actually send to the API, and what each part of a request costs. Most usage tools read local logs, which show the total cost of a call or session but miss the context assembled before the model is invoked, such as system prompts, tool schemas, MCP blocks, tool results, cache reads and writes, and earlier thinking blocks. cost-xray captures the local API traffic for those agents and attributes tokens and dollars back to the sources inside each request, so you can see not only how much a turn cost but why. Its interface drills from agent to project to session, showing context-window occupancy and per-source cost down to each MCP server. It needs macOS or Linux and no API keys or account, and it captures traffic through a transparent local hop without changing your agent's results or cost. Claude Code is captured through a reverse proxy that uses a base-URL override, and Codex through a forward proxy with a scoped local certificate authority. Capture runs as a background service that starts on boot, and you can pause it with a stop command. The installer asks which agents to capture, and the project has an install guide and architecture notes. The source is on GitHub.…
Highlights
- Attributes tokens and dollars to each request source
- Shows MCP servers, tools and cache splits
- Captures Claude Code and Codex locally
- No API keys, accounts or agent config changes
Ratings & Reviews
No ratings yet
Be the first to rate Cost Xray.
People also visit
Cost Xray FAQ
What does cost-xray show?
What your coding agent sends to the API in each request, and what each part costs, down to individual MCP servers and tools.
Which agents are supported?
Claude Code and Codex, according to the readme.
Do I need API keys or an account?
No. The readme says no API keys, no account and no config changes to your agent are needed.
Does it change what my agent does?
The readme says capture does not change the agent's behavior, its results or its cost, and you can pause it at any time.
What systems does it run on?
macOS or Linux.
Is it free?
The listing shows it as free.
What are the best Cost Xray alternatives?
Popular alternatives to Cost Xray include Agentacct, Claudetop and CC Monitor. See all Cost Xray alternatives

