[BUG] Nested Plan Mode in Task Tool Creates Problematic Control Flow
Environment
- Platform (select one):
- [x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: 1.0.35
- Operating System: macOS Darwin 24.3.0
- Terminal: iTerm2
## Bug Description
When the parent assistant is in plan mode and invokes the Task tool, the
Task sub-agent inherits plan mode and has access to exit_plan_mode.
This creates nested plan modes with problematic control flow - approved
plans may execute in the sub-agent scope without returning control to the
parent, while denied plans waste all sub-agent work without returning
results.
## Steps to Reproduce
- Enter plan mode (e.g., type "ultrathink" or another plan mode trigger)
- Invoke the Task tool with any request
- Task sub-agent performs research and calls
exit_plan_mode - A plan modal appears to the user
- Approve or deny the plan
- Observe the problematic behavior (implementation in wrong scope or
total cancellation)
## Expected Behavior
- Task tool should complete its work and return results to the parent
assistant
- Parent assistant should remain in control of plan presentation and
implementation
- Sub-agents should not have independent access to
exit_plan_mode
## Actual Behavior
- Task sub-agent inherits plan mode and can call
exit_plan_mode
independently
- If plan is approved: implementation may occur within Task tool scope,
parent never regains control
- If plan is denied: Task tool is cancelled, parent receives only an
error message, all sub-agent work is lost
## Additional Context
- This is a known issue documented in user CLAUDE.md files as rule: "Do
not use Task tool when in plan mode, they don't work together"
- The issue persists after v1.0.33 which included "plan mode
improvements"
- Root cause appears to be plan mode inheritance in nested agent contexts
- Creates confusing UX where users may not know which agent's plan
they're approving
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗