[BUG] If sub-agent asks user to approve an edit, it gets stuck indefinitely
Environment
- Claude CLI version: v1.0.102
- Operating System: macOS 15.6.1
- Terminal: VSCode integrated terminal
Bug Description
If a subagent asks the user to approve an edit, and the user denies the edit, then we get two kinds of wrong behavior depending on timing: either (1) Claude stalls indefinitely and we can't ESC out of it, or (2) the user's single denial applies to all waiting subagents
Steps to Reproduce
- Turn on VSCode integration
- Create a file "test.sh" with this content:
echo hello\necho world\n - "I'd like you to create two sub-agents using the Task tool to work on test.sh. One will replace "alpha" with "hello". The other will replace "beta" with "world"
- As soon as you see the prompt "do you want to make this edit" for whichever edit was first off the bat, then pick option 3 "No and tell Claude what to do differently"
Actual Behavior
Actual behavior is timing-dependent.
- If both subagents managed to get to the point of
Update(test.sh), i.e. if both of them were waiting for a user response, then my denial of alpha->hello in the first sub-agent also ends up being a denial of beta->world in the second sub-agent (even though I'd never been shown the proposed edit from the second sub-agent). But at least control returns back to me and I can interact further with Claude. - But if only one sub-agent got to its
Update(test.sh), then my denial to this sub-agent causes Claude to enter a weird indefinite state. It displays this:
⏺ I'll create two sub-agents to work on hook.sh - one to replace
"alpha" with "hello" and another to replace "beta" with "world".
Task(Replace alpha with hello)
⎿ Read 4 lines (ctrl+r to expand)
Update(hook.sh)
+1 more tool use
⏺ Task(Replace beta with world)
⎿ Update(hook.sh)
User rejected update to hook.sh
+2 more tool uses
⎿ No (tell Claude what to do differently)
✶ Misting… (esc to interrupt)
⎿ Tip: Run /install-github-app to tag @claude right from your Github
issues and PRs
You can't see it in this text, but the first task ("Replace alpha with hello") is blinking on and off showing that it's still in progress, and the "Misting..." displays its progress animation showing that it's still underway.
If I type further instructions to Claude at this point then they get added to the queue. If I press ESC nothing happens. This state persists indefinitely (I've waited up to 10 minutes). The only way I've ever been able to get out of it is with Ctrl+C and then starting an entirely new Claude session.
Expected Behavior
- Since sub-agents don't accept input, option 3 "No and tell Claude what to do differently" should not include the phrase "tell Claude what to do differently". It should just say "No"
- Rejecting one sub-agent's change should have no impact on the other sub-agent
- MOST IMPORTANTLY Claude should never get stuck.
Additional Context
When not using IDE-integration for edit approvals, then I've not been able to reproduce the "hang indefinitely" bug. I only ever see the "one user denial wrongly applies to both requests" bug, which weirdly shows "No (tell Claude what to do differently)" three times:
"I'd like you to create two sub-agents using the Task tool to work on test.sh. One will replace "alpha" with "hello". The other will do Bash("sleep 5") to wait 5 seconds and then replace "beta" with "world"
⏺ Task(Replace alpha with hello)
⎿ Update(hook.sh)
User rejected update to hook.sh
+1 more tool use
⎿ No (tell Claude what to do differently)
⏺ Task(Wait then replace beta)
⎿ Bash(sleep 5)
Waiting…
No (tell Claude what to do differently)
⎿ No (tell Claude what to do differently)
Note incidentally that sub-agents appear to be able successfully to use the ExitPlanMode tool which also pops up a user dialog.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗