Skip to main content

Statusline Customization

Intermediate

The statusline is the persistent strip Claude Code shows about your session. Customizing it keeps the facts you care about — which model, where you are, how much context is left, your git branch — always in view.

What you can surface

  • Model in use (so you don't accidentally run an expensive one for a trivial task).
  • Current directory / project.
  • Context budget — how full the window is, a cue to /compact.
  • Git state — branch, dirty/clean, and which worktree you're in.

How it works

You point the statusline at a script (configured in settings) that receives session data and prints a line. Because it's just a script, you can show anything you can compute.

#!/usr/bin/env bash
# reads session JSON on stdin; prints a status line
input=$(cat)
model=$(echo "$input" | jq -r '.model.display_name // "claude"')
branch=$(git branch --show-current 2>/dev/null)
printf "%s · %s · %s" "$model" "$(basename "$PWD")" "${branch:-no-git}"

(The exact input fields are documented — check before relying on a specific key.)

Don't want to script it?

Community tools (e.g. ccstatusline) provide ready-made, configurable statuslines you can drop in instead of writing your own. Treat any third-party script as code to review before trusting.

:::tip The most useful field For most people, context budget + model earn their place: they prevent the two most common surprises — running out of context mid-task, and burning the wrong (pricier) model. :::

Next