The host counted any tool_result containing "running in background with ID"
as a launch acknowledgement, so a subagent's foreground `sed` of
fake-claude.py (or translate.go) became a background task that never ends.
A subagent's background command whose completion notification preceded its
launch result was also revived. Both stayed "Running" in the chat for days.
- claudehost: only a Bash/Agent/Task call's own first-line acknowledgement
starts a task; finished ids are never revived by late acks/progress;
background_tasks_changed (the CLI's running set) ends unlisted tasks;
tool output no longer counts as a task notification.
- claude: same strict acknowledgement; background_tasks_changed settles
tracked tasks; on reattach, host tasks without a native id are checked
against the main and subagent transcripts, so phantoms from hosts still
running the old build disappear.
- Fake CLI "subagent" turn and regression tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>