A lightweight statusline for Claude Code that shows where your context tokens are going and how much you're spending.
- 📊 Context breakdown - Visual bar showing token usage by segment
- 🚦 Degradation thresholds - Color-coded warnings as context fills up
- 💰 Cost tracking - Session and daily spending at a glance
- 🔀 Git integration - Branch, staged/unstaged changes, ahead/behind
- 📁 Working directory - Fish-style abbreviated paths
Built in Rust with zero runtime dependencies. A statusline runs on every prompt, so speed matters.
| Metric | cc-statusline | Typical Node.js CLI |
|---|---|---|
| ⚡ Binary size | ~620KB | 50-100MB+ (with node_modules) |
| 🚀 Startup | <50ms | 200-500ms |
| 💾 Memory | <5MB | 30-100MB |
[opus] ▓▓▓████████████░░░░░░░░ 42% 116k left │ 1h 30m │ $0.45 / $12.30 │ main ✚2 │ ~/d/myproject
▲ context bar ▲ remaining ▲ elapsed ▲ cost ▲ git ▲ path
Context bar — two textures show overhead vs conversation at a glance:
- 🔵
▓Blue = base system prompt (~5k) - 🩵
▓Cyan = skills - 🟣
▓Magenta = plugins - 🟡
▓Yellow = MCP servers - 🟢
█Green = conversation - ⬜
░Gray = available
Degradation thresholds — percentage color warns you as context fills:
| Range | Color | Meaning |
|---|---|---|
| 0–33% | plain | Optimal — plenty of room |
| 34–60% | yellow | Degrading — recall precision drops |
| 61–75% | red | Danger — approaching compaction |
| 76%+ | bold red | Critical — auto-compaction imminent |
Remaining tokens shown after percentage (e.g. 178k left, 1.2m left).
Other indicators:
- 🟢 green branch = clean, 🔴 red = dirty,
↑↓ahead/behind,✚●?staged/unstaged/untracked - Paths are fish-style abbreviated (
~/d/cc-statusline)
Run cc-statusline --legend to see this in your terminal.
curl -fsSL https://raw.githubusercontent.com/Demwunz/cc-statusline/main/install.sh | bashbrew tap Demwunz/tap
brew install cc-statuslineDownload from releases:
# x86_64
sudo dpkg -i cc-statusline_0.1.0_amd64.deb
# ARM64
sudo dpkg -i cc-statusline_0.1.0_arm64.debcargo install cc-statuslinegit clone https://github.com/Demwunz/cc-statusline.git
cd cc-statusline
cargo install --path .Add to your ~/.claude/settings.json:
{
"statusLine": {
"type": "command",
"command": "cc-statusline"
}
}- Claude Code pipes JSON to stdin with token counts and model info
- The binary scans
~/.claudefor skills, plugins, and MCP servers - It reads
~/.claude/projects/**/*.jsonlfor daily cost totals - Outputs a single ANSI-colored line
Create ~/.config/cc-statusline/config.toml to customize:
[format]
show_model = true
show_cost = true
show_daily_cost = true
bar_width = 24 # 0 = auto-detect
plan = "api" # "api" (pay-per-token) or "max" (subscription)
plan_cost = 100.0 # Monthly cost of your Max plan (for savings calculation)
show_git = true # Show git branch and status
show_cwd = true # Show current working directory (fish-style)
[colors]
base = "blue"
skills = "cyan"
plugins = "magenta"
mcp = "yellow"
conversation = "green"
empty = "gray"
[cache]
ttl_seconds = 5# Normal mode - reads JSON from stdin (Claude Code sends this automatically)
echo '{"model":{"display_name":"Opus"},"context_window":{"total_input_tokens":50000,"total_output_tokens":10000,"context_window_size":200000,"used_percentage":11.0,"remaining_percentage":89.0},"cost":{"total_cost_usd":0.45,"total_duration_ms":5400000}}' | cc-statusline
# Show what the colors mean
cc-statusline --legend
# Version
cc-statusline --versionMIT
