mycostop-hook-fragilitylisted
Install: claude install-skill goondocks-co/myco
# Stop Hook Fragility: Diagnosis, Idempotency, and Recovery
Stop hooks sit at the boundary between Claude Code and Myco's capture
pipeline, and they are the most fragile point in that chain: a single
broken path, a missing fallback, or a masked exit code silently stops
prompt/response capture with no visible symptom in the session itself.
Three independent failure modes have been observed, each with a
different root cause and a different diagnostic fingerprint. Treat
"capture isn't working" as a triage problem — figure out which of the
three you're looking at before reaching for a fix.
## Prerequisites
Know the shape of the hook chain before diagnosing anything:
- Claude Code invokes hooks per the command registered in
`~/.claude/settings.json` (e.g. the Stop hook entry).
- That command routes through `~/.myco/launcher.cjs`, which spawns the
actual hook binary and translates the child's exit/signal into its
own process exit.
- The hook binaries themselves live in `packages/myco/src/hooks/`
(covering, among others, the stop, user-prompt-submit, and
post-tool-use entry points). **Every hook in this directory is
fail-open** — it always exits 0, writing errors only to stderr. The
hook code is never the source of a non-zero exit you see in Claude
Code's UI.
- Capture-critical hooks POST to the daemon (a `capturePost(...)` call,
which is `captureCritical`) and, on failure, should buffer to
`<grove>/projects/<pid>/buffer/<sid>.jsonl` for replay via
`reconci