Review Claude Code Background Subagents Checkpoints

I’ll review the uncommitted changes, trace the lifecycle behavior, and check for regressions and test gaps.
Found two issues:
-
P2 — Resumed subagents can match an old completed record.
state.go:689returns the first matchingAgentID. Resuming a Claude subagent reuses its agent ID with a new tool-use ID. If the earlier completed record hasn’t been condensed, the stop handler selects it and skips completion of the new task. Prefer the live matching record and add a resume regression test. -
P2 — Malformed tool input is logged verbatim.
hooks.go:98–99logs arbitraryrun_in_backgroundcontent without redaction. An unexpected string/object could contain sensitive model-provided content. Log only the invalid type or a generic warning.
Targeted unit and integration tests passed. No files changed.
I’ll verify the two fixes and recheck the surrounding lifecycle paths for regressions.
Both previous findings are fixed, with regression tests covering them. I found no additional actionable issues.
Targeted unit and integration tests passed; git diff --check is clean. Full CI and lint were not run.