Skip to content

Customize the Claude Code Status Line on Windows and WSL

Set up a custom Claude Code status line on Windows and WSL — show model, context, cost, and git branch. The settings config, a working script, and the gotchas.

MGMCSA Guru Team June 10, 2026 5 min read
A custom Claude Code status line showing model, context usage, and git branch at the bottom of a terminal

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.

Frequently asked questions

What is the Claude Code status line?

It's the customizable bar at the bottom of the Claude Code terminal. It runs a shell command you configure, receives session data as JSON on standard input, and displays whatever the command prints — your model, context usage, cost, git branch, or anything else you script.

How do I set up a custom status line?

Add a statusLine entry to your settings JSON pointing at a command, or run /statusline to have Claude Code scaffold one. The command reads session JSON on stdin and prints the line to stdout. You can write it in bash, PowerShell, or any language.

Does the status line work on native Windows?

Yes. The command runs in your shell, so on native Windows you can use a PowerShell or batch script, and in WSL a bash script. The JSON-on-stdin contract is the same; only the scripting language and tooling differ.

What can the status line show?

Anything you can compute from the session JSON plus your own commands — current model, context window usage, estimated cost, working directory, and git branch are common. Each field is optional, so handle missing values gracefully in your script.

Why is my status line blank or erroring?

Usually the command isn't found, isn't executable, or printed nothing. Test it outside Claude Code by piping sample JSON into it. On Windows, confirm the interpreter path; in WSL, make the script executable with chmod +x.

Sources & further reading

Official vendor documentation referenced while writing this guide.

MG

MCSA Guru Team

IT & Systems Administration

We are working IT pros and system administrators who spend our days in Windows Server, Microsoft 365, and the wider Microsoft stack. MCSA Guru is where we write down the fixes and walkthroughs we wish we had found the first time.

MCSA Guru provides independent, educational IT guidance. Microsoft, Windows, Windows Server, Microsoft 365, Exchange, and Microsoft Teams are trademarks of Microsoft Corporation; Docker is a trademark of Docker, Inc. MCSA Guru is not affiliated with or endorsed by Microsoft or Docker. Always test changes in a safe environment before applying them in production.

Related guides

Fixing something right now?

Jump straight into the guide library or search for the exact error or task you are dealing with.