Background agent task-notification reports status: "completed" while the task is still running

Status Closed — duplicate
Maintainer reply None cached
Activity 1 comment · opened Jul 25, 2026 · closed Aug 20, 2026

During a Claude Code session, a background agent task (Agent tool, subagent_type: fork) triggered a <task-notification> with status: "completed", including a full result summary — the normal signal that a background task has finished and is no longer running.

The task was in fact still running. The CLI's own background-task UI showed it as an active agent/shell well after the completion notification had arrived (over 50 minutes, per the shell's reported runtime). This was confirmed from within the session: calling TaskStop on an unrelated task ID returned an error listing "Running background agents," which included the task ID that had already reported status: "completed". Calling TaskStop on that ID directly succeeded, confirming the task was genuinely still alive.

An orphaned polling shell tied to the same agent (a while ! grep -q "..." ...output; do sleep 5; done loop) was also still running well past the point its exit condition should have resolved.

Impact: A status: "completed" task-notification cannot be relied on as confirmation that a background task has actually terminated. This can leave orphaned processes/shells running indefinitely with no further signal — discoverable only by manually checking the task list UI or TaskStop's error output.

Environment: Claude Code CLI on Windows, session using git worktrees with multiple concurrent background Agent (fork) tasks over a long-running session.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗