claude-context-bar
v1.0.0
Published
Color-coded context window usage bar for Claude Code statusline
Maintainers
Readme
claude-context-bar
Color-coded context window usage bar for Claude Code's statusline.
[Opus 4.6 (1M context)] 📁 my-project | 🌿 feature/my-branch (3)
ctx:[███░░░░░░░░░░░░░░░░░] 16%
▸▸ accept edits on (shift+tab to cycle)Install
npx claude-context-barThat's it. Restart Claude Code and the context bar appears at the bottom.
What It Does
- Adds a 2-line statusline showing model, directory, git branch, and context usage
- Color-coded: green (<50%), amber (50-79%), red (80%+)
- Uses Claude Code's real
context_window.used_percentage - Updates after every assistant response
Prerequisites
- Claude Code v2.1.47+
jq(for patching settings.json)
How It Works
The installer:
- Copies
statusline-command.shto~/.claude/ - Adds
statusLineconfig to~/.claude/settings.json
Note on Project-Level Overrides
If a project has its own statusLine in .claude/settings.local.json, that takes precedence over the user-level setting. You'll need to update that file too.
Uninstall
rm ~/.claude/statusline-command.shThen remove the "statusLine" key from ~/.claude/settings.json.
License
MIT
