docs: document the independent subagent daemon (start/continue/interrupt)

This commit is contained in:
damocles 2026-09-09 18:15:35 +02:00
commit e64639c4d0
6 changed files with 165 additions and 14 deletions

View file

@ -3,11 +3,11 @@ name: claude-subagents
description: Spin up a short-lived headless `claude` sub-instance to grind through a well-scoped, mechanical batch (bulk relabeling, a repetitive find/replace, a mechanical migration) instead of burning your own context on it inline. Use this when a task has a clear, describable recipe and is either big enough to eat your context or long enough that you'd rather not babysit it. Not for judgement-heavy work, anything needing operator back-and-forth, or a task whose blast radius you can't bound up front.
---
# Ephemeral Sub-Agents via the Claude CLI
# Ephemeral Sub-Agents
`claude` is on `PATH` in your container, and a sub-instance you spawn
inherits the same filesystem and credentials you have. This is a
first-class tool for offloading a bounded, mechanical batch - not a hack.
A sub-instance you spawn inherits the same filesystem and credentials you
have. This is a first-class tool for offloading a bounded, mechanical
batch - not a hack.
## When to use it
@ -18,7 +18,36 @@ first-class tool for offloading a bounded, mechanical batch - not a hack.
- **No:** judgement-heavy work, anything needing back-and-forth with a
human, or a task whose blast radius you can't bound up front.
## The spawn command
## The `subagent` MCP tools
Your container's `subagent` MCP server (`hive-subagent-daemon`) is this
skill's recipe as MCP calls — no manual shell-wrapping, no hand-rolled
backgrounding:
```
start(name, prompt_file, model?, trigger?)
continue(name, prompt, model?)
interrupt(name, force?)
```
`name``--name`, `model``--model`, `prompt_file`
`--append-system-prompt-file`, `trigger`/`prompt``-p`. `start` returns
once the process is confirmed running, not once it finishes — a
completion lands as a todo (`get_loose_ends`), same as any other producer.
There's no `status` poll: check on a subagent by `continue`-ing it (refused
while it's still running, which is itself the "still going" signal) or by
reading its completion todo. `interrupt` genuinely stops a running turn
(`force: true` for SIGKILL) — unlike bash tasks' `kill`, this isn't
limited to a still-pending state.
Everything else in this skill (model choice, prompt hygiene, splitting
big batches, verify-then-report) applies unchanged; only the launch
mechanics differ from a raw shell invocation.
No `subagent` MCP server on this container? Fall back to the manual
command below — same recipe, you drive the backgrounding yourself.
## The spawn command (manual fallback)
Put the task recipe in a file and pass it as a path, with a short `-p`
trigger: