Skip to content
Piebald-AIPublic

About

Fast, cross-platform, real-time token usage tracker and cost monitor for Claude Code / Codex CLI / Antigravity CLI / Qwen Code / Cline / Zoo Code / Kilo Code / GitHub Copilot / OpenCode / Pi Agent / Piebald.

Topics

Resources

Stars

224 stars

Watchers

5 watching

Forks

Repository files navigation

Check out Piebald

We've released Piebald, the ultimate agentic AI developer experience.
Download it and try it out for free! https://piebald.ai/

Join our Discord X

Scroll down for Splitrail. 👇

Splitrail

Splitrail is a fast, cross-platform, real-time token usage tracker and cost monitor for:

Run one command to instantly review all of your CLI coding agent usage. Upload your usage data to your private account on the Splitrail Cloud for safe-keeping and cross-machine usage aggregation. From the team behind Piebald.

Note

⭐ If you find Splitrail useful, please consider starring the repository to show your support! ⭐

Download the binary for your platform on the Releases page.

Screenshots

Screenshot of the Splitrail CLI

Screenshot of the Splitrail VS Code Extension

Screenshot of Splitrail Cloud

Local Web Dashboard

Run splitrail web and open http://127.0.0.1:8765. Use splitrail web --port 9000 to choose another port. The server listens only on 127.0.0.1 and accepts that IP in the Host header. It reads local usage through the existing analyzers without uploading it. Static assets are embedded in the binary; no frontend build or Node installation is needed to run it.

The overview shows estimated cost, total tokens, session count, and cache share, with comparisons against the previous period. Filter by today, 7, 30, or 90 days, or all history, and select tools, models, or projects. Selections within one field combine; selections across fields narrow the result. Linked worktrees, repository subdirectories, and paths connected by an analyzer's project hash are grouped into one project. Hover a project to see its merged paths.

Switch between cost and tokens, and group the stacked trend by model, tool, or project. The chart supports hourly, daily, weekly, and monthly intervals; click a daily bar to inspect that day by hour. Focus the chart and use the arrow keys to read values, or Enter to drill into a day. Model, tool, and project rankings also filter on click. The five entities with the highest cost in the selected period keep their colors while filters change; the rest are grouped as Other.

Usage snapshots are saved in the system cache directory under splitrail/web-usage-v1.json. On restart, the page immediately shows the saved snapshot while a background scan refreshes it, then updates automatically. The first run without a valid cache waits for a scan. Click Refresh to scan again. Concurrent refreshes share one scan, cached pages remain available during scanning, and a failed refresh preserves the previous snapshot. Cache files with a different application version or timezone are ignored. Dates and hours use the machine's local time. Total tokens match the TUI: input + output + cached; reasoning tokens are not added again. Costs use public API prices and may differ from subscription spending.

Frontend aggregation tests run with node --test src/web/data.test.mjs.

The Sessions tab provides search, sorting by recency/cost/tokens/duration, and a paginated list. Select a session to see its whole-session totals, reply and tool-call counts, token mix, model usage, and hourly or daily timeline. Shared filters select sessions; the detail panel shows the entire selected session.

The Breakdown tab groups the filtered usage by period, project, model, or tool. Export CSV downloads the same groups, columns, ordering, and total row with exact numeric values. Shares are fractions between 0 and 1; text labels are escaped for spreadsheet use. View and filter selections are kept in the URL hash for bookmarks.

English is the default language; choose Simplified or Traditional Chinese in the header. The preference is saved locally. The dashboard follows the system's light/dark appearance and adapts to phone widths, with horizontally scrollable charts and tables. Overview also includes a weekday/hour activity heatmap and the largest sessions.

MCP Server

Splitrail can run as an MCP (Model Context Protocol) server, allowing AI assistants to query your usage statistics programmatically.

splitrail mcp

Available Tools

  • get_daily_stats - Query usage statistics with date filtering
  • get_model_usage - Analyze model usage distribution
  • get_cost_breakdown - Get cost breakdown over a date range
  • get_file_operations - Get file operation statistics
  • compare_tools - Compare usage across different AI coding tools
  • list_analyzers - List available analyzers

Resources

  • splitrail://summary - Daily summaries across all dates
  • splitrail://models - Model usage breakdown

Configuration

Splitrail stores its configuration at ~/.splitrail.toml:

[server]
url = "https://splitrail.dev"
api_token = "your-api-token"

[upload]
auto_upload = false
upload_today_only = false

[formatting]
number_comma = false
number_human = false
locale = "en"
decimal_places = 2

[logging]
level = "warn"

Development

Windows

On Windows, we use lld-link.exe from LLVM to significantly speed up compilation, so you'll need to install it to compile Splitrail. Example for winget:

winget install --id LLVM.LLVM

Then add it to your system PATH:

:: Command prompt
setx /M PATH "%PATH%;C:\Program Files\LLVM\bin\"
set "PATH=%PATH%;C:\Program Files\LLVM\bin"

or

# PowerShell
setx /M PATH "$env:PATH;C:\Program Files\LLVM\bin\"
$env:PATH = "$env:PATH;C:\Program Files\LLVM\bin\"

Then use standard Cargo commands to build and run:

cargo run

macOS/Linux

Build as normal:

cargo run

License

MIT

Copyright © 2026 Piebald LLC.

About

Fast, cross-platform, real-time token usage tracker and cost monitor for Claude Code / Codex CLI / Antigravity CLI / Qwen Code / Cline / Zoo Code / Kilo Code / GitHub Copilot / OpenCode / Pi Agent / Piebald.

Topics

Resources

Stars

224 stars

Watchers

5 watching

Forks

Releases

Packages

Contributors

Languages