Skip to content

Erratic Task/Subagent Behavior in Plan/Act Workflow: Premature Edits, Nested Plans, and UI Flickering #2073

@BobbyWang0120

Description

@BobbyWang0120

Bug Description
Description:
I'm writing to report a critical issue regarding the inconsistent and buggy behavior of the Task/Subagent feature within the plan/act workflow. While the Subagent capability is incredibly powerful, its current instability presents several significant bugs that disrupt the user experience, especially within the widely-used plan/act model.

Detailed Problem Descriptions:

Subagents Prematurely Modify Code in Plan Mode: When the main process is in plan mode, the intended purpose of a Subagent is to perform read-only analysis and information gathering to help formulate the plan. However, I've observed that these Subagents sometimes begin to actively modify code directly. This completely violates the core principle of the "plan first, act later" workflow, as the codebase is altered without user approval before a plan is even finalized.

Subagents Create Confusing "Nested Plans" Requiring Approval: In other cases, a Subagent correctly attempts to gather information, but it appears to operate in its own nested plan mode. It will generate a sub-plan on "how to collect the information" and then interrupt the primary workflow to ask the user to approve this sub-plan. This is confusing and disruptive, as the user should only need to approve the final, high-level plan, not the intermediate steps of how that plan is formulated.

Suspected Root Cause & Suggestions:

I believe the root cause of these issues is that the initial prompt, context, and permissions passed to a Subagent from the main thread are not being properly defined and isolated when in plan mode. The Subagent acts erratically because it doesn't seem to "know" that it should be operating in a restricted, read-only planning phase.

To address this, I would like to propose the following solutions:

Suggestion A: Implement Strict Sandboxing for Subagents in Plan Mode. When a Subagent is activated during plan mode, it should be strictly sandboxed with limited permissions. This means granting it read-only access to the filesystem and permissions for web-related operations (like searches) only. All "write" or "modify" capabilities should be completely revoked.

Suggestion B: Disable Nested Planning Behavior for Subagents in Plan Mode. During the planning phase, Subagents should simply execute their information-gathering tasks and return the results to the main thread. They should not create their own sub-plans that require separate user approval.

The Task/Subagent feature is one of the most promising aspects of Claude Code, but its current instability in the critical plan/act workflow is a pressing issue that needs to be addressed.

Additional Bug Report (P.S.):

There is also a related UI bug. On macOS, in both the native Terminal and iTerm2, there is a high probability that after a plan is approved and a Task begins, the entire terminal screen will start to flicker erratically until the task is completed or interrupted. This appears to be a UI rendering or state update bug.

Thank you for your hard work on this project!

Environment Info

  • Platform: macos
  • Terminal: iTerm.app
  • Version: 1.0.22
  • Feedback ID: 210febd6-621f-46d6-8819-3d7ccb09b94b

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions