The status line is the bar at the bottom of the Claude Code terminal, and out of the box it’s minimal. With a few lines of config you can make it show what you actually want at a glance — which model you’re on, how much context you’ve used, the running cost, your git branch. It’s a small thing that quietly improves every session, because the information you keep wondering about is just there.
This guide sets one up on both Windows and WSL, since the status line is a shell command and that’s exactly where the two environments differ. You’ll get the settings config, a working script, and the gotchas that leave people with a blank bar.
For where this sits among Claude Code’s other tweaks, see the power-user guide.
How it works
The mechanism is simple and worth understanding before you configure anything. You point Claude Code at a command. When it needs to render the status line, it runs your command and pipes session data to it as JSON on standard input. Whatever your command prints to standard output becomes the bar.
Claude Code --(session JSON on stdin)--> your command --(text on stdout)--> the status line
That’s the whole contract. Because it’s just “read JSON, print a line,” you can write the status line in any language — bash, PowerShell, Python, whatever. The JSON includes things like the current model, context usage, and paths; you pick what to surface.
Configure it in settings
The status line is set under statusLine in your settings JSON — .claude/settings.json for the project or your user settings in ~/.claude/:
{
"statusLine": {
"type": "command",
"command": ".claude/statusline.sh"
}
}
That points at a script in the repo. Now write the script.
A working script for WSL
In WSL you’re on Linux, so bash plus jq to parse the JSON is the smooth path:
#!/usr/bin/env bash
input=$(cat)
model=$(echo "$input" | jq -r '.model.display_name // "?"')
cwd=$(echo "$input" | jq -r '.workspace.current_dir // .cwd // "."')
branch=$(git -C "$cwd" branch --show-current 2>/dev/null)
line="⚙ $model"
[ -n "$branch" ] && line="$line ⎇ $branch"
echo "$line"
Make it executable:
chmod +x .claude/statusline.sh
That shows the model and, when you’re in a git repo, the current branch. The exact JSON field names can change between releases, so check the status line docs and adjust the jq paths if a field comes back empty.
A working script for native Windows
On native Windows, use PowerShell. The contract is identical — read JSON from stdin, print the line:
$input = [Console]::In.ReadToEnd()
$data = $input | ConvertFrom-Json
$model = if ($data.model.display_name) { $data.model.display_name } else { "?" }
$branch = (git branch --show-current 2>$null)
$line = "model $model"
if ($branch) { $line += " branch $branch" }
Write-Output $line
Point the config at it through PowerShell:
{
"statusLine": {
"type": "command",
"command": "powershell -NoProfile -File .claude/statusline.ps1"
}
}
What to put on the bar
Common fields people surface, and why:
Useful status line fields
| Model | Know which model you're on, especially if you switch tiers |
|---|---|
| Context usage | Spot when the window is filling before responses degrade |
| Cost estimate | Keep spend visible on long sessions |
| Working directory | Confirm where the agent is operating |
| Git branch | Avoid working on the wrong branch |
Don’t cram everything on. The point of a status line is a quick glance, so pick the three or four fields you actually check. Model and git branch are the universal picks; add context usage if you run long sessions and cost if you’re watching spend.
Testing without launching Claude Code
The fastest way to debug a status line script is to feed it sample JSON directly, so you’re not restarting sessions to test:
echo '{"model":{"display_name":"Sonnet"},"workspace":{"current_dir":"."}}' | ./.claude/statusline.sh
If that prints your expected line, the script is fine and any problem is in the config path. If it errors or prints nothing, you’ve isolated it to the script. This loop saves a lot of guessing.
Status line setup checklist
- Run /statusline for a starter, or write the script yourself
- Add the statusLine command to settings.json
- On WSL: bash + jq, and chmod +x the script
- On Windows: PowerShell script invoked with powershell -NoProfile -File
- Pick three or four fields, not everything
- Test by piping sample JSON into the script
Wrapping up
A custom status line is a small, satisfying tweak: point Claude Code at a script, have it read the session JSON and print what you care about. On WSL, lean on bash and jq; on native Windows, use PowerShell and invoke it explicitly to dodge the blank-bar trap. Keep the bar to a few useful fields and test the script with sample JSON when it misbehaves.
For ready-made setups and themed bars worth copying, see top Claude Code status line setups.