drkokorev/cockpit-for-claude

Live instrument panel for Claude Code: context, rate limits, cost, subagents, tools, diffs and tests, plus a guard for risky commands.

TypeScript

2

4 commits

updated Oct 7, 2026

See the code

See what people are saying

README

Cockpit for Claude Code

See what your agent is burning, doing and changing, live, without leaving the session.

Cockpit is a Claude Code mod: a panel beside the transcript with context fill, rate limits, cost, subagents, tool calls, changed files and test runs. Every section opens to the details. A guard asks you before rm -rf, a force push or an edit to .env.

Works in the Claude Code terminal and the Claude desktop app (Code tab). Tested on macOS.

License: MIT Claude Code 2.1.287+ Mod

Cockpit demo

Install

In Claude Code:

/plugin marketplace add drkokorev/cockpit-for-claude
/plugin install cockpit@cockpit-for-claude

Or from your shell:

claude plugin marketplace add drkokorev/cockpit-for-claude
claude plugin install cockpit@cockpit-for-claude

The panel opens on its own in a wide terminal; anywhere else, type /cockpit. To see every section filled in before a long session, run /cockpit-demo (and /cockpit-demo off to get your own numbers back).

Why

A long agent session is a black box: you find out the context was full when Claude forgets something, that the 5-hour limit is gone when a request fails, and that a subagent looped on the same command when the bill arrives. Cockpit puts those numbers on screen while they still matter.

What you see

SectionAt a glanceOpen it for
ContextFill bar and tokens, what fills itEvery part of the context, memory files, MCP servers, the biggest tool outputs, and a Compact now button from 70%
Limits5-hour and 7-day windows, reset countdownsYour pace per hour and when the window fills at that pace
CostSession and last-turn cost, spend per hour, cache hit rate, prompt-cache countdownCost per turn, tokens by model, budget settings
TurnLive timer, model steps, tool calls, running subagentsThe turn's last ten actions in order
AgentsEvery subagent with its statusSteps, tokens, tool mix, a timeline of what it did, and its result
ToolsMost-used tools, errors, the slowest callCalls, errors, average and max time per tool; open a tool for its recent calls and error messages
FilesChanged files vs HEAD with +/− linesOpen a file for its diff
TestsLast run of npm/pnpm/yarn test, jest, vitest, pytest, go test, cargo test…The last six runs with passed and failed counts
GuardBlocked and allowed commandsThe guard's log and what it watches
AlertsLoop detector, compactionsEvery alert with its time
HistorySparkline of input tokens per turnA table of the last ten turns
All-timeSessions, turns, tool calls, spendAverages per session and per turn

Where the app shows no side panel, a two-line band above the prompt carries the same live numbers, and a status line under the prompt reads like ◆ ctx 72% · 5h 31% · $1.24 · 14 tools.

Screenshots

Tools: every call of one tool, its errors, and the outputs that bloat the context

Tools

Agents: a subagent's timeline and result

Agents

Files: the diff of a changed file

Files

Context and cost: what fills the window, tokens by model, cache countdown

Context and cost

The band above the prompt

Band

The pictures are rendered from the panel's real UI tree with the /cockpit-demo sample data (media/ has the script).

Alerts

Cockpit raises a toast when:

  • the context is 80% and 95% full
  • a rate-limit window is 75% and 90% used
  • your budget is 80% and 100% spent (when a budget is set and shown)
  • the same tool call repeats 3 times within 8 calls: a likely loop
  • the context was compacted, with tokens before and after
  • a turn took longer than two minutes

Guard

Before Claude runs one of these, Cockpit stops and asks Run it / Block it:

rm -rf · git push --force · git reset --hard · git clean -f · git checkout -- . · git branch -D · sudo · curl … | sh · DROP TABLE / TRUNCATE · chmod -R 777 · mkfs / dd of=/dev/… · kubectl delete · terraform destroy · npm publish

Edits to secrets files (.env*, *.pem, *.key, id_rsa, credentials, secrets.json…) get their own Allow / Block it question. A blocked call reaches Claude as a refusal that tells it to ask you first. Turn it off with /cockpit-guard off.

The guard is a seatbelt, not a sandbox: it matches command text, so treat it as a second look on top of Claude Code's own permissions.

Commands

CommandWhat it does
/cockpitOpen the panel (or print a report where no panel can be shown)
/cockpit-reportPrint a session summary in the transcript
/cockpit-exportSave a Markdown report with every turn and tool to .cockpit/cockpit-report.md
/cockpit-budget 5 · on · off · autoSet a spend budget in USD, or choose when it shows (auto: with API billing, not on a subscription)
/cockpit-guard on · offTurn the guard on or off
/cockpit-cache 5 · 60The prompt-cache lifetime the countdown assumes, in minutes
/cockpit-demo · offFill the panel with sample data, or restore yours

Everything in the panel is clickable: section names open details, tools and agents open their own, buttons at the bottom toggle the view. With the keyboard: ctrl+x then tab moves into the panel, Tab and Enter press buttons, and x expand all · c compact · g guard · m show or hide cost · b budget mode · p report · e export · r reset. Esc returns to the prompt.

Privacy

Cockpit runs inside your Claude Code process and makes no network requests. It reads what the session already knows (usage, tool calls, subagents) and runs local git commands for the Files section. All-time totals stay in the plugin's local store; /cockpit-export writes only where you run it.

Requirements

  • Claude Code v2.1.287 or later (mods are on by default). Check with claude --version.
  • The panel and band draw in the terminal (any size; the side panel docks from 110 columns in fullscreen) and in the Claude desktop app's Code tab. The regular chat tab of the desktop app does not load mods. In the VS Code chat panel, claude -p and cloud sessions, the guard and alerts still run; nothing is drawn.
  • Rate-limit windows appear on a Pro or Max subscription. With an API key, Cockpit shows cost and budget instead.

Develop

git clone https://github.com/drkokorev/cockpit-for-claude
cd cockpit-for-claude
claude plugin validate plugins/cockpit
claude plugin test plugins/cockpit
claude --plugin-dir plugins/cockpit

The mod is one hooks module, plugins/cockpit/hooks/register.tsx, with its state contract in plugins/cockpit/types/index.d.ts. Run /plugin-types in a session to get the engine's type declarations for your editor. Issues and pull requests are welcome.

Roadmap

  • Spend and turns per day for the last week
  • Custom guard rules and thresholds in /config
  • A sound when a long turn ends
  • A team view that adds up usage across machines

License

MIT

ai-agents
anthropic
claude-code
claude-code-mod
claude-code-plugin
developer-tools
observability

drkokorev/cockpit-for-claude

Live instrument panel for Claude Code: context, rate limits, cost, subagents, tools, diffs and tests, plus a guard for risky commands.

TypeScript

2

4 commits

updated Oct 7, 2026

See the code

See what people are saying

README

Cockpit for Claude Code

See what your agent is burning, doing and changing, live, without leaving the session.

Cockpit is a Claude Code mod: a panel beside the transcript with context fill, rate limits, cost, subagents, tool calls, changed files and test runs. Every section opens to the details. A guard asks you before rm -rf, a force push or an edit to .env.

Works in the Claude Code terminal and the Claude desktop app (Code tab). Tested on macOS.

License: MIT Claude Code 2.1.287+ Mod

Cockpit demo

Install

In Claude Code:

/plugin marketplace add drkokorev/cockpit-for-claude
/plugin install cockpit@cockpit-for-claude

Or from your shell:

claude plugin marketplace add drkokorev/cockpit-for-claude
claude plugin install cockpit@cockpit-for-claude

The panel opens on its own in a wide terminal; anywhere else, type /cockpit. To see every section filled in before a long session, run /cockpit-demo (and /cockpit-demo off to get your own numbers back).

Why

A long agent session is a black box: you find out the context was full when Claude forgets something, that the 5-hour limit is gone when a request fails, and that a subagent looped on the same command when the bill arrives. Cockpit puts those numbers on screen while they still matter.

What you see

SectionAt a glanceOpen it for
ContextFill bar and tokens, what fills itEvery part of the context, memory files, MCP servers, the biggest tool outputs, and a Compact now button from 70%
Limits5-hour and 7-day windows, reset countdownsYour pace per hour and when the window fills at that pace
CostSession and last-turn cost, spend per hour, cache hit rate, prompt-cache countdownCost per turn, tokens by model, budget settings
TurnLive timer, model steps, tool calls, running subagentsThe turn's last ten actions in order
AgentsEvery subagent with its statusSteps, tokens, tool mix, a timeline of what it did, and its result
ToolsMost-used tools, errors, the slowest callCalls, errors, average and max time per tool; open a tool for its recent calls and error messages
FilesChanged files vs HEAD with +/− linesOpen a file for its diff
TestsLast run of npm/pnpm/yarn test, jest, vitest, pytest, go test, cargo test…The last six runs with passed and failed counts
GuardBlocked and allowed commandsThe guard's log and what it watches
AlertsLoop detector, compactionsEvery alert with its time
HistorySparkline of input tokens per turnA table of the last ten turns
All-timeSessions, turns, tool calls, spendAverages per session and per turn

Where the app shows no side panel, a two-line band above the prompt carries the same live numbers, and a status line under the prompt reads like ◆ ctx 72% · 5h 31% · $1.24 · 14 tools.

Screenshots

Tools: every call of one tool, its errors, and the outputs that bloat the context

Tools

Agents: a subagent's timeline and result

Agents

Files: the diff of a changed file

Files

Context and cost: what fills the window, tokens by model, cache countdown

Context and cost

The band above the prompt

Band

The pictures are rendered from the panel's real UI tree with the /cockpit-demo sample data (media/ has the script).

Alerts

Cockpit raises a toast when:

  • the context is 80% and 95% full
  • a rate-limit window is 75% and 90% used
  • your budget is 80% and 100% spent (when a budget is set and shown)
  • the same tool call repeats 3 times within 8 calls: a likely loop
  • the context was compacted, with tokens before and after
  • a turn took longer than two minutes

Guard

Before Claude runs one of these, Cockpit stops and asks Run it / Block it:

rm -rf · git push --force · git reset --hard · git clean -f · git checkout -- . · git branch -D · sudo · curl … | sh · DROP TABLE / TRUNCATE · chmod -R 777 · mkfs / dd of=/dev/… · kubectl delete · terraform destroy · npm publish

Edits to secrets files (.env*, *.pem, *.key, id_rsa, credentials, secrets.json…) get their own Allow / Block it question. A blocked call reaches Claude as a refusal that tells it to ask you first. Turn it off with /cockpit-guard off.

The guard is a seatbelt, not a sandbox: it matches command text, so treat it as a second look on top of Claude Code's own permissions.

Commands

CommandWhat it does
/cockpitOpen the panel (or print a report where no panel can be shown)
/cockpit-reportPrint a session summary in the transcript
/cockpit-exportSave a Markdown report with every turn and tool to .cockpit/cockpit-report.md
/cockpit-budget 5 · on · off · autoSet a spend budget in USD, or choose when it shows (auto: with API billing, not on a subscription)
/cockpit-guard on · offTurn the guard on or off
/cockpit-cache 5 · 60The prompt-cache lifetime the countdown assumes, in minutes
/cockpit-demo · offFill the panel with sample data, or restore yours

Everything in the panel is clickable: section names open details, tools and agents open their own, buttons at the bottom toggle the view. With the keyboard: ctrl+x then tab moves into the panel, Tab and Enter press buttons, and x expand all · c compact · g guard · m show or hide cost · b budget mode · p report · e export · r reset. Esc returns to the prompt.

Privacy

Cockpit runs inside your Claude Code process and makes no network requests. It reads what the session already knows (usage, tool calls, subagents) and runs local git commands for the Files section. All-time totals stay in the plugin's local store; /cockpit-export writes only where you run it.

Requirements

  • Claude Code v2.1.287 or later (mods are on by default). Check with claude --version.
  • The panel and band draw in the terminal (any size; the side panel docks from 110 columns in fullscreen) and in the Claude desktop app's Code tab. The regular chat tab of the desktop app does not load mods. In the VS Code chat panel, claude -p and cloud sessions, the guard and alerts still run; nothing is drawn.
  • Rate-limit windows appear on a Pro or Max subscription. With an API key, Cockpit shows cost and budget instead.

Develop

git clone https://github.com/drkokorev/cockpit-for-claude
cd cockpit-for-claude
claude plugin validate plugins/cockpit
claude plugin test plugins/cockpit
claude --plugin-dir plugins/cockpit

The mod is one hooks module, plugins/cockpit/hooks/register.tsx, with its state contract in plugins/cockpit/types/index.d.ts. Run /plugin-types in a session to get the engine's type declarations for your editor. Issues and pull requests are welcome.

Roadmap

  • Spend and turns per day for the last week
  • Custom guard rules and thresholds in /config
  • A sound when a long turn ends
  • A team view that adds up usage across machines

License

MIT

ai-agents
anthropic
claude-code
claude-code-mod
claude-code-plugin
developer-tools
observability