Skip to content
Custom Claude Code Status Line

Custom Claude Code Status Line

9 min read

Claude Code has a fully customizable status line. You point it at a shell script, it pipes in session data as JSON, and your script renders whatever you want. I’ve been iterating on mine for a while; the current version is v2.3.0 and now lives in a public repo: github.com/vtmocanu/cc-statusline.

TL;DR: Claude Code’s default status line tells me almost nothing about a session, and with several sessions open at once I lose track of which is which. So I built a two-line ANSI status bar that hashes each session to its own color and packs in the things I actually watch: the session topic, git and Kubernetes context, context-window usage, prompt-cache hit rate, and live 5h/7d API quota bars. The result is a glanceable dashboard per session, installable from a public repo with one script.

The v2 layout uses two lines with diagonal corner cuts and width-synchronized lines. Each session gets a unique color from a 12-color palette (hashed from the session ID), so when I have multiple sessions open, I can tell them apart at a glance.

Claude Code statusline v2

Line 1 (project-colored background): session topic, folder, git branch + status, Kubernetes context

Line 2 (black background): model + effort level, optional account profile badge (the MM chip above, useful when juggling multiple Claude Code logins), elapsed time, context window bar, prompt-cache hit rate (⚡ 99% above), 5h/7d API quota bars with reset times and optional pace arrows, Claude service status icon

All meters are color-coded: green under 50%, gold 50-80%, coral 80%+ (the cache hit-rate meter inverts this, since a high cache rate is good).

Install

The statusline lives in a public repo on GitHub: vtmocanu/cc-statusline. Since v2.8.0 the easiest way in is Homebrew:

brew tap vtmocanu/tap
brew trust vtmocanu/tap    # Homebrew 6.0+ requires trusting third-party taps
brew install cc-statusline

That puts a cc-statusline command on your PATH, pulls in the dependencies, and prints the settings.json snippets to paste (re-read them anytime with brew info cc-statusline). On Homebrew older than 6.0, skip the brew trust line; if you prefer not to trust the whole tap, brew trust --formula vtmocanu/tap/cc-statusline scopes trust to just this formula.

No Homebrew? The installer works everywhere git does:

git clone https://github.com/vtmocanu/cc-statusline.git
cd cc-statusline
./install.sh

It extracts the chosen ref via git archive (so it never mutates your working tree), copies the scripts into ~/.local/share/cc-statusline/, and prints the same snippets. ./install.sh --version v2.8.0 pins a release, ./install.sh --uninstall removes it.

Configure Claude Code

Paste the snippets into ~/.claude/settings.json. With the brew install:

{
  "statusLine": {
    "type": "command",
    "command": "cc-statusline",
    "refreshInterval": 60
  },
  "hooks": {
    "UserPromptSubmit": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/opt/homebrew/opt/cc-statusline/libexec/hooks/session-topic-capture.sh"
          }
        ]
      }
    ]
  }
}

(With install.sh, the command is bash ~/.local/share/cc-statusline/statusline.sh and the hook path lives under ~/.local/share/ instead.)

refreshInterval is optional but worth having: Claude Code normally re-runs the statusline only on activity, so an idle session shows stale reset times and service health. With it set, the statusline also re-renders every 60 seconds.

The UserPromptSubmit hook is optional: it’s the bit that calls Claude Haiku to generate the per-session “Project: Focus” topic label. If you don’t want that, just leave the hook out and the statusline will skip the topic block.

Restart Claude Code. The topic appears after your first prompt (it runs async, so it shows on the second render).

Requirements

  • macOS or Linux, bash, jq, perl, curl, GNU timeout (coreutils; not stock on macOS)
  • A Nerd Font v3+ in your terminal for the powerline corners and icons
  • Claude Code v2.1.80+ for native rate-limit data
  • kubectl is optional (used to display the current context)

The brew formula declares all of these; the installer checks for them and tells you what’s missing.

Updating

brew update && brew upgrade cc-statusline

Or with the installer:

cd /path/to/cc-statusline
git pull
./install.sh

The installer detects the previous install and reports the upgrade transition (upgraded v2.2.1 -> v2.3.0).

Hacking on it

The brew wrapper has a built-in dev switch: point it at a working tree and the next render runs your clone instead of the brewed copy, no settings.json edits, even in already-running sessions.

mkdir -p ~/.config/cc-statusline
echo ~/src/cc-statusline > ~/.config/cc-statusline/dev-dir   # enter dev mode
rm ~/.config/cc-statusline/dev-dir                           # back to the brewed copy

Source, issues, contributions

Everything is on GitHub: vtmocanu/cc-statusline. The repo has a CI pipeline (shellcheck + a JSON-fixture test harness), a CHANGELOG.md, and a KNOWN_ISSUES.md for limitations. Issues and pull requests welcome.

Adapting It

Each segment in statusline.sh is independent. Fork the repo, edit the bits you want, and run your own copy via bash /path/to/your/fork/statusline.sh in settings.json. If you build something interesting on top of it, open an issue or PR; I’d love to see it.

Last updated on