Shows the working directory, git branch, model, and how much of the model's context window is used, as a coloured bar.
page-destroyer main | Opus 5 | ████████░░░░ 63% 630k/1M
- Green under 50 percent, yellow from 50, red from 80.
- The bar is 12 cells. Change
BAR_CELLSto make it wider or narrower. - The model name drops any trailing parenthetical, so
Opus 5 (1M context)reads asOpus 5. The window size is already in the token counts. - The context segment is omitted when the harness sends no context data.
Save the script and point statusLine at it.
curl -o ~/.claude/statusline-command.sh \
https://gist.githubusercontent.com/alexreardon/0540d2a8e3cc96a72b93a8e0e0ef6cf3/raw/statusline-command.sh
chmod +x ~/.claude/statusline-command.shThen add this to ~/.claude/settings.json:
{
"statusLine": {
"type": "command",
"command": "bash ~/.claude/statusline-command.sh"
}
}bash, jq, awk, sed, git. All are present on macOS except jq
(brew install jq).
The script reads one JSON object on stdin, so you can drive it by hand:
echo '{
"model": { "display_name": "Opus 5 (1M context)" },
"workspace": { "current_dir": "'"$PWD"'" },
"context_window": {
"used_percentage": 63,
"total_input_tokens": 630000,
"context_window_size": 1000000
}
}' | bash ~/.claude/statusline-command.sh