Splitrail CLI
Splitrail tracks tokens and cost for Claude Code, Codex, Cline, OpenCode and more agents from local logs and serves them over MCP
- 228 ★ on the repository
- Last commit
- MIT
Extended access
Why this level
- Reads local agent logs that include project and model names and, with upload enabled, sends statistics to splitrail.dev
- Keeps the cloud token in `~/.splitrail.toml` and a statistics cache in the system folder
Install
- Works in
Manual install
splitrail mcpStarts the Splitrail MCP server for agent queries about usage; attach it to a client as a stdio server.
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- Reads local agent logs that include project and model names and, with upload enabled, sends statistics to splitrail.dev
- Keeps the cloud token in `~/.splitrail.toml` and a statistics cache in the system folder
This is third-party code. Review the repository files before installing.
What it does
Splitrail is a fast cross-platform Rust utility that tracks token usage and cost of coding agents in real time. It reads the agents' local files and builds one picture across Gemini CLI and Qwen Code, Claude Code, Codex CLI, Cline, Roo Code, Zoo Code, Kilo Code, GitHub Copilot (VS Code and CLI), OpenCode, Pi Agent, Grok, DeepSeek Harness and Piebald. The `splitrail` command opens a terminal interface, and `splitrail web` starts a local dashboard at `127.0.0.1:8765` (change the port with `--port`). The dashboard prices usage at public API rates, shows tokens, replies, session counts and cache share, compares periods, groups by model, tool and project, and exports CSV. Model aliases live in `~/.splitrail.toml`. `splitrail mcp` starts an MCP server with six tools: `get_daily_stats`, `get_model_usage`, `get_cost_breakdown`, `get_file_operations`, `compare_tools` and `list_analyzers`. Resources are `splitrail://summary` and `splitrail://models`. Uploading statistics to Splitrail Cloud for storage and a cross-machine summary is a separate option, enabled by the `auto_upload` setting or manually.
Who it is for. People who run several coding agents at once and want one report on tokens and cost, and teams who watch spending on subscriptions and APIs.
Good fit when
- You switch between Claude Code, Codex and OpenCode during the day and want the total spend
- You need to find which model or project burns the most money over 7, 30 or 90 days
- The agent itself should answer questions about usage: `splitrail mcp` serves that
- You need a CSV export for a report: the local dashboard exports the selected data
- You want to reconcile usage across several machines through Splitrail Cloud
Not a fit when
- You need an exact subscription bill: cost uses public API prices and can differ from real charges
- The agent is not on the supported list: data comes only from known log formats
- You do not want statistics to leave the machine: keep cloud upload off
Example request
Use splitrail to show how many tokens and how much money went to Claude Code and Codex over the last 30 days and name the most expensive projectLimitations
- Cost uses public API prices, so on subscriptions the total differs from real charges.
- Data comes from the agents' local files. If a user deletes a chat, for example in Piebald, its usage disappears from the report unless a usage archive was saved.
- Installation uses a prebuilt binary from the Releases page, and the README has no package-manager install command; a source build goes through Cargo.
- Splitrail Cloud needs a token in `~/.splitrail.toml`, and with upload enabled the statistics go to splitrail.dev.
How to disable. Delete the `splitrail` binary and the `~/.splitrail.toml` config. If you enabled uploads, first set `auto_upload = false` and delete the token. The dashboard cache sits in the system cache folder as `splitrail/web-usage-v1.json`.
FAQ
How do I install Splitrail?
Download the binary for your platform from the repository's Releases page and run `splitrail`. To build from source, clone the repository and run `cargo run`.
Which agents does Splitrail support?
Gemini CLI and Qwen Code, Claude Code, Codex CLI, Cline, Roo Code, Zoo Code, Kilo Code, GitHub Copilot (VS Code and CLI), OpenCode, Pi Agent, Grok, DeepSeek Harness and Piebald.
Does my data go to the cloud?
Only if you enabled upload. The local dashboard `splitrail web` listens on `127.0.0.1` only and reads data without sending it, while the cloud needs a token and the `[upload]` setting in `~/.splitrail.toml`.
How is Splitrail different from ccusage?
ccusage builds reports from the logs of Claude Code, Codex, Gemini CLI and other agents. Splitrail adds a live terminal view, a local web dashboard, an MCP server for agent queries and a cloud summary across machines.
Can I export the data to CSV?
Yes, the local dashboard `splitrail web` supports CSV export. Model names in it follow the aliases from `~/.splitrail.toml`.
Discussion
No questions or reviews yet.
Related
CLI toolsA CLI and MCP server that tally token spend across 41 tools and agents, break it down by project and model, and help cut wasted tokens
TokenTracker counts tokens and spend across Claude Code, Codex, Cursor, Gemini CLI and other agents from local logs and shows them on a local dashboard
Token and cost reports for Claude Code, Codex, Gemini CLI and other agents from local logs, by day, month and session
Counts token use and cost of Claude Code and Codex sessions from local logs and shows remaining limits in the status line
claudetop shows session cost, cache hit rate, plan limit windows and overspend alerts in the Claude Code status line
A limits and token spend monitor for Claude Code, Codex, Antigravity and Grok CLI: macOS menu bar, Windows tray, HTML reports
Comparison with similar tools
Cards that share the main search query, and how they differ.
| Tool | Official | Authentication | Repository stars | Main difference |
|---|---|---|---|---|
| Splitrail (this card) | no | not required | 228 | |
| ccusage | no | 19,337 | token and cost reports from the local logs of Claude Code, Codex, Gemini CLI and others | |
| Claude Code Usage Monitor | no | 8,792 | a terminal monitor of Claude Code usage in real time, five-hour window |
README in short
The README opens with a Piebald promo and describes Splitrail as a token tracker with a long list of supported agents. It continues with screenshots of the terminal UI, the VS Code extension and the cloud, a section on the local web dashboard with filters and a sessions tab, and a section on the MCP server. The page ends with a `~/.splitrail.toml` example, Piebald usage archives and a source build.