A compact, color-coded status line for Claude Code that shows model, context usage, rate limits, and session duration at a glance.
◆ Claude Opus 4.6 ====------ 40% | 5h: 23% (↺ 23:00) | 7d: 5% (↺ Thu 16:00) | ⎇ main | 12m
| Section | Description |
|---|---|
◆ Model |
Current model name (cyan) |
====------ 40% |
Context window usage bar (green < 40%, yellow < 70%, red ≥ 70%) |
5h: 23% |
5-hour rate limit usage + reset time |
7d: 5% |
7-day rate limit usage + reset time |
⎇ main |
Current git branch of the working directory (magenta), when it's a git repo |
12m |
Session duration (dimmed) |
Sections only appear when the data is available. Rate limits are hidden when not present in the JSON payload. The git branch is resolved directly with git (using --no-optional-locks so it never contends with a concurrent git command) — it's not part of the JSON payload.
jq(JSON processor) — install viabrew install jq,apt install jq, etc.bash3.2+- Works on macOS and Linux (
datecommands handle both)
Copy the script and update settings.json:
cp statusline-command.sh ~/.claude/statusline-command.sh
chmod +x ~/.claude/statusline-command.shThen add to ~/.claude/settings.json:
{
"statusLine": {
"type": "command",
"command": "bash ~/.claude/statusline-command.sh"
}
}If settings.json already exists, merge the statusLine key into it — do not overwrite other settings.
curl -fsSL https://raw.githubusercontent.com/jorgesm/claude-code-statusline/main/statusline-command.sh -o ~/.claude/statusline-command.sh && chmod +x ~/.claude/statusline-command.shThen add the statusLine entry to ~/.claude/settings.json as shown above.
Claude Code pipes a JSON object to the status line command via stdin. The script extracts fields with jq and renders ANSI-colored output. The JSON schema includes:
{
"model": { "display_name": "Claude Opus 4.6" },
"context_window": { "used_percentage": 42.5 },
"rate_limits": {
"five_hour": { "used_percentage": 23, "resets_at": "2026-04-01T23:00:00Z" },
"seven_day": { "used_percentage": 5, "resets_at": "2026-04-03T16:00:00Z" }
},
"cost": { "total_duration_ms": 720000 }
}| Usage | Color |
|---|---|
| < 40% | Green |
| 40–69% | Yellow |
| ≥ 70% | Red |
MIT