COCKPIT · CLAUDE

CLAUDE CODE · STATUSLINE OPEN SOURCE

Your session,
from the flight deck.

Four lines under your prompt. How much context you can actually still use, what this session is costing per hour, whether your pace will hit the 5-hour cap before it resets, and how many other sessions are quietly eating the same limit.

claude · cockpit LIVE
00:00 / 05:00

Session warming up.

Backs up settings.json before it touches it. Not ready? --dry-run shows every change and writes nothing.

  • 0dependencies
  • 0network calls
  • 14signals
  • MITlicensed
  • 18+node

WHY FOUR LINES

Three things one line can't tell you.

A single line has room for the numbers. It has no room for what they mean next. These three are the reason cockpit is four.

  1. 01

    Context you can actually use

    Auto-compact fires while there is still headroom on the clock, so a raw 82% remaining is a lie about how much room you really have. cockpit subtracts the buffer and shows usable context, so 100% means compaction, not empty.

  2. 02

    Pace, not just position

    62% used means nothing without knowing how fast you got there. cockpit extrapolates your burn against the window and prints where you will land. If that lands past 100%, it prints the clock until you're capped and tells the effort badge to say ↓ease.

  3. 03

    The sessions you forgot were running

    Rate limits are billed to the account, not the window. Four terminals open means four sessions draining one budget, and each of them thinks it is alone. Every cockpit heartbeats to a shared temp file, so each panel can show the whole fleet and its combined burn.

WHAT IT SHOWS

Fourteen signals, four lines.

Point at any part of the panel. Tap on touch, or use once focused.

Hover a segment to read it.

RECORDING

The panel at the top is a simulation. This is not.

The hero runs invented session data through the real projection maths, because a page cannot have a live Claude Code session. This is sixteen seconds of actual stdout, captured from the tool and not recreated. It shows three lines rather than four: the sample payload has no todo list and the repo has no cost ledger, so the panel correctly hides both segments.

THE HONEST LEDGER

What it does. What it costs you.

Every statusline is a trade: screen space and a subprocess or two, in exchange for not having to guess. Here is both sides, so you can decide before you install rather than after.

What it does

  • Reports usable context. The auto-compact buffer is subtracted, so 100% is compaction, not a full window.
  • Projects, not just reports. Rate limits get a pace figure and a cap ETA, the only genuinely actionable form of that number.
  • Sees the whole fleet. The pool count is information no single window can derive on its own.
  • Remembers the repo. Lifetime spend, active time and session count, read from the repo's own ledger.
  • Costs nothing at runtime. Zero dependencies, zero network calls, zero telemetry.
  • Fails quietly. Every reader is wrapped; a broken segment drops out instead of blanking the line with a stack trace.
  • Holds its columns. Live numbers sit in fixed-width fields, so growing values never shove the line sideways.
  • Turns off. Every one of the fourteen segments has a switch.

What it costs

  • Four lines is real estate. On a 24-row terminal that is a sixth of it, gone before you type anything.
  • Four git subprocesses per render. On a huge repo or a network filesystem this is the slowest thing it does. segments.git: false is the fix.
  • The 16.5% buffer is a constant, not a reading. If Claude Code retunes auto-compact, the bar is wrong until you retune the config.
  • The projection is naive. Straight linear extrapolation. Bursty work makes it swing, and it only ever answers "if you keep going exactly like this".
  • The pool is a floor, not a total. It counts sessions running cockpit. A window with a different statusline is invisible to it.
  • The ledger needs a file nobody writes for you. No .claude/costs.csv, no Σ$ segment.
  • Config is global. One file for every repo; no per-project overrides, and no way to reorder segments.
  • It cannot act. It says ↓ease. It will never change your effort level for you.
Four of twenty-four rows. The honest way to read the trade: turn off ledger, todos and pool and it collapses to two.

What it could do

Known gaps, in rough order of how much they would help. None of them are claimed. Every one is a reasonable first contribution.

    Propose one of your own

    UNDER THE HOOD

    Boring where it counts.

    01

    One payload in

    Claude Code pipes a JSON blob to the statusline command on every render. cockpit reads that, the repo's cost ledger, and git. Nothing else.

    02

    No network, ever

    Zero dependencies, zero fetches, zero telemetry. Rate limits arrive inside the payload. Nothing about your session leaves the machine.

    03

    Fails to blank

    Every reader is wrapped. A missing ledger, a corrupt config, a repo with no upstream: the segment drops out and the rest of the panel renders.

    04

    It doesn't jitter

    Live numbers sit in fixed-width fields. Your spend rolling from $9.99 to $10.00 won't shove the line sideways mid-thought.

    CONFIG

    Every segment has an off switch.

    Drop a cockpit.config.json next to your settings. Everything is optional; a missing file gives you the full panel.

    ~/.claude/cockpit.config.json
    {
      "segments": { "ledger": false, "todos": false },
      "context":  { "autoCompactBuffer": 16.5, "width": 10 },
      "limits":   { "width": 8, "projection": true },
      "colors":   { "ledger": "gold" }
    }

    OPEN SOURCE

    It's yours too.

    MIT, developed in the open, and small enough to read in one sitting. Come argue about the defaults, ship a segment, or show what you built on top of it.

    Comments here are GitHub Discussions, rendered in place. Post with your GitHub account and the thread lives in the repo, not in a database only I can read.

    FAQ

    The questions that actually get asked.

    Why does my context bar read higher than Claude Code's own number?

    Because it measures something different. Claude Code reports raw remaining context. Auto-compact fires while a buffer is still on the clock, so raw remaining overstates your actual headroom. cockpit subtracts that buffer, which means its 100% is the moment compaction fires, not the moment the window is literally full. Set context.autoCompactBuffer to 0 if you want the raw number back.

    What is ⚡cap~1h41m?

    Your current pace, extended to the end of the 5-hour window, lands past 100%. That is the estimated time until you hit the cap. It replaces the →N% projection whenever the projection would exceed 100. Stop working and it stops being true, which is rather the point of showing it.

    Does it phone home?

    No. Zero dependencies, no network calls of any kind. Rate limits arrive inside the JSON payload Claude Code already pipes to the statusline command. The only things it reads from disk are your todo files, an optional per-repo cost CSV, and the pool heartbeats it writes itself.

    Four lines is a lot of terminal.

    It is, and that is the honest cost. Turn segments off until it is the size you want; with ledger, todos and pool off it collapses to two. The default is deliberately maximal because a segment you never configured is a segment you never had to think about.

    Why not just one line?

    Because the three things worth the most do not fit on one. A pace projection needs the percentage, the reset clock and the extrapolation sitting next to each other. The repo ledger needs three numbers to mean anything. The pool needs a count and a combined rate. If you want one line, turn segments off until you have one: that is a supported configuration, not a compromise.

    Can I fork it, rename it, ship my own?

    Yes. MIT. Do what you like, no attribution dance required. If you build something on top of it, open a showcase issue and it goes on this page.