Splitrail is a high-performance, cross-platform usage tracker for AI coding assistants (Claude Code, Copilot, Cline, Pi Agent, etc.). It analyzes local data files from these tools, aggregates usage statistics, and provides real-time TUI monitoring with optional cloud upload capabilities.
Pluggable architecture with the Analyzer trait. Registry in src/analyzer.rs, individual analyzers in src/analyzers/. Each analyzer discovers data sources, parses conversations, and normalizes to a common format.
- Discovery: Analyzers find data files using platform-specific paths (
src/analyzers/) - Parsing: Parse JSON/JSONL into normalized messages (
src/types.rs) - Deduplication: Hash-based dedup using global hash field
- Aggregation: Group by date, compute token counts, costs, file ops (
src/utils.rs) - Display: TUI renders daily stats + real-time updates (
src/tui.rs,src/watcher.rs)
- Follow Rust 2024 edition conventions
- Use
anyhow::Resultfor error handling - Prefer
async/awaitover raw futures - Use
parking_lotlocks overstd::syncfor performance
Run after code changes:
cargo build --quiet
cargo test --quiet
cargo clippy --quiet -- -D warnings
cargo doc --quiet
cargo fmt --all --quietSkills provide task-specific guidance. Use the skill tool to load one when needed - available skills are listed in its description.