Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

claude-code-statusline

A two-line Claude Code status line:

  1. Your real shell prompt, rendered by Starship, so the status line looks like your terminal — correct directory, git branch, and all.
  2. Context-window usage as a color-coded progress bar (green → yellow → red), with token counts, the current model, and the current effort level.

It also includes a model demotion alarm: if the session stops running the expected model at the expected effort (for example, when the model gets demoted mid-session), the model + effort segment is wrapped in 🚨 emojis and painted bold white on red so you notice immediately:

▓▓░░░░░░░░░░░░░░░░░░ 12% (24k/200k) 🚨 Opus 5 medium 🚨

Requirements

  • jq (brew install jq)
  • Starship — optional; without it the prompt line is simply omitted

Install

Copy statusline.sh somewhere (e.g. ~/.claude/statusline.sh), make it executable, and point Claude Code at it in ~/.claude/settings.json:

curl -o ~/.claude/statusline.sh https://raw.githubusercontent.com/seasonedcc/claude-code-statusline/main/statusline.sh
chmod +x ~/.claude/statusline.sh
{
  "statusLine": {
    "type": "command",
    "command": "/Users/YOU/.claude/statusline.sh"
  }
}

Customizing the demotion alarm

The script assumes you run a Fable model at high effort. If your setup differs, edit this block in statusline.sh:

case "$MODEL" in
  *[Ff]able*) MODEL_OK=1 ;;   # substring your expected model's display name
  *)          MODEL_OK=0 ;;
esac
if [ "$MODEL_OK" -eq 0 ] || { [ -n "$EFFORT" ] && [ "$EFFORT" != "high" ]; }; then

Change the *[Ff]able* pattern to match your expected model (e.g. *[Oo]pus*) and "high" to your expected effort level. Don't want the alarm at all? Delete the whole block.

Compatibility

Works out of the box on any modern terminal on macOS or Linux. The details:

  • Terminal: only widely-supported ANSI codes are used (standard colors, dim, bold, red background, bright white). A few terminals ignore the dim attribute — cosmetic only. The bar glyphs (▓░) and the 🚨 emoji need a UTF-8 locale and a font that includes them (true of default macOS/Linux setups). Some terminals treat the emoji as single-width, which can slightly misalign the line.
  • jq is required. If the status line shows nothing, check that jq is installed and on Claude Code's PATH.
  • bash is required. Included on macOS and Linux. On native Windows you need Git Bash or WSL so bash is available.
  • Starship is optional. Without it you simply don't get the prompt line — no errors.
  • The demotion alarm assumes Fable at high effort. If you run a different model or effort, the alarm stays on permanently until you adjust the block above.

License

MIT

About

Two-line Claude Code status line: Starship prompt, context-usage bar, and a model demotion alarm

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages