SLOPSHOPPER

mission-control

Mission control: session/turn tool-call counters in a Pane, an AbovePrompt band and a status entry

panebandguardstatusprompt
A shopper browsing a rack in a slop shop
Preview · a replayed session in a sandbox
claude · ~/work/app · mission-control
│ ┃ Mission control ✕ › fix the failing auth test and add an audit log call │ ┃ Mission control │ ┃ session calls: 9 ⏺ Read(src/auth.ts) │ ┃ turn calls: 9 ⎿ Read 6 lines │ ┃ last tool: Bash ⏺ Update(src/auth.ts) │ ⎿ Added 2 lines, removed 1 line │ ⏺ Bash(bun test) │ ⎿ 3 pass, 1 fail │ │ ● Done. refresh now rejects expired claims and logs an audit event. │ │ ✻ Worked for 42s · done 4:20 PM │ │ │ │ mission-control · session 9 · turn 9 · last Bash ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── › ? for shortcuts ⚠ mission-control: mc 9/9

Draws

Band
mission-control · session 9 · turn 9 · last Bash
Pane · Mission control
Mission control session calls: 9 turn calls: 9 last tool: Bash
README

weave

Coding-agent harness for Claude Code (and friends): inject skills, commands, agents, hooks, and an MCP surface into any project, and watch what the agent does from a local dashboard.

npm license

npm install -g @weavecode/weave
weave init          # scaffold a project
weave dashboard     # start the daemon (if it is not running) and open the UI

What it does

  • weave init — writes the harness files a project needs (.claude/ helpers, hooks, settings, .mcp.json), merging into user files instead of overwriting them. Multi-harness: Claude Code and Codex.
  • weave daemon — a local daemon (HTTP + SQLite) that ingests hook events, stores sessions, and serves the dashboard. Hooks never call it over HTTP: events append to <configDir>/weave/hooks/inbox/ (a daemon worker thread claims and ingests them, then deletes the file), so collection and rule-driven injection keep working while the daemon is down. Upgrade note: a project's .claude/helpers/hook-handler.cjs is only refreshed by weave init, so re-run it in projects initialized before this change (older scripts post to a removed endpoint and would report nothing).
  • weave dashboard — a web UI for projects, sessions, hooks, plugins, and installs. Served by the daemon itself.
  • weave scan / weave status — project discovery and harness status.

Dashboard

  • Sessions — every project's sessions, with live status (running / compacting / interrupted) and a per-turn event chain.
  • Blocking questions — AskUserQuestion, plan approvals and permission prompts are surfaced in the browser and answered by injecting the option keystrokes into that session's pane; a new prompt raises a toast, a system notification and a Web Push message.
  • Messaging — send a prompt to any session from the dashboard (a session's own inbox socket first, then terminal text injection, then the native peer relay), read the conversation next to the session, and interrupt a running turn with one ESC.
  • Watch subscriptions — subscribe to a session's idle / turn-end / message-failed transitions and get notified in-page, as a system notification, and by Web Push once the page is closed.
  • Resource market — import a marketplace and install its skills/commands/agents/hooks/plugins into a project or globally, then toggle them; the packages weave ships are one such market.
  • LAN access — an optional HTTPS listener with a self-signed certificate, so a phone on the same network can open the dashboard (and receive push notifications); dashboard login is password-protected (weave chpass).

Built-in resources

Everything weave ships — the weave init commands and agents, the built-in skills/hooks/rules plugin packs, and the rule packs loaded into the engine — lives in one marketplace-shaped directory:

packages/weave-templates/src/resources/weave-market/
├── .claude-plugin/marketplace.json   # the repo's own manifest
├── plugins/<scope>/<pack>/           # toolkit packages (skills, hooks, mods)
├── rules/<pack>/                     # rule packs loaded by the weave engine
└── init/{commands,agents}/           # what `weave init` copies in

On daemon start it is materialized at <configDir>/weave/market/weave/ as a link to that directory (a copy where links are unavailable), and it is the single source for scanning, listing and installing:

  • to change what weave ships, edit that directory — nothing is generated from code-side lists any more;
  • a dev checkout links to src/resources/…, so content edits are live for the next scan/restart; pnpm build copies it to dist/resources/… for the published package;
  • from the dashboard it can only be browsed and toggled: migrating, deleting and update-checking are refused — it is owned by weave and re-materialized on every daemon start.

External repos are separate: import them through the dashboard's resource market (<configDir>/weave/market/<id>/), and their packages show up as their own namespace block next to the built-in weave one.

Commands

CommandWhat it does
weave initScaffold harness files into a project
weave scanDiscover and register projects
weave statusShow harness status for a project
weave doctorDiagnose local wiring (registration, token, daemon)
`weave daemon start\stop\status`Manage the local daemon
weave dashboardOpen the dashboard in a browser (starting the daemon if needed)
weave chpass <new password>Change the dashboard login password (locally, no old password needed)
weave uninstallRemove weave's init outputs from a project (rolls back the init commit when it is HEAD, otherwise commits the removal)

Packages

One artifact is published — @weavecode/weave, a self-contained bundle: the compiled CLI, daemon, dashboard and built-in resources, with every runtime dependency packed inside the tarball, so a global install needs nothing else from the registry. The repo's layers below are private and are never published on their own.

PackageRole
packages/weave (@weavecode/weave)The published bundle: CLI + daemon + dashboard + resources
packages/weave-cli (@weavecode/cli)CLI entry point (weave command)
packages/weave-server (@weavecode/server)Daemon: HTTP, SQLite, hook ingestion, dashboard host
packages/weave-harness (@weavecode/harness)Harness drivers and the init pipeline
packages/weave-templates (@weavecode/templates)Built-in market (skills, commands, agents, rules)
packages/weave-core (@weavecode/core)Shared types and tables

Requirements

  • Node.js >= 22.5 (the daemon stores data with node:sqlite).
  • Claude Code and/or Codex installed and on PATH — weave drives them, it does not bundle them.
  • Optional: a terminal backend weave can address panes in (wezterm today). Session interrupt and remote answering work by writing keystrokes into the session's pane, so they need one.

Development

pnpm install
pnpm build        # tsc -b + template/preset copy
pnpm build:web    # dashboard bundle → packages/weave-server/web/dist
pnpm test
pnpm dev          # CLI from source
pnpm dev:server   # daemon from source
pnpm dev:web      # dashboard on :9527

Requires Node.js >= 22.5 (uses node:sqlite).

Publishing

node scripts/release.mjs <version>   # bump every package, build, publish components with pnpm, then publish the umbrella tgz

Packages publish under the @weavecode scope to the public npm registry. workspace: dependencies are rewritten by pnpm publish — do not use npm publish directly.

License

Apache-2.0. See LICENSE and THIRD_PARTY_NOTICES.md.

Source 1 files
hooks/register.tsx 56 lines
1import type { Register } from 'claude-code'
2
3const PANE = 'mission-control'
4
5// 模块级计数:热重载后归零(会话仪表可接受)——精简版只做
6// 「state 计数 + Pane/AbovePrompt/status」,不引入 $.state 契约文件。
7let sessionCalls = 0
8let turnCalls = 0
9let lastTool = '-'
10
11export const register: Register = on => {
12  on('session.start', async ($, e, next) => {
13    await $.ui.open({ id: PANE, title: 'Mission control' })
14    return next(e)
15  })
16
17  on('prompt.submit', ($, e, next) => {
18    turnCalls = 0
19    $.ui.invalidate()
20    return next(e)
21  })
22
23  on('tool.call', ($, e, next) => {
24    sessionCalls += 1
25    turnCalls += 1
26    lastTool = String(e.tool)
27    $.ui.status(`mc ${sessionCalls}/${turnCalls}`)
28    $.ui.invalidate()
29    return next(e)
30  })
31
32  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
33    const { Box, Text } = $.ui.resolve(e)
34    return (
35      <Box flexDirection="column">
36        <Text bold>Mission control</Text>
37        <Text>session calls: {sessionCalls}</Text>
38        <Text>turn calls: {turnCalls}</Text>
39        <Text dimColor>last tool: {lastTool}</Text>
40      </Box>
41    )
42  })
43
44  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
45    if (e.props.hasSurvey) return next(e)
46    const { Box, Text } = $.ui.resolve(e)
47    return (
48      <Box>
49        <Text dimColor>
50          mission-control · session {sessionCalls} · turn {turnCalls} · last {lastTool}
51        </Text>
52      </Box>
53    )
54  })
55}
56