Skip to main content

Cockpit: Flight Instruments for Claude Code in Herdr

|

Cockpit's panel open above its strip at the right end of Herdr's status bar, with sample data: 15.1k new tokens a minute against a speed limit of about 8.5k, 50% of the 5-hour limit and 59% of the 7-day limit left, use of the 5-hour window 7 points above its glide path, five agents with their context and prompt cache, and the PACE and WAIT lights on.

Herdr is an app for running coding agents, and mods add features to it. Cockpit is a mod I made that puts a strip of flight instruments for Claude Code at the right end of Herdr's status bar: a speed tape, fuel gauges and warning lights. Clicking the strip opens a panel with everything at full size. The screenshot above shows it with sample data.

Why a cockpit

On a Claude subscription, usage is limited over a 5-hour window and a 7-day window, and every agent you run draws from the same two. Claude Code reports how much of each you've used as a percentage. That tells you how much fuel is left, but not whether it lasts until the reset. For that you also need to know how fast you're burning it, and a cockpit has instruments for exactly that.

What it shows

  • Speed: tokens per minute across all your Claude Code sessions, against a red speed limit: the speed that would use exactly what's left of the 5-hour limit by its reset. The tape turns amber within 15% of the limit and red above it.
  • Fuel: what's left of the 5-hour and 7-day limits and when each resets, plus the range, how long the 5-hour limit lasts at the current speed.
  • Glide slope: where your use sits against the straight line that would empty a window exactly at its reset: ▲ above it (too fast), ◆ on it or ▼ below it (fuel to spare). The panel charts it for the 5-hour window.
  • Agents: a row per agent in the panel with its status, context and prompt cache. Click one to jump to it, or pick a model or effort in the panel's header to type /model or /effort into the focused agent.

And the warning lights:

LightOn when
PACEAt the average pace since the window opened, a limit runs out before it resets
CTXThe focused agent's context is 80% full (red at 90%)
CACHEThe focused agent's prompt cache expires within a minute
FASTA working agent is in fast mode
STALEA working agent hasn't reported for 10 minutes
RUNAWAYOne agent by itself has burned faster than the speed limit for 15 minutes of non-stop work
WAITAn agent has waited for you for 2 minutes
STATUSstatus.claude.com reports a problem with Claude Code or the API (off by default)

Clicking RUNAWAY or WAIT jumps to that agent. Every instrument and light can be switched off in Settings, and the thresholds are settings too.

Where the numbers come from

Cockpit reads two things, both on your machine:

  • Tokens from Claude Code's transcripts in ~/.claude/projects. Cache reads are left out by default: they re-send the whole context on every turn and would swamp everything else.
  • Limits from Claude Code's status line. After each reply, Claude Code hands the status-line command a JSON description of the session, usage limits included. Connect… puts cockpit-tap, a small POSIX sh script, in front of your own status-line command. It saves that JSON where Cockpit reads it and then runs your command with the same input, so your status line (mine included) prints exactly what it did before. You see the change to ~/.claude/settings.json before it's made, a backup is kept, and Disconnect… puts your original command back byte for byte.

The limits come as percentages, not tokens, so Cockpit learns the speed limit: it compares the transcripts with the reported percentage to work out how many tokens one percentage point is worth.

Cockpit never reads credentials, keeps its own files readable only by you and makes no network requests, except to check status.claude.com every 5 minutes if you turn STATUS on.

Try it

You need the Herdr desktop app (0.1.18 or later) and Claude Code, on Linux or macOS. With Herdr open, run:

curl -fsSL https://github.com/blacksrc/herdr-cockpit/archive/main.tar.gz | tar -xz -C ~/.config/herdr-app/mods --strip-components=2 herdr-cockpit-main/mods/cockpit && sleep 2 && herdr-app do mod.open '{"name":"cockpit"}'

Cockpit opens with two buttons: Add puts it in your status bar and Connect… lets Claude Code report its limits to it. Run the same command again to update. Or skip the command and tell your Herdr agent: "Add herdr.dev/mods/blacksrc/herdr-cockpit".

The 5-hour and 7-day gauges need a Pro, Max or Ultra plan; with an API key, you get everything else.

Cockpit is written in TypeScript and MIT licensed. Its RECIPE.md describes the whole mod in enough detail for an agent to rebuild or install it.