If you've ever wondered just how much those late-night Claude Code sessions are costing you, a new Rust-based terminal tool aims to give you the answers. Ccost (stylized as ccoΒst) is a text-based user interface that parses local Codex and Claude Code session logs, providing persistent full-text search alongside detailed API cost estimation for every conversation. The tool stores sessions from ~/.codex/sessions or ~/.claude/projects depending on which AI assistant you're running. What sets it apart from just grepping through log files is the underlying architecture: Ccost builds a finite-state transducer (FST) term index with prefix matching and match highlighting, so search across thousands of sessions stays fast even as your history grows. On startup, Ccost uses a persisted Merkle tree to cache session data. A file watcher monitors for changes, meaning live edits to session logs trigger incremental re-indexing without rebuilding everything from scratch. The maintainer notes that session JSONL files are the source of truthβcache files are disposable and can be safely deleted if corruption is detected. The sorting options reveal this tool's real audience: power users who want visibility into their AI spending habits. You can sort sessions by total cost, timestamp, token counts, web search frequency, model used, session ID, or first prompt text. Default view sorts by cost descending, so your most expensive sessions float right to the top. Pricing support covers GPT-5.5, GPT-5.4, and the full Claude Opus/Sonnet/Haiku family with built-in rate defaults. Users can override pricing via a JSON config file using flags like input_per_m (per million input tokens), cached_input_per_m, output_per_m, and long context multipliers for models that charge extra at higher context windows. Installation is straightforward via Homebrew: brew install --cask peterxcli/tap/ccost. The CLI accepts --sessions to point at custom directories, --pricing for custom pricing JSON files, and flags like --read-only-index for environments where you don't want cache writes or --force-index if you're confident no other instance is running.
Key Takeaways
- Rust-powered TUI with FST indexing gives sub-second search across AI session history
- Built-in cost estimation for GPT-5.5/5.4 and Claude Opus/Sonnet/Haiku models
- Merkle tree caching plus file watching enables efficient incremental updates
- Sort by cost, tokens, time, or model to surface spending patterns
The Bottom Line
Ccost fills a gap that's been missing from the AI coding tooling ecosystemβthe ability to actually see what you're burning through on these subscriptions. For teams running multiple developers on Claude Code or Codex, this kind of visibility isn't just nice-to-have, it's essential budget hygiene.