A minimal statusline for Claude Code that shows real-time context window usage with a gradient progress bar.
── Claude Opus 4.6 (1M context) │ 12m3s │ $0.847
◉ CONTEXT: ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ 37%
The bar gradient shifts from green → yellow → orange → red as context fills up.
Requires jq — install with brew install jq (macOS) or sudo apt install jq (Debian/Ubuntu).
curl -o ~/.claude/context-bar.sh \
https://raw.githubusercontent.com/Esk3nder/context-statusline/main/context-bar.sh
chmod +x ~/.claude/context-bar.shAdd to ~/.claude/settings.json:
{
"statusLine": {
"type": "command",
"command": "~/.claude/context-bar.sh"
}
}Restart Claude Code.
- Context bar — gradient progress bar showing context window usage
- Model name — active model displayed in the header
- Session duration — how long the current session has been running
- Session cost — estimated cost based on token counts and Anthropic pricing
- Responsive — adapts to terminal width (nano / micro / mini / normal)
If you want the bar to reach 100% at a specific context percentage (e.g., if compaction kicks in at 69%):
{
"statusLine": {
"type": "command",
"command": "~/.claude/context-bar.sh"
},
"contextDisplay": {
"compactionThreshold": 62
}
}Omit or set to 100 for raw 0–100% display.
MIT