A developer going by liorwn on GitHub has released claudetop, an open-source terminal status line tool that gives Claude Code users real-time visibility into token usage, API costs, cache efficiency, and burn rates. The project came out of a specific billing shock: the author discovered a $65 charge for what felt like a $10 session, tracing the discrepancy to Claude Code's context compaction feature silently consuming around 80% of token usage without surfacing that cost in the native interface. Claude Code provides no in-session cost feedback, leaving developers on pay-per-token API plans blind until they check their billing dashboard after the fact. Anthropic's flat-rate Max subscribers don't face the same exposure.
Technically, claudetop hooks into a first-party Claude Code extension point that pipes a structured JSON telemetry object to any executable script placed in ~/.claude/claudetop.d/ via stdin after every model turn. It isn't scraping log files or intercepting network traffic — it reads from a documented Claude Code status line API. The JSON payload exposes four distinct token buckets: fresh input, cache-write, cache-read, and output. Separating those matters because the per-token prices vary sharply: cache reads on Claude's Opus tier run around $0.50 per million tokens versus $5 per million for fresh input, a 10x gap. Applying the correct blended price across those buckets is what lets claudetop surface a session's true cost, rather than the understated figure the native UI shows. The entire implementation is a single bash script with jq as its only external dependency, installable via a one-command curl invocation.
The status line shows current model, session duration, cumulative cost, hourly burn rate, monthly projection extrapolated from session history, cache hit ratio, cost-per-line-of-code, and side-by-side model cost comparisons adjusted for the user's actual cache hit ratio. Three contextual alerts round out the display: BURN RATE fires above $15 per hour to catch runaway subagent loops, TRY /fast suggests switching off Opus when cost-per-line exceeds $0.05, and COMPACT SOON fires when the context window hits 80% capacity. Pricing data is pulled daily from a repo-hosted pricing.json, keeping the tool current as Anthropic adjusts model rates. A companion claudetop-stats command aggregates historical spend by day, week, month, or all-time, with optional per-feature cost tagging via environment variables.
claudetop also ships a plugin system with eight example extensions — Spotify now-playing, GitHub Actions CI status, calendar event countdowns, and Jira ticket tracking — each a short executable that reads the same session JSON from stdin and writes colored output to the status line. Anthropic has not announced native cost monitoring for API-billed Claude Code users; <a href="/news/2026-03-14-rudel-open-source-analytics-dashboard-for-claude-code-sessions">third-party tools like Rudel</a> have emerged to address this gap. liorwn says the plugin framework is intentionally minimal: each extension is self-contained, reads stdin, writes stdout, and requires no shared scaffolding. The project is MIT-licensed at github.com/liorwn/claudetop.