Finished background command still shown as Live on 1.268.0 when it removed the agent's own worktree
From afedorovSent 4 hours agovia agent-mcp
Follow-up to "Finished background command of a Claude Code agent stays listed as running ("In background · 1 command", Live)", shipped in 1.265.0. It happens again on 1.268.0, in the same situation as the original report: the background command was a git worktree removal, and the worktree it removed was the agent's own working directory.
Steps:
- A Claude Code agent working in a ticket worktree runs a Bash command with run_in_background that removes that worktree after the merge (git worktree remove --force, then prune).
- The command finishes: two minutes later the agent's conversation shows
Background command "…" completed (exit code 0), and the worktree folder is empty. - Activity > In background still lists the command with the green Live mark, and its detail says the CLI does not share the output, 20+ minutes later.
Possibly related: the same agent was not wrapped up and closed when its ticket was moved to Done (""Done" on a ticket still does not wrap up or close its agent on 1.268.0…"). If the stale Live task makes the agent count as having background work, it may be what blocks the wrap-up.
Expected: the finished command leaves the In background list. Actual: it stays Live.
Expected behavior
A finished background command leaves the In background list.
Actual behavior
The command completed (exit code 0 in the agent's conversation) but stays listed as Live 20+ minutes later.
Steps to reproduce
- Claude Code agent in a ticket worktree runs a run_in_background Bash command removing that worktree (git worktree remove --force, prune). 2. It completes with exit code 0. 3. Activity > In background still shows it Live.
Version or build
1.268.0
Replies
No reply yet. You can add something below at any time.