plans/recluster-2026-06-04/plan-01.md
claude-mem's lifecycle hooks still conflate stdout (model context), stderr (diagnostics), and exit codes (blocking signal). On constrained or non-POSIX hosts the result is a family of identical-looking failures: printf: write error: Permission denied aborts the hook, Codex emits hook-output fields the host rejects, and a hook can block the main conversation by synchronously awaiting the worker. Each is the same missing contract — every emit point must declare an intent (DIAGNOSTIC / MODEL_CONTEXT / USER_HINT / BLOCKING_FEEDBACK / EXIT_SIGNAL) and route to the correct channel, and the worker round-trip must never sit on the conversation's critical path.
printf: write error: Permission denied + path not foundprintf: write error: Permission deniedprintf write error (Windows Chinese username, GBK/UTF-8)suppressOutput (v13.4.0)Design doc: plans/01-hook-io-discipline.md. Route every emit through an intent→channel wrapper; make printf writes failure-tolerant (never abort the hook on a closed/again pipe); strip host-unsupported output fields per-IDE; move the worker round-trip off the critical path (fire-and-forget + dedicated diagnostic surface).
| Host | Shell | Required behavior |
|---|---|---|
| Windows | PowerShell 7 / Git-bash / GBK locale | hook never aborts on write-error; exit 0 unless BLOCKING |
| Codex | host runtime | no unsupported output fields; non-zero exit only on real block |
| any | any | Stop/PostToolUse return without awaiting worker completion |
Spawn/templating of the hook command line (plan-02); worker supervision (plan-03).