This is a substantial update of Claude Code Has a Power Meter. You Just Have to Wire It Up
Configurable HUD info with context bars and limits etc. Hyperlinks to the MR and pipeline, subagents running under the prompt, and Codex and Gemini working alongside Claude through agent-link.
TL;DR
/plugin marketplace add newell-paul/statusline-hud
/plugin install statusline-hud@statusline-hud
/statusline-hud
bash statusline-hud.sh --demo shows you the whole thing before you wire anything.
The JSON Hiding in the Statusline
Claude Code's statusline is just a shell command. JSON in on stdin, one line of text out.
And that JSON is pretty fat. Model, effort, context usage, both rate-limit windows, cost, prompt-cache stats, the open pull request for your branch, and the GitLab merge request too. All of it lands on every render.
There's just nothing showing it.
What the Bar Shows
The left half is where you are. The right half is what it's costing you. But you can have it in any order you want and comment out what you do not need in the SEGMENTS list. More on that later.
Where you are
- Git: branch,
βNβNahead/behind,βif dirty, then+156 β23lines changed this session - MR/PR badge:
π¦ !23 βorπ #42 β. Green tick when it's mergeable, red cross for conflicts, bare yellow while checks run,βdraft,βmerged. Click it and the MR opens - Pipeline dot: π’ π΄ π‘ for the latest run on your branch, β when it's waiting on a manual job. βͺ if that run is for an older commit than your HEAD, so you never trust a green that isn't about your code
What it's costing you
- Model, coloured by tier, with the effort badge (
β‘Lothroughβ‘Max), π for/fast, π for extended thinking - Context-window bar
- 5-hour and 7-day rate-limit bars, with a reset countdown (
βΊ2h14m) on whichever is more constrained once it passes 60%
The bars are five cells drawn in eighths, so they visibly move within a tier. Context flips colour earlier than the rate limits on purpose: a full context degrades Claude's answers long before it blocks you.
Off by default, one line to turn on
- Cache hit ratio
β©97%. Cyanβwhen the cached prefix has gone cold;β4mwhile it's warm but about to lapse. Send a message before then and Claude Code reuses the prefix instead of rewriting it, which on a long session is tens of thousands of tokens - Session name and
β worktree, for when you run several sessions or a subagent wanders off -
π€ Γ2, a running-subagent count on the main line. Off because the agent rows already show who's running - The flame:
π₯ $5.64 ($3.20/h). More on that below
Agents Get a Row Too
Claude Code already draws a row under the prompt for each running subagent. A second, tiny script wired in as subagentStatusLine restyles it: π€, the agent's name, its effort badge if it has one, its own context bar, tokens, elapsed time and what it's doing right now, updating as it goes. One row per agent, gone when it finishes.
The context bar is the point. A subagent starts with a fresh window, not your history, and this is the only place you can see how much of it the job is eating.
One caveat. With CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 on, an agent Claude gives a name to becomes a teammate, and teammates keep the stock row. Nothing is broken; the panel never calls the script for them.
The Badges Are Links
The MR badge opens the merge request. The pipeline dot opens the pipeline. Cmd-click on a Mac, Ctrl-click elsewhere, and you're on the page without touching a browser tab first. This is the feature that stopped me leaving the terminal.
These use OSC 8 hyperlinks: wrap text in an escape sequence with a URL and the terminal makes it clickable. Claude Code passes the status line output through untouched, so the script just wraps the badge and the dot. Ghostty, iTerm2 all do it. Terminal.app doesn't.
Gemini and Codex
Claude Code can hand work to other CLIs through the agent-link MCP server. Each Claude session starts its own agent-link server, and that server spawns the gemini or codex process. Add it once:
claude mcp add agent-link -- npx agent-link-mcp
Then turn on the link segment in ~/.claude/statusline-hud.conf (off by default):
SEGMENTS=(git lines mr ci model link ctx rl5 rl7)
While a spawned CLI runs you get one glyph per agent, in purple, next to the model name:
| CLI | glyph |
|---|---|
| claude | π€ |
| codex | π |
| gemini | β |
| aider | π§© |
| anything else | π |
Two Gemini agents and a Codex show as β β π. The glyphs disappear when the process exits. It works by scanning the process table for children of this session's agent-link server, so there is no cache file. Swap the glyphs with LINK_CODEX="β¦" and LINK_GEMINI="β¦" in the conf.
Why not use claude-hud or ccstatusline instead?
Both are good, and both have more GitHub stars than this will ever get. If you want to see which tools are running right now, claude-hud does that and I don't. If you want powerline arrows, gradients and a TUI to configure it, ccstatusline does that and I don't.
Here's what I wanted instead.
One line. Both of them default to more. claude-hud opens on two rows and grows; ccstatusline's showcase is a multi-row powerline. I hate a busy status. The bar sits under every prompt I type for the whole session, and if it needs a second row it has stopped being a status and become a dashboard. Everything here had to earn its place on one line. The only additional lines are running agents.
The pipeline, not just the PR. claude-hud shows no PR at all. ccstatusline shows the PR and the checks on it, but nothing when there's no PR yet. This one shows the latest pipeline for the branch whether or not you've opened anything, on GitLab and GitHub, and both badges are clickable so you go straight to the page.
Footprint. Two bash scripts, under 50 KB between them. No Node, no Bun, no npx cold start on every render, no call home to a usage API. It runs the same on a locked-down server, a colleague's laptop and a container. About 60ms a render.
The plugin install symlinks the script into ~/.claude/, writes a starter conf, patches settings.json, and re-points itself after /plugin update. Add "refreshInterval": 30 while you're there so the git and MR segments don't go stale while the session idles.
The Whole Extension API
Every setting is a plain bash assignment in the CONFIG block, and the conf file overrides any of them. SEGMENTS is the control panel:
SEGMENTS=(dir git lines mr ci model agents ctx rl5 rl7 session worktree cache turn) # everything on
SEGMENTS=(git model ctx rl5) # minimal
Custom segments are just as plain. The conf file is sourced bash, so any seg_<name>() function defined there is a segment:
seg_k8s() { printf "\033[38;5;39mβ %s\033[0m" "$(kubectl config current-context 2>/dev/null)"; }
SEGMENTS=(git k8s model ctx rl5 rl7)
That's it. A function and a name in a list. No runtime, no plugin API, no rebuild.
The Flame, If You Want It
π₯ $5.64 ($3.20/h) is cumulative session spend from cost.total_cost_usd, with the burn rate alongside once the session is 30 seconds old. The total is what this session has cost. The rate is what the next hour will cost if you carry on as you are. Green under $5, amber to $20, red above, tuned for Max users. PAYG users paying list price should dial it down.
It's off by default. On Pro and Max the number is an estimate, not your bill, and I found the rate-limit bars answer the question I was actually asking.
But a dollar figure does something a percentage doesn't. You tend to notice when it goes into the red.
Acting on What You See
- When the context bar goes amber start thinking about /compact unless you have compact set to auto.
- When the 5h bar goes amber, ask whether this task still needs Fable or Opus.
- Pin routine slash commands to
model: haiku. Commit, lint, review-diff. None of these need Opus. - Use subagents for delegation. They get a fresh context window, not your full history, and their row under the prompt shows how much of it they've used.
- When the
βcountdown appears, send the next message rather than going for a coffee. - When a session has done its job,
/clearbefore the next task./compactif you want to keep the thread.
The data was always there. Now you can see it.
The repo is at github.com/newell-paul/statusline-hud. Issues and PRs welcome.


Top comments (1)
I like this, the line under the prompt is where I keep an eye on things, so the rate limits belong here. What does the script do when it can't get an answer, because a status line that goes stale is worse than no status line. Does it fall back to the last known value with a timestamp, or clear the field?