Enhanced setup guide and easy installation for Claude Code status bar
This is a fork of the excellent work by @kanoliban Original gist: https://gist.github.com/kanoliban/39bb37cda2678b6e0941c5ca99757d9e All credit for the core implementation goes to the original author.
This fork provides:
- One-command installation script
- Step-by-step setup guide for beginners
- Troubleshooting section
- Visual examples and screenshots
- Testing utilities
The original brilliant statusline script remains unchanged.
Live rate-limit visibility in your Claude Code status bar at the bottom of your terminal.
[Opus 4.6 Β· Max] π my-project πΏ main β Ctx: π’ 12% β Session: 66% β Weekly: 68% β $4.82
Shows:
- Model name and plan tier (Max, Pro, Free)
- Current folder and git branch
- Context window usage (color-coded: π’ <60%, π‘ 60-80%, π΄ >80%)
- Session usage remaining (resets every 5 hours)
- Weekly usage remaining (resets every 7 days)
- Total session cost
[Claude] π my-project πΏ main β Ctx: π’ 12% β $0.00
curl -fsSL https://raw.githubusercontent.com/amantidesigns/claude-code-statusline/main/install.sh | bashThis will:
- Check/install dependencies (
jqand optionallycodexbar) - Download the statusline script
- Configure your Claude Code settings
- Verify everything works
- macOS (uses
stat -f %mfor cache timing) jqfor JSON parsingcodexbar(optional, for rate limit data)
# Install jq (required)
brew install jq
# Install CodexBar (optional but recommended for rate limits)
brew install steipete/tap/codexbarcurl -fsSL https://raw.githubusercontent.com/amantidesigns/claude-code-statusline/main/statusline.sh -o ~/.claude/statusline.sh
chmod +x ~/.claude/statusline.shAdd this to ~/.claude/settings.local.json (create if it doesn't exist):
{
"statusLine": {
"type": "command",
"command": "~/.claude/statusline.sh",
"padding": 0
}
}If the file already exists, merge the statusLine key into your existing JSON.
Exit your current Claude Code session and start a new one. The status bar should appear at the bottom!
| Segment | Source | Example | Description |
|---|---|---|---|
| Model + Plan | stdin + CodexBar | [Opus 4.6 Β· Max] |
Current Claude model and your plan tier |
| Folder | stdin | π my-project |
Current working directory name |
| Git Branch | git | πΏ main |
Current git branch (if in a repo) |
| Context % | stdin | Ctx: π’ 12% |
Token usage vs context window |
| Session % | CodexBar | Session: 66% |
Remaining capacity in 5-hour window |
| Weekly % | CodexBar | Weekly: 68% |
Remaining capacity in 7-day window |
| Cost | stdin | $4.82 |
Total USD cost for current session |
- π’ Green: 0-60% (plenty of room)
- π‘ Yellow: 60-80% (getting full)
- π΄ Red: 80-100% (approaching limit)
When usage drops below 50%, reset times appear automatically:
Session: 30% (8:00PM) β Weekly: 45% (Tue 2:00PM)
-
Verify the script exists and is executable:
ls -la ~/.claude/statusline.sh -
Check your settings file is valid JSON:
cat ~/.claude/settings.local.json | jq .
-
Make sure you restarted Claude Code after configuration
Install jq:
brew install jqThis means CodexBar isn't installed or isn't working. The status bar will still work, just without session/weekly percentages.
To add rate limits:
brew install steipete/tap/codexbarThen restart Claude Code.
Run CodexBar once to authenticate:
codexbar --provider claudeFollow the authentication prompts, then restart Claude Code.
Test the script manually:
echo '{"model":{"display_name":"Sonnet 4.5"},"cost":{"total_cost_usd":1.23},"context_window":{"context_window_size":200000,"current_usage":{"input_tokens":10000,"cache_creation_input_tokens":5000,"cache_read_input_tokens":5000}},"workspace":{"current_dir":"~/my-project"}}' | ~/.claude/statusline.shExpected output (without CodexBar):
[Sonnet 4.5] π my-project β Ctx: π’ 10% β $1.23
With CodexBar installed, you should also see Session and Weekly percentages.
- Claude Code pipes JSON data about the current session to the script via stdin
- The script parses model info, context usage, and costs using
jq - CodexBar (if installed) provides live API rate limit data from Anthropic
- Git provides current branch name
- Everything is assembled into a single status line and returned to Claude Code
The script caches CodexBar results for 60 seconds to avoid hammering the API.
Edit ~/.claude/statusline.sh to customize:
- Change colors: Modify the emoji indicators (π’π‘π΄)
- Adjust thresholds: Change when yellow/red warnings appear
- Reorder segments: Rearrange the output assembly section
- Add custom data: Include additional git info, time, etc.
Contributions welcome! Please:
- Test your changes thoroughly
- Update documentation
- Follow the existing code style
- Submit a pull request
- Original implementation: @kanoliban - https://gist.github.com/kanoliban/39bb37cda2678b6e0941c5ca99757d9e
- CodexBar: @steipete - https://github.com/steipete/CodexBar
- Enhanced documentation and setup: @amantidesigns
This project maintains the same license as the original work.
If you find this useful, please:
- Star this repository
- Star the original gist
- Check out CodexBar
