Status Line Generator

Build a custom Claude Code status line script.

  • $25 Free
  • 45 sec
  • No signup
1

Pick the segments to display

2

Preview the rendered status line

3

Copy the script + settings snippet

You get: A status line script + settings.json snippet showing what you pick.

Pick your segments

Live preview

my-app | main | Sonnet

statusline.sh

#!/usr/bin/env bash
# Claude Code status line. Reads session JSON on stdin.
input=$(cat)

CWD=$(printf '%s' "$input" | jq -r '(.workspace.current_dir // .cwd) | split("/") | last')
GIT=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
MODEL=$(printf '%s' "$input" | jq -r '.model.display_name')

printf '%s' "$(printf '%s\n' "$CWD" "$GIT" "$MODEL" | grep -v '^$' | paste -sd ' | ' -)"

Save to ~/.claude/statusline.sh and run chmod +x ~/.claude/statusline.sh to make it executable.

settings.json

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

What the status line is

The status line is the small custom line Claude Code renders at the bottom of the interface. You configure it with a `statusLine` block in settings.json that points at a command - usually a shell script - and Claude Code runs that command and displays whatever it prints. Every time the state changes, Claude Code pipes a JSON object describing the current session to your command on standard input, your script reads the fields it cares about, and it prints one line back. That line becomes your status bar. The generator above builds both halves for you: the shell script that reads the session JSON and the settings.json snippet that wires it up.

It is a genuinely useful bit of ambient information. At a glance you can see which directory you are in, which git branch is checked out, and which model is answering - the three things people most often lose track of during a long session. Because it is a script, you decide exactly what it shows.

How the JSON-on-stdin contract works

The mechanism is simple and language-agnostic. Claude Code invokes your command and writes a JSON payload to its standard input. That payload carries session context - things like the current working directory, the active model's display name, the workspace, and the output style in effect. Your command reads stdin, pulls out the fields it wants, and prints the status line to standard output. Anything you can write in a script, you can put in your status line. The generated script uses jq to read fields from the JSON, plus a couple of shell commands (git and date) for information that lives outside the payload.

Your script reads JSON, prints one line

Claude Code pipes session JSON to your statusLine command on stdin and displays whatever it prints on stdout. Keep it fast and keep it to a single line - it runs frequently, so a slow script makes the whole interface feel sluggish.

The segments you can show

  • Working directory - the folder you are in. Showing just the last path component keeps it short; showing the full path is handy when you jump around.
  • Git branch - read with git rev-parse, so you always know what you are about to commit to. This is the single most requested segment.
  • Model - the display name of the model answering, so you notice when you are on a heavier or lighter model than you meant to be.
  • Output style - the active output style's name, useful if you keep several and switch between them.
  • Clock - a plain timestamp from date, handy for logging how long a session has run.
  • Prefix - a fixed label or icon at the front of the line to make your status bar recognizable at a glance.

Installing the generated script

  1. Copy the statusline.sh output and save it to ~/.claude/statusline.sh.
  2. Make it executable: chmod +x ~/.claude/statusline.sh. A status line that is not executable silently does nothing.
  3. Copy the settings.json snippet into your ~/.claude/settings.json (or the project's .claude/settings.json), merging it with any existing keys.
  4. Make sure jq is installed, since the script uses it to parse the session JSON. Most package managers have it.
  5. Start a new Claude Code session and confirm the line renders. If it is blank, run the script by hand with a sample JSON payload piped in to see what it prints.

Keeping it fast

The status line command runs often, so speed matters more than it looks. Each segment that shells out - git, date, anything that spawns a process - adds a little latency, and if you stack up several the line can start to feel laggy. Favor reading fields straight from the JSON payload, which is nearly free, over spawning subprocesses. If you do need git, calling it once and reusing the result is better than calling it repeatedly. When in doubt, fewer segments and a simpler script give you a snappier interface, and you can always add more once you confirm the basics are quick.

Project vs personal status lines

A status line configured in ~/.claude/settings.json is yours everywhere. One configured in a project's .claude/settings.json applies to that project - useful if a particular repo benefits from showing something specific, like a deployment target or an environment name. Most people set one good personal status line and leave it, because the information they want (directory, branch, model) is the same regardless of project. Start there, and reach for a per-project variant only when a specific repo genuinely needs different context.

Debugging a blank status line

If nothing shows up, work through the usual suspects. Confirm the script is executable and the path in settings.json is correct and absolute. Run the script directly, piping in a small hand-written JSON object on stdin, and check that it prints a line without errors. Verify jq is installed and on your PATH. Make sure the script prints to standard output, not standard error, and that it emits a single line. A status line that errors out or prints nothing simply renders empty, so isolating the script from Claude Code is the fastest way to find the problem.

Frequently asked questions

  • How does Claude Code know what to put in the status line?

    You point the statusLine config at a command. Claude Code runs it, pipes session JSON to its stdin, and displays whatever the command prints to stdout. Your script decides what to show.

  • Where do the script and config go?

    The script typically lives at ~/.claude/statusline.sh and must be made executable with chmod +x. The statusLine block goes in ~/.claude/settings.json for a personal status line, or a project's .claude/settings.json for a project-specific one.

  • What data can the status line show?

    Anything in the session JSON on stdin - working directory, model name, output style, workspace - plus anything your script can compute, like the git branch or the current time.

  • Do I need jq?

    The generated script uses jq to parse the JSON payload, so install it or rewrite those lines in another JSON-capable tool. Segments like git branch and the clock use plain shell commands instead.

  • Why is my status line blank?

    Usually the script is not executable, the path is wrong, jq is missing, or the script printed to stderr instead of stdout. Run it by hand with a sample JSON payload piped in to see the real output.

  • Will a status line slow Claude Code down?

    It can if the script spawns many subprocesses, because it runs frequently. Prefer reading fields from the JSON over shelling out, and keep the number of segments modest.

Liked this tool? The club is the next step.

Join Claude Code Club for $9/month. 650+ lessons, weekly updates, and the workflows behind every tool on this site.

  • No experience needed
  • Cancel anytime
  • Updated weekly