Claude Code Status Line: How to Set It Up (With Examples)

The Claude Code status line is a custom bar at the bottom of Claude Code that shows whatever you choose, such as your model, context usage, usage limits or session cost. The fastest way to set it up is to type /statusline followed by what you want to see, and Claude Code builds it for you.

This guide shows how to set it up and customize it, both the quick way and the manual way, with tested scripts you can copy.

On this page

What Is the Claude Code Status Line?

The status line (also called the Claude status line or status bar) is a row at the bottom of the Claude Code interface. Claude Code runs a small script you choose, sends it details about your session, and shows whatever the script prints.

A few things to know before you start:

  • It runs on your computer and does not use any API tokens.
  • It does not replace the built-in footer. It appears in its own row above it.
  • It is not the /status command. /status opens a panel with your version, model and account. The status line stays on screen all the time.
  • It does not tell you if Claude is down. For that, check our live Claude Code status page.

Quick Setup with the /statusline Command

Type /statusline in Claude Code and describe what you want in plain English. Claude Code writes a script in your ~/.claude/ folder and updates your settings for you. Approve the file edits if it asks.

Example requests:

/statusline show model name and context percentage with a progress bar
/statusline show my 5-hour and weekly usage limits
/statusline show the current folder, git branch and session cost

To remove it later, run /statusline and ask it to remove the status line, for example /statusline remove it.

Manual Setup in 3 Steps

If you prefer to control the script yourself, set it up by hand. These steps work on macOS and Linux. Windows is covered further down.

Step 1: Create a script. Save this as ~/.claude/statusline.sh. It uses jq, a small JSON tool you may need to install first (for example, brew install jq on macOS).

#!/bin/bash
data=$(cat)
model=$(echo "$data" | jq -r '.model.display_name')
dir=$(echo "$data" | jq -r '.workspace.current_dir')
ctx=$(echo "$data" | jq -r '.context_window.used_percentage // 0' | cut -d. -f1)
echo "$model | ${dir##*/} | context ${ctx}%"

Step 2: Make it executable.

chmod +x ~/.claude/statusline.sh

Step 3: Add it to your settings. Open ~/.claude/settings.json and add:

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

Save the file. Claude Code reloads your settings and shows the new status line right away. The result looks like this:

Opus | my-app | context 63%

Optional settings

Setting What it does
padding Adds extra spaces before your status line. The default is 0.
refreshInterval Re-runs your script every N seconds (minimum 1). Useful for clocks or other time-based data.
hideVimModeIndicator Hides the built-in -- INSERT -- text if your script already shows the vim mode

You can put the statusLine setting in your user settings (~/.claude/settings.json) for all projects, or in a project's settings for just that project.

What Data Can the Status Line Show?

Claude Code sends your script a JSON object with details about the session. These are the most useful fields:

Field What it contains
model.display_name The current model name
workspace.current_dir The folder you are working in
context_window.used_percentage How much of the context window is used
context_window.context_window_size The maximum context size in tokens
rate_limits.five_hour.used_percentage How much of your 5-hour usage limit is used
rate_limits.seven_day.used_percentage How much of your weekly limit is used
rate_limits.five_hour.resets_at When the 5-hour window resets (Unix time in seconds)
cost.total_cost_usd Estimated session cost in US dollars
cost.total_duration_ms How long the session has been running
cost.total_lines_added, cost.total_lines_removed Lines of code changed
effort.level The current reasoning effort level
version Your Claude Code version

Two notes. The rate_limits fields only appear for claude.ai Pro and Max subscribers, and only after the first response in a session. And the cost is an estimate calculated at list price, so it can differ from your actual bill.

Claude Code Status Line Examples

Each example below is a complete script. Save it as ~/.claude/statusline.sh, run chmod +x on it, and use the settings from Step 3.

Example 1: Usage limits

See how close you are to your 5-hour and weekly limits, so a limit never surprises you mid-task.

#!/bin/bash
data=$(cat)
model=$(echo "$data" | jq -r '.model.display_name')
five=$(echo "$data" | jq -r '.rate_limits.five_hour.used_percentage // empty')
week=$(echo "$data" | jq -r '.rate_limits.seven_day.used_percentage // empty')
line="$model"
[ -n "$five" ] && line="$line | 5h: $(printf '%.0f' "$five")%"
[ -n "$week" ] && line="$line | week: $(printf '%.0f' "$week")%"
echo "$line"

Output: Opus | 5h: 42% | week: 12%

Example 2: Session cost and time

#!/bin/bash
data=$(cat)
cost=$(echo "$data" | jq -r '.cost.total_cost_usd // 0')
ms=$(echo "$data" | jq -r '.cost.total_duration_ms // 0')
printf 'Session: $%.2f | %d min\n' "$cost" "$((ms / 60000))"

Output: Session: $1.23 | 12 min

Example 3: Two lines with git branch and a colored context bar

Each line your script prints becomes its own row. This one turns the context bar green, yellow or red as it fills up.

#!/bin/bash
data=$(cat)
model=$(echo "$data" | jq -r '.model.display_name')
dir=$(echo "$data" | jq -r '.workspace.current_dir')
ctx=$(echo "$data" | jq -r '.context_window.used_percentage // 0' | cut -d. -f1)
branch=$(git -C "$dir" branch --show-current 2>/dev/null)

# Green under 50%, yellow under 80%, red above
if [ "$ctx" -lt 50 ]; then color='\033[32m'
elif [ "$ctx" -lt 80 ]; then color='\033[33m'
else color='\033[31m'; fi
reset='\033[0m'

# A 10-block progress bar
filled=$((ctx / 10)); empty=$((10 - filled))
bar=$(printf '%*s' "$filled" '' | tr ' ' '#')$(printf '%*s' "$empty" '' | tr ' ' '-')

echo "$model | ${dir##*/}${branch:+ ($branch)}"
printf '%b\n' "${color}[${bar}] ${ctx}% context${reset}"

Output:

Opus | my-app (main)
[######----] 63% context

Status Line Setup on Windows

On Windows, Claude Code runs your status line command through Git Bash if it is installed, or through PowerShell if it is not.

  • With Git Bash: the Bash scripts above work. Write file paths with forward slashes, because Git Bash treats backslashes as special characters and the command can fail silently.
  • With PowerShell: save this as statusline.ps1 in your .claude folder:
$data = $input | Out-String | ConvertFrom-Json
$folder = Split-Path $data.workspace.current_dir -Leaf
$ctx = [math]::Round([double]$data.context_window.used_percentage)
Write-Host "$($data.model.display_name) | $folder | context $ctx%"

Then point your settings to it, replacing username with your Windows user name:

{
  "statusLine": {
    "type": "command",
    "command": "powershell -NoProfile -File C:/Users/username/.claude/statusline.ps1"
  }
}

Tips for a Better Status Line

  • Test your script before using it. Pipe sample data into it: echo '{"model":{"display_name":"Opus"},"workspace":{"current_dir":"/home/user/project"},"context_window":{"used_percentage":25}}' | ~/.claude/statusline.sh
  • Keep it short. Long lines get cut off or wrap badly in narrow terminals.
  • Keep it fast. The script runs often, after every new reply. Slow commands such as a full git status in a big repository can make it lag, so cache them or leave them out.
  • Handle empty values. Some fields are empty until the first reply arrives. Use fallbacks like // 0 in jq.
  • Try a ready-made option. Community projects such as ccstatusline and starship-claude offer pre-built themes.

Troubleshooting the Claude Code Status Line

The status line does not appear

  1. Make sure the script is executable: chmod +x ~/.claude/statusline.sh
  2. Run the script by hand with sample data to check that it prints something.
  3. Make sure it prints to normal output (stdout), not to the error stream.
  4. Accept the workspace trust prompt for the folder. The status line stays blank until you do.
  5. On Windows, use forward slashes in the path.
  6. Start Claude Code with claude --debug to see your script's errors.

It shows -- or empty values

Some fields are empty before the first response in a session. Add fallbacks to your script, and restart Claude Code if the values stay empty after a few messages.

It goes blank after an error

Claude Code only shows the output if your script finishes successfully (exit code 0). A script that crashes, hangs or prints nothing leaves the row blank.

The colors look broken

Some terminals do not handle color codes well, especially across several lines. Switch to plain text output to test.

Frequently Asked Questions

Does the Claude Code status line use tokens?

No. It runs on your own computer and does not use any API tokens.

Is the status line the same as the /status command?

No. The status line is a custom bar that stays on screen. The /status command opens a panel with your version, model and account details.

Can the status line show my usage limits?

Yes, if you have a claude.ai Pro or Max subscription. Use the rate_limits.five_hour and rate_limits.seven_day fields, as in Example 1.

How often does the status line update?

It runs when a session starts, after each new reply, when /compact finishes, and on a few other events. Set refreshInterval if you want it to update on a timer as well.

How do I remove the status line?

Run /statusline and ask it to remove the status line, or delete the statusLine block from your settings.json file.


This is an independent website, not affiliated with Anthropic. Setup details are based on Anthropic's Claude Code documentation, and the example scripts were tested with sample session data. Content last reviewed: November 30, 2026.