Claude Code guide

The Claude Code /statusline command.

Type /statusline in Claude Code, describe the bar you want, and Claude writes the script and the settings for you. Here is what it does, what it leaves on disk, and where it stops being the fastest option.

Updated September 29, 2026 · 5 min read

Open the Claude Code statusline builder

What /statusline does

/statusline asks Claude to set up your statusline for you. You describe what you want in ordinary language. Claude writes a shell script that reads the session JSON and prints your line, then updates your settings so Claude Code runs it.

  1. Type the command and describe the bar

    Say which data you want and how it should look.

    In Claude Code
    /statusline show model name and context percentage with a progress bar
  2. Let Claude write the script

    Claude creates a script in ~/.claude/, commonly named statusline-command.sh, and points the statusLine setting at it.

  3. Look at the result

    Claude Code reloads settings when they change, so the line usually shows up on your next message. If it doesn't, restart Claude Code.

  4. Ask for changes in plain language

    Run /statusline again, or tell Claude what to adjust, such as making the context percentage turn red above 80.

Prompts that work well

Be specific about the data and the formatting. The script can only use fields Claude Code actually sends, so name them in Claude Code's own terms: model, context window, cost, git branch, rate limits.

You wantTry saying
Model and context/statusline show the model name and a context usage progress bar
Git and cost/statusline show git branch, session cost and duration on one line
Two rows/statusline two lines: model and folder on top, context bar and cost below
Warning colors/statusline turn the context bar red above 80 percent
Your shell prompt/statusline convert my shell prompt (PS1) into a statusline

What it leaves on your machine

  • A script in ~/.claude/, commonly statusline-command.sh. It is ordinary shell: open it, read it, edit it.
  • A statusLine entry in your settings that points at that script.
The settings entry (path will match your script)
{
  "statusLine": {
    "type": "command",
    "command": "~/.claude/statusline-command.sh"
  }
}

To remove it, run /statusline and ask Claude to remove it, or delete the statusLine entry from your settings yourself. Because it is a plain script, everything in the main guide applies to it: testing with sample JSON, jq defaults, and the troubleshooting table.

Where /statusline falls short

  • No preview. The line goes live, then you look. Getting a color or spacing right can take several rounds of asking.
  • Not repeatable. The model writes new code each time, so the same prompt can produce different scripts.
  • Hard to share. The result is a script on your disk. There is no design to publish or fork.
  • You own the script. If a field changes or the script breaks, you are the one debugging shell code.

If /statusline didn't work

  • Nothing appears: open your settings and confirm a statusLine entry exists, then restart Claude Code.
  • The line is blank: run the generated script with sample JSON piped in and check its exit code.
  • Permission denied: make the script executable with chmod +x.

The troubleshooting table in the main guide covers these and more.

Frequently asked questions

What does the /statusline command do in Claude Code?

It asks Claude to build your statusline from a plain-English description. Claude writes a script into ~/.claude/ and adds a statusLine entry to your settings so Claude Code runs it.

Where does /statusline save statusline-command.sh?

Claude Code writes the script into ~/.claude/. The file is commonly named statusline-command.sh, and the statusLine entry in your settings points at it. Open your settings to see the exact path on your machine.

Does /statusline use tokens?

Asking Claude to write the script is a normal request, so it uses tokens like any other prompt. Once the script exists, running it costs nothing because it is a local command.

How do I remove a statusline made with /statusline?

Run /statusline and ask Claude to remove it, or delete the statusLine entry from your settings. You can delete the script file too, although nothing runs it once the entry is gone.

Can I edit the generated statusline-command.sh?

Yes. It is a plain script. Edit it, test it by piping sample JSON into it, and Claude Code will run the new version on its next refresh.

Is the builder better than /statusline?

They suit different jobs. /statusline is fastest for a quick change. The statusline.sh builder adds a live preview, repeatable output, Windows support and shareable designs.

Keep reading

Want to see it before it goes live?

The builder previews every change in a terminal frame and installs with one command.

Open the Claude Code statusline builder