cockpit

cockpit is a command for Claude Code from jianzhichun/emerge. It costs 0 tokens per session (865 once invoked), scanned C, original, MIT.

A command that opens the Emerge Cockpit, a browser dashboard for the Emerge server and its connected controls.

In plain words
What is it for?
Finding the dashboard address, starting a standalone dashboard when needed, and surfacing connector control panels.
Why use it?
It gives you a browser view for managing and inspecting the running Emerge service instead of using only terminal commands.

Command for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: mentions Claude Code.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the emerge plugin — 15 skills, 10 commands, 3 agents, 24 hooks shipped together

Good fit Finding the dashboard address, starting a standalone dashboard when needed, and surfacing connector control panels.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add jianzhichun/emerge
Claude Code
/plugin install emerge

Made for: Claude Code.

Or install emerge, the plugin that ships this one along with the rest of its 15 skills, 10 commands, 3 agents, 24 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cockpit

README.md
[![agentmods](https://agentmods.dev/badge/commands/jianzhichun/emerge/cockpit/github.svg)](https://agentmods.dev/commands/jianzhichun/emerge/cockpit)
Your own site
<a href="https://agentmods.dev/commands/jianzhichun/emerge/cockpit"><img src="https://agentmods.dev/badge/commands/jianzhichun/emerge/cockpit/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cockpit

Your own site · 80×15
<a href="https://agentmods.dev/commands/jianzhichun/emerge/cockpit"><img src="https://agentmods.dev/badge/commands/jianzhichun/emerge/cockpit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 865 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00865
Opus 5 $0.00000 $0.00432
Sonnet 5 $0.00000 $0.00173
Haiku 4.5 $0.00000 $0.00086

Measured 10d ago against content hash 45bc6eef84f2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade C, and why

cockpit scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

curl -s http://localhost:8789/api/assets | python3 -m json.tool

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s http://localhost:8789/api/assets | python3 -m json.tool
commands/cockpit.md · 65 lines

How it starts

The opening of the file, as written. The whole thing — 65 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/emerge:cockpit — Open Cockpit Dashboard

The cockpit server is started automatically by the daemon. This command opens it.

Always invoke the admin CLI via the Emerge plugin root (not the user's open project). Claude Code expands ${CLAUDE_PLUGIN_ROOT} to that path when this command runs.

Steps

  1. Get cockpit URL: When the Emerge HTTP daemon is running (default from SessionStart), Cockpit is on the same port as MCP — typically http://localhost:8789/ (same host/port as plugin.json url for /mcp, but open the root / in a browser). If the daemon is not running (or you need a standalone cockpit without MCP):

    python3 "${CLAUDE_PLUGIN_ROOT}/scripts/repl_admin.py" serve --open --port 0
    

    Read output to extract Cockpit running at http://localhost:PORT.

  2. Print URL to user: Report: "Cockpit running at " (prefer daemon URL http://localhost:8789/ when the daemon is up).

  3. Discover connector assets and inject controls: Cockpit's "Controls" panel sources HTML from two places:

    • Disk-persisted~/.emerge/connectors/<connector>/cockpit/*.html (with optional <name>.context.md). These are auto-surfaced by GET /api/assets; no action needed.
    • Runtime-injected — session-only HTML pushed via POST /api/inject-component. Used when an adapter wants to expose a live control before crystallization.

    Enumerate what's available and report it to the user:

    curl -s http://localhost:8789/api/assets | python3 -m json.tool
    

    For each connector in the response, list the notes/components the cockpit will show. If a connector has cockpit/*.html but no matching .context.md, mention it (authoring hint).

    When CC wants to push a runtime-only control (e.g. an adapter-generated preview), inject it with:

    curl -s -X POST http://localhost:8789/api/inject-component \
      -H 'Content-Type: application/json' \
      -d '{"connector":"<name>","html":"<!-- fragment -->","id":"<slot-id>","replace":false}'
    

    id makes the injection idempotent (re-injecting updates the same slot). replace:true clears all prior slots for that connector. Runtime slots appear as injected-runtime-N.html in the Controls list — crystallize them to disk to persist.

Read the full file on GitHub · 65 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 65 lines · 0 tokens per session scan C 45bc6eef84f2

Subscribe to this mod's changes

cockpit is a command published in the GitHub repository jianzhichun/emerge (107 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 865 tokens. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.