HeadlinesBriefing favicon HeadlinesBriefing.com

claudetop: Real-time Cost Tracking for Claude Code Sessions

Hacker News •
×

Developers using Claude Code often face billing surprises, with costs spiking to $65 for what felt like 30 minutes of work. claudetop solves this by providing real-time visibility into token usage, model selection, and spending across sessions. The tool displays current costs, cache efficiency, and projected monthly expenses directly in your terminal.

Built after discovering that compaction was hiding 80% of token usage, claudetop shows exactly what project you're working on, which model is running, and how much it costs per hour. It tracks cache hit ratios to identify inefficiencies and offers smart alerts when costs exceed budgets or cache performance drops below 20%. The tool automatically logs session history and supports tagging for tracking costs by feature or project.

Installation is straightforward with a simple curl command or manual git clone. Users can customize their experience with themes, plugins for additional context like Spotify or GitHub Actions status, and daily budget alerts. claudetop also provides model comparison to show what sessions would cost on Opus, Sonnet, or Haiku, helping developers make informed choices about which model to use.