A custom status line for Claude Code. It renders a compact, colorized line with your host, the active model, effort level, context-window usage, 5-hour and weekly token usage, and the current git branch with ahead/behind counts. All text is rendered in bold.
Example output:
π» root@71fc4b745d65 π΄ Opus 4.8 βοΈ xhigh effort πͺ context window 4% π 5h token 18% π
weekly tokens 42% πΏ feat/typescript +1
| Segment | Source | Notes |
|---|---|---|
π» user@host |
whoami / $HOSTNAME |
user in red, host in blue |
π΄ model |
.model.display_name |
- |
βοΈ effort |
.effort.level |
- |
πͺ context window N% |
.context_window.used_percentage |
turns red at >= 75% |
π 5h token N% |
.rate_limits.five_hour.used_percentage |
turns red at >= 75% |
π
weekly tokens N% |
.rate_limits.seven_day.used_percentage |
turns red at >= 75% |
πΏ branch +A -B |
git in .cwd |
branch name: green when ahead, red when behind, yellow when diverged; +A ahead (green), -B behind (red) |
Every segment is bold. Segments are only shown when their data is present, so the line
stays short early in a session and grows as more context is available. The π and π
rate-limit segments only appear for Claude.ai Pro/Max subscribers, after the first API
response in a session.
bashjq- parses the JSON Claude Code sends on stdingit- only needed for the branch segment
-
Save the script to your Claude config directory and make it executable:
curl -L https://gist.githubusercontent.com/yagop/b6a19c4186ada5979ba931d2ce16392b/raw/statusline-command.sh \ -o ~/.claude/statusline-command.sh chmod +x ~/.claude/statusline-command.sh
-
Point Claude Code at it in
~/.claude/settings.json:{ "statusLine": { "type": "command", "command": "~/.claude/statusline-command.sh" } } -
Start (or restart) Claude Code. The status line appears at the bottom of the prompt.
Claude Code invokes the command on each render and pipes a JSON snapshot of the
session to it on stdin. The script reads that JSON in a single jq pass, pulls out the
fields above, and printfs one line of ANSI-colored text to stdout. Whatever the script
prints becomes the status line.
For the branch segment, the script refreshes the remote with git fetch at most once a
minute, detached in the background, so the ahead/behind counts stay current without ever
blocking a render on the network. If jq is not installed it degrades to just
user@host instead of failing.
To customize it, edit ~/.claude/statusline-command.sh directly - tweak the emojis,
colors, thresholds, or drop segments you do not want.