Customize Your Status Line in Claude Code

Agentic engineering workflows are quickly requiring more juggling of multiple contexts through different tabs or windows, making it easier than ever to quickly lose track of the work you were doing.

Status lines are an easy way to help with this, allowing you to customize a little bit of text in your terminal UI to help keep tabs over what each conversation is currently working on.

This example is for Macs using the following format:

  • <worktree> · <repo> · <branch>
  • <model> · <context> · <cost>

Take this and use it as a base. Ask your agent to update it to customize it however you like, including adding color, emojis, or whatever information you think is important to your context and vibe.

Adding a status line script to Claude Code

Status line example

Create a statusline.sh file at ~/.claude/statusline.sh and include:

#!/bin/bash
input=$(cat)

MODEL=$(echo "$input" | jq -r '.model.display_name')
DIR=$(echo "$input" | jq -r '.workspace.current_dir')
COST=$(printf '%.2f' "$(echo "$input" | jq -r '.cost.total_cost_usd // 0')")
PCT=$(echo "$input" | jq -r '.context_window.used_percentage // 0 | floor')

GIT_ROOT=$(git -C "$DIR" rev-parse --show-toplevel 2>/dev/null)

if [ -n "$GIT_ROOT" ]; then
  WORKTREE=$(basename "$(dirname "$GIT_ROOT")")
  REPO=$(basename "$DIR")
  BRANCH=$(git -C "$GIT_ROOT" branch --show-current 2>/dev/null)
  STAGED=$(git -C "$GIT_ROOT" diff --cached --numstat 2>/dev/null | wc -l | tr -d ' ')
  MODIFIED=$(git -C "$GIT_ROOT" diff --numstat 2>/dev/null | wc -l | tr -d ' ')

  echo "${WORKTREE} · ${REPO} · ${BRANCH}"
else
  echo "$(basename "$DIR")"
fi

echo "${MODEL} · ${PCT}% · \$${COST}"

Make the script executable:

chmod +x ~/.claude/statusline.sh

Create or update your ~/.claude/settings.json to include:

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

See more options on code.claude.com.