← All posts

Customizing Your Claude Code Status Line

The Claude Code status line shows model, context, git, and tokens right in your prompt. Here's how to configure the statusLine hook, with examples.

The Claude Code status line is the little strip of text Claude Code can print under your prompt — the part that tells you which model is active, how much context you've burned, what git branch you're on, and how many tokens you've spent. By default it's barebones. With a few minutes of config, it becomes the most useful glance in your whole workflow.

This is about the real Claude Code statusLine setting — the hook Anthropic ships, not a third-party skin. It's a script you control. You decide what it shows and how it looks. Below is what to put in it, how to wire it up, and a few copy-able examples. If you also want the chrome around the agent to look good — the window, the fonts, the visualizer — that's a separate layer, and we'll point you to the MOLTamp status-line post at the end.

What the Claude Code status line actually is

Claude Code's statusLine is a hook. You point it at an executable (a shell script, a Node file, whatever runs on your machine), Claude Code calls it on each update, and it pipes the result into the line under your input. Claude Code hands your script a JSON blob on stdin describing the current session — model, directory, cost, token counts, the lot. Your script reads that JSON, formats a string, and prints it. That printed string is your status line.

The important mental model: the status line is generated by your code, not by Claude. That's why it's so flexible, and also why it's a little fiddly the first time. You're writing a tiny program whose only job is to turn session state into one readable line.

Two things this is not. It's not the terminal's own prompt (that's your shell — zsh, bash, fish). And it's not MOLTamp's status line, which is a visual UI element in the MOLTamp shell. The Claude Code statusline lives inside the agent and travels with it into any terminal. Keep those three layers straight and the rest is easy.

1. Show the model and context budget first

If you only put two things in your Claude Code status line, make them the active model and the context budget. These are the facts that change your behavior in real time.

The model matters because you switch between Opus, Sonnet, and Haiku for different jobs, and it's genuinely easy to forget which one is driving — especially after a /model swap mid-session. Printing it means you never burn Opus tokens on a rename-the-variable task by accident.

The context budget matters even more. When you can see that you're most of the way through the window, you compact early instead of getting truncated mid-thought. A simple reading like ctx used / ctx total changes how you pace a long session. Anthropic's pricing and context limits change often, so check Anthropic for current model and limit details rather than hardcoding numbers — read them from the JSON your script receives instead.

2. Add git branch and dirty state

The second-most-useful thing in a coding agent's status line is git context. You want, at minimum, the current branch. Better: a marker when the working tree is dirty.

Why bother when git status exists? Because the whole point of a status line is zero-friction glance. A small main* (the star meaning uncommitted changes) tells you the agent just modified files you haven't reviewed. That's a useful gut-check before you let it run another tool call. For multi-branch or worktree workflows it's close to essential.

A minimal Node example that reads Claude Code's JSON and adds branch info:

#!/usr/bin/env node
const { execSync } = require("child_process");
let input = "";
process.stdin.on("data", (d) => (input += d));
process.stdin.on("end", () => {
  const s = JSON.parse(input);
  const model = s.model?.display_name ?? "claude";
  const dir = (s.workspace?.current_dir ?? "").split("/").pop();
  let git = "";
  try {
    const branch = execSync("git branch --show-current", { stdio: ["pipe", "pipe", "ignore"] })
      .toString().trim();
    const dirty = execSync("git status --porcelain", { stdio: ["pipe", "pipe", "ignore"] })
      .toString().trim() ? "*" : "";
    if (branch) git = `  ${branch}${dirty}`;
  } catch {}
  process.stdout.write(`${model}  ${dir}${git}`);
});

Keep these scripts fast and never let them throw — a status-line script that blocks or crashes is worse than no status line at all.

3. Track tokens and cost

The JSON Claude Code sends your script includes cost and usage fields. If you're on usage-based API billing, surfacing a running cost figure keeps you honest. If you're on a subscription, token counts are still useful for pacing.

Be careful with exact numbers and pricing — they move. Read whatever the session JSON gives you and display it qualitatively rather than asserting a rate. An illustrative line like cost this session or tokens in / tokens out is plenty. The goal isn't accounting; it's awareness. You want a soft signal that says "this session is getting expensive, maybe wrap it up or compact."

This pairs well with good habits elsewhere. If you're trying to spend fewer tokens overall, a tight CLAUDE.md does more than any status line — but the status line is how you notice when something's off.

4. Configure it in settings.json

Once your script exists and is executable, wire it up. The setting lives in your Claude Code settings.json (project-level or user-level). It looks like this:

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

Steps:

  1. Save your script somewhere stable — ~/.claude/statusline.js or ~/.claude/statusline.sh.
  2. Make it executable: chmod +x ~/.claude/statusline.js.
  3. Add the statusLine block above to settings.
  4. Start a new Claude Code session and watch the line render.

If nothing shows up, run your script by hand and pipe it a sample JSON object to confirm it doesn't error. Most "my Claude Code statusline isn't working" problems are a script that throws, a missing execute bit, or a path that's wrong. Fix those three and it lights up.

5. Style it to taste — then style the shell around it

You can add ANSI color codes inside your script to make the status line readable at a glance — branch in green, context in amber when it crosses a threshold, model dimmed. A little color does a lot.

But the status line is one line of text inside the agent. Everything around it — the window, the font, the background, the music, the audio visualizer reacting while Claude works — is your terminal and shell. That's the layer MOLTamp owns. MOLTamp is a free, skinnable Electron shell purpose-built for running AI CLI agents like Claude Code, Codex CLI, Gemini CLI, and Aider. The Claude Code statusLine handles what the agent reports; MOLTamp handles what the whole thing looks and feels like. They stack cleanly.

For the visual side, see how to customize Claude Code with MOLTamp and the dedicated MOLTamp status-line post. For more workflow wins, our Claude Code tips and tricks roundup covers the rest.

FAQ
How do I customize the status line in Claude Code?

Add a statusLine block to your Claude Code settings.json pointing at an executable script. Claude Code pipes session JSON to that script on stdin; your script reads it, formats a string, and prints it. Make the script executable and start a new session to see it render.

Why is my Claude Code statusline not showing up?

Almost always one of three things: the script isn't executable (chmod +x it), the command path in settings.json is wrong, or the script throws an error. Run it manually with a sample JSON input to confirm it prints cleanly. Also make sure you started a fresh session after editing settings.

What's the difference between the Claude Code status line and the MOLTamp status line?

The Claude Code status line is a hook inside the agent — it reports model, context, git, and tokens as text. The MOLTamp status line is a visual UI element in the MOLTamp shell, part of the skinnable chrome around the agent. They're different layers and work together; see our MOLTamp status-line post for the visual side.

What should I put in my Claude Code status line?

Start with the active model and the context budget — those two change how you work in real time. Add git branch with a dirty-state marker, then token or cost info if you're cost-conscious. Keep the script fast and crash-proof; a status line that blocks the agent is worse than none.

Does customizing the status line cost anything?

No. The Claude Code statusLine hook is part of Claude Code itself, and a script you write costs nothing to run. Claude Code pricing comes from your Claude subscription or API usage, which changes often — check Anthropic for current pricing and limits.


The category is early and the tooling is moving fast, so treat any config example as a starting point and read your own session JSON to see what's actually available. Pick what fits your workflow — a two-field status line you'll read beats a ten-field one you'll ignore. And if you want the rest of the Claude Code experience to feel like yours, MOLTamp is free forever, runs on macOS and Windows, and skins the whole shell around your agent.