Skip to content

Status Line

The Claude Code status line shows live session context usage directly in your terminal status bar. It uses a powerline-style display with color-coded context indicators so you always know how much context remains.

The status line is a shell script (scripts/statusline.sh) that reads JSON input from Claude Code (available since v2.1.6+) and renders a compact, color-coded bar showing:

  • Model name (e.g. opus-4, sonnet)
  • Current directory
  • Git branch and status (staged, modified, ahead/behind)
  • Context usage as a progress bar with percentage

The context progress bar changes color based on usage level:

Plenty of context remaining.

green

Context is filling up — consider wrapping up the current task or preparing to resume.

yellow

Context is running low — finish the current task and resume soon.

orange

Context is nearly exhausted. The bar blinks to draw attention. Resume immediately.

red

  1. Copy the script to your Claude config directory:

    Terminal window
    cp scripts/statusline.sh ~/.claude/
    chmod +x ~/.claude/statusline.sh
  2. Add to ~/.claude/settings.json:

    {
    "statusLine": {
    "type": "command",
    "command": "~/.claude/statusline.sh"
    }
    }

Requires jq and a Nerd Font for powerline symbols.

The script receives JSON on stdin with fields including:

  • model — Current model name or object
  • workspace.current_dir — Working directory
  • context_window.used_percentage — Context usage (0—100)

It then:

  1. Extracts and cleans the model name.
  2. Reads git status from the working directory.
  3. Builds a powerline-style output with ANSI colors.
  4. Renders a 10-character progress bar for context usage, color-coded by level.

The model segment background is green when git is clean and yellow when there are uncommitted changes, giving you a quick visual indicator of repository state.