Are you the author? Sign in to claim
Enhanced statusline for Claude Code — see your 7d/30d spend at a glance
Enhanced statusline for Claude Code — adds cost tracking, usage limits, and leaderboard rank to your terminal.

14.6k $2.42 · 40% Opus 4.6 / 5h:45% · 7d:8% · 30d:$866 / #2 $67.0
npm i -g cc-costline && cc-costline install
Open a new Claude Code session and you'll see the enhanced statusline. Requires Node.js >= 22.
npm doesn't auto-update global packages. Run this whenever you want the latest version:
npm i -g cc-costline@latest
| Segment | Example | Description |
|---|---|---|
| Tokens / Cost / Context | 14.6k $2.42 · 40% Opus 4.6 | Session token count, cost, context usage, and model |
| Usage limits | 5h:45% · 7d:8% | Claude 5-hour and 7-day utilization (auto-colored like context). At 100%, shows countdown: 5h:-03:20 |
| Period cost | 30d:$866 | Rolling cost total (configurable: 7d, 30d, or both) |
| Leaderboard | #2 $67.0 | ccclub rank (if installed) |
claude login and it works.npm i -g ccclub && ccclub init). Rank appears automatically.Both are zero-config: if not available, the segment is silently omitted.
cc-costline install # Set up Claude Code integration
cc-costline uninstall # Remove from settings
cc-costline refresh # Manually recalculate cost cache
cc-costline config --period 7d # Show 7-day cost (default)
cc-costline config --period 30d # Show 30-day cost
cc-costline config --period both # Show both periods
install configures ~/.claude/settings.json — sets the statusline command and adds session-end hooks. Your existing settings are preserved.render is called by Claude Code on every turn. It reads token totals from stdin when Claude Code provides them, then reads three caches (no HTTP, no full directory scan):
~/.cc-costline/cache.json/tmp/sl-claude-usage/tmp/sl-ccclub-rankrender spawns a detached cc-costline refresh-bg subprocess that refreshes data in the background. /tmp/sl-refresh.lock prevents concurrent refresh across multiple Claude Code windows, and /tmp/sl-refresh.last throttles spawns to once per 30 s.mtime+size cache reuses entries that haven't changed (~25 ms typical vs ~2 s cold on 1000+ jsonl files)api.anthropic.com/api/oauth/usage. Detects OAuth token rotation to retry immediately with fresh rate limit quota. Stale data persists across failures.ccclub.dev/api/rankrefresh can also be run manually to recalculate the local cost cache; session-end hooks use refresh-bg to warm all caches without blocking Claude Code.Prices per million tokens (USD):
| Model | Input | Output | Cache Write (5m) | Cache Write (1h) | Cache Read |
|---|---|---|---|---|---|
| Fable 5 / Mythos 5 | $10 | $50 | $12.50 | $20 | $1.00 |
| Opus 5 / 4.8 / 4.7 / 4.6 / 4.5 | $5 | $25 | $6.25 | $10 | $0.50 |
| Opus 4.1 / 4 | $15 | $75 | $18.75 | $30 | $1.50 |
| Sonnet 5 / 4.6 / 4.5 / 4 | $3 | $15 | $3.75 | $6 | $0.30 |
| Haiku 4.5 | $1 | $5 | $1.25 | $2 | $0.10 |
| Haiku 3.5 | $0.80 | $4 | $1.00 | $1.60 | $0.08 |
Cache writes are billed by TTL: 5-minute at 1.25x input, 1-hour at 2x input. The
split comes from usage.cache_creation in the transcript; older transcripts
without that breakdown are billed entirely at the 5-minute rate.
Fast mode (usage.speed: "fast", Opus 5 / 4.8) is billed at 2x the standard rate.
Sonnet 5 is listed at its standard $3/$15; introductory pricing of $2/$10 runs through 2026-08-31, so Sonnet 5 costs read slightly high until then.
Unknown models fall back by family name, defaulting to Sonnet pricing.
npm test # Build + run unit tests (node:test, zero dependencies)
cc-costline uninstall
npm uninstall -g cc-costline
MIT
1000+ skills curated from Anthropic, Vercel, Stripe, and other engineering teams
Agent harness performance optimization with skills, instincts, memory, and security
Design enforcement with memory — keeps your UI consistent across a project
Detects 37 AI writing patterns and rewrites text with human rhythm across 5 voice profiles