Two defects in the background-task hook scripts.
SubagentStop had no handler at all. When a subagent launched background work and
one watcher ended while others were still running, Claude could publish the
worker's last progress sentence as its final result, abandoning the live tasks.
A new guard pairs launched task IDs against completed ones and confirms liveness
by scanning /proc/<pid>/fd for an open tasks/<id>.output handle, blocking the
stop only while genuinely-live work remains. It fails open — allowing the stop —
when /proc is unavailable, nothing was launched, or everything finished.
The rewake helper watched only input.transcript_path. A subagent has its own
transcript, but Claude writes the completion queue-operation to the PARENT
transcript, so the record it waited for never appeared and the wake never fired.
It now watches both paths, but only when the relationship is provable: the
transcript's parent directory is subagents/ and its grandparent basename equals
input.session_id. It also now requires operation === 'enqueue'.
The rewake marker moves V2 -> V3; refreshStaleCodemanHooks treats absence of the
current marker as stale, so existing cases self-heal on next launch (the same
mechanism as the V1 -> V2 bump). Ownership matches on marker PREFIXES, so a
future bump still recognises older Codeman handlers and never adopts a user's.
12 tests fail on unmodified master, e.g.
expected '[{"matcher":"Bash",…' to contain 'CODEMAN_BACKGROUND_REWAKE_V3'
expected 'Background command bg-report-1 comple…' to contain '<codeman-background-result>'
- CLAUDE.md: idle detection cancellation on substantial output, API input
limits table, configure() method on RalphTracker, tighter completion
pattern description
- ralph-wiggum-guide: add configure() to tracker methods table
- Both docs: update Last Updated date to 2026-01-24
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- README: add spawn1337 section, update architecture diagram with
orchestrator/detector, add spawn API endpoints, update test badge
(1426 total)
- ralph-wiggum-guide: add spawn-related files to references
- All docs: update Last Updated dates to 2026-01-23
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- CLAUDE.md: Add step confirmation behavior, respawnEnabled field, recovery
strategy with dual redundancy, updated state lifecycle
- README.md: Multi-layer idle detection, step confirmation, state persistence
in performance table, updated architecture diagram with State Store
- docs/: Updated last-modified dates to 2026-01-22
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create docs/ralph-wiggum-guide.md with official plugin reference,
best practices, prompt templates, and troubleshooting
- Create docs/claude-code-hooks-reference.md with all hook events,
configuration options, and examples from official docs
- Update CLAUDE.md with documentation section and quick reference
- Add missing key files (task-tracker.ts, state-store.ts) to architecture table
- Add unit test note to test port allocation section
Sources: Official Anthropic plugin, code.claude.com, community resources
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>