A minimal, high-signal terminal HUD for Claude CLI that displays real-time token usage, context window status, cost, execution time, and code diff stats.
Built for developers who want instant telemetry about Claude usage directly in the terminal status line.
◆ Claude │ █████░░░░░░ 42% │ ↓12.4k ↑1.1k │ cache r:2.1k/w:500 │ Σ 20k/5k │ +120/-30 │ ⚡350ms ⏱4s │ $0.0123
Field Meaning
Model Claude model name Context Bar Context window usage visual bar ↓ Input Tokens sent to model ↑ Output Tokens generated Cache Cache read / write tokens Σ Totals Total tokens used + / - Lines added / removed ⚡ API API response latency ⏱ Duration Total runtime $ Cost Estimated USD cost
Displays:
- Model name
- Context window usage
- Token usage
- Cache utilization
- Runtime duration
- API latency
- Cost tracking
- Code diff stats
██████░░░░░░ 50%
Color coded:
Color Meaning
Green Safe Yellow Getting full Red Nearly full
Shows both current request tokens and totals.
↓12.4k ↑1.1k
Σ 20k/5k
Where:
- ↓ = input tokens
- ↑ = output tokens
- Σ = session totals
Displays Claude prompt caching stats.
cache r:2.1k / w:500
Metric Meaning
r Cache read tokens w Cache write tokens
$0.0123
Color coded:
Cost Color
< $0.10 Green $0.10 -- $0.50 Yellow > $0.50 Red
⚡350ms ⏱4s
Symbol Meaning
⚡ API response latency ⏱ Total runtime
+120 / -30
Symbol Meaning
+ Lines added - Lines removed
Useful for tracking Claude-generated code changes.
git clone https://github.com/Abhishek-Chougule/claude-cli-statusline.git
cd claude-cli-statuslinechmod +x statusline.shclaude config set statusline ./statusline.shWindows cannot run .sh directly. Use bash explicitly.
claude config set statusline "bash ./statusline.sh"Or with absolute path:
claude config set statusline "bash C:/path/to/claude-cli-statusline/statusline.sh"This works with:
- Git Bash
- WSL
- Linux terminals
- macOS terminals
No chmod required on Windows.
Check Claude configuration:
claude config get statuslineExpected output:
bash ./statusline.sh
The script expects JSON input from stdin.
Test locally using:
echo '{}' | bash statusline.shExample payload test:
echo '{"model":{"display_name":"Claude"},"context_window":{"used_percentage":42}}' | bash statusline.sh- Bash
- Python 3
- Claude CLI
Check Python:
python3 --versionClaude CLI sends a JSON payload to the statusline script through
stdin.
Example payload:
{
"model": {
"display_name": "Claude 3.5 Sonnet"
},
"context_window": {
"used_percentage": 42,
"remaining_percentage": 58,
"current_usage": {
"input_tokens": 12400,
"output_tokens": 1100
}
},
"cost": {
"total_cost_usd": 0.0123
}
}The script:
- Reads JSON from
stdin - Parses data using Python
- Extracts metrics
- Formats values
- Renders colored terminal output
statusline.sh
├── ANSI color configuration
├── JSON parsing (Python)
├── Number formatting
├── Duration formatting
├── Context progress bar
├── Threshold color logic
└── Terminal rendering
Edit:
BAR_LEN=12
Example:
BAR_LEN=20
ANSI colors are defined at the top of the script.
GR = green
YL = yellow
RD = red
CY = cyan
BL = blue
MG = magenta
◆ Claude 3.5 Sonnet │ ██████░░░░░░ 48% │ ↓15.3k ↑2.4k │ cache r:3.1k/w:900 │ Σ 40k/7k │ +230/-40 │ ⚡420ms ⏱6s │ $0.0231
This HUD helps with:
- Monitoring token usage
- Tracking Claude API cost
- Understanding context limits
- Debugging AI performance
- Observing code changes generated by AI
All directly in the terminal.
MIT License
Abhishek Chougule