Claude Code status line

which-claude-code

Adds auto-generated session titles and a distinct colour per session to the status line.

33 stars 8 forksStatus lines Plugin marketplace Source

Install

Inside Claude Code
/plugin marketplace add jbarbier/which-claude-code
From source
git clone https://github.com/jbarbier/which-claude-code.git

From the README

which-claude-code

Auto-generated session titles + per-session colors in the Claude Code statusline.

If you run several Claude Code sessions in parallel terminals, you've probably
asked yourself: *which tab was the one fixing the auth bug? which was the one
writing tests?* This plugin answers that question automatically, without you
having to name anything.

After every prompt you submit, a tiny background Haiku call distills your
intent into a 3-6 word title. It shows up in the statusline, tinted with a
color uniquely hashed from the session ID. Same session = same color, forever.
Different sessions = visually distinct at a glance.

The trailing ctx: / 5h: / 7d: segments show current context-window,
five-hour, and seven-day usage. Each segment renders only when Claude Code
provides the corresponding field, so older builds are unaffected. A
freshly-reset window shows .txt. The hook itself
   returns in ~10ms so your prompt is never delayed.

2. Statusline (bin/statusline.sh) — reads that file on every render,
   printing ●   ·  ·  (). The title is colored from a
   20-color palette, indexed by cksum(session_id), so the mapping is stable
   for the life of the session.

State lives under ~/.claude/which-claude-code/ (overridable via
$WHICH_CLAUDE_CODE_STATE_DIR). Nothing else is touched.

Defensive note for maintainers — recursive Claude subprocess calls

If you fork this plugin or write a similar one: read this.

Any hook that shells out to claude -p (or any Claude Code subprocess) can
trigger unbounded recursion. The child claude -p inherits the user's
~/.claude/settings.json and enabled plugins, so its own UserPromptSubmit
event fires — re-invoking the same hook, which spawns another claude -p,
and so on. Detached and disowned, the chain survives the user closing…
Read the full README on GitHub

How status lines work

  • A status line is a command Claude Code runs to draw the bar under the prompt. It gets the session as JSON on stdin (model, folder, cost, context) and prints one or more lines.
  • Point the statusLine setting in ~/.claude/settings.json at it: { "statusLine": { "type": "command", "command": "<the command from the README>" } }.
  • Or run /statusline inside Claude Code and describe what you want.
Claude Code docs

Details

Language
Shell
License
MIT
Last updated
24 April 2026

FAQ

What is which-claude-code?

Adds auto-generated session titles and a distinct colour per session to the status line. It is a status line for Claude Code, from jbarbier/which-claude-code on GitHub.

How do I install which-claude-code?

Run /plugin marketplace add jbarbier/which-claude-code inside Claude Code, then follow the setup in the README.

Is which-claude-code popular?

jbarbier/which-claude-code has 33 GitHub stars and 8 forks. It was last updated on 24 April 2026.

More status lines

Browse the most popular Claude Code mods, all status lines, or the skills and MCP server directories.