Add Sub-Agent Selection Option in Plan Mode

Resolved 💬 3 comments Opened Aug 6, 2025 by cgaaf Closed Aug 19, 2025

Feature Request: Add Sub-Agent Selection Option in Plan Mode

Problem Statement

Currently, Claude Code's plan mode offers three options when presenting execution plans:

  1. Yes, and auto-accept edits
  2. Yes, and manually approve edits
  3. No, keep planning

While Claude Code has introduced custom sub-agents that are supposed to be automatically used when appropriate, this automatic selection doesn't happen consistently. Users often need to:

  1. Select "No, keep planning"
  2. Manually instruct Claude to use their preferred sub-agent
  3. Continue with implementation

This workflow interruption is inefficient and creates uncertainty about whether declining the plan affects performance.

Proposed Solution

Add a fourth option to plan mode when sub-agents are available:

Current options:

  • ✅ Yes, and auto-accept edits
  • ✅ Yes, and manually approve edits
  • ✅ No, keep planning

Proposed new option:

  • Yes, and use sub-agent: [dropdown/selection of available agents]

Detailed Feature Description

When Sub-Agents Are Available:

  • Plan mode should detect available custom sub-agents in the project
  • Present an additional option allowing users to select which sub-agent should execute the plan
  • The selection could be implemented as:
  • A dropdown menu showing available agents
  • A numbered list of agents to choose from
  • A text input for specifying the agent name

User Experience Flow:

  1. User activates plan mode and reviews the proposed plan
  2. Claude presents execution options including sub-agent selection when agents are available
  3. User selects "Yes, and use sub-agent: [agent-name]"
  4. Claude executes the plan using the specified sub-agent with the chosen approval mode (auto-accept or manual)

Benefits:

  • Eliminates workflow friction: No need to decline plans just to specify sub-agent usage
  • Preserves plan context: Avoids the inefficient "No → specify agent → re-plan" cycle
  • Improves predictability: Users have explicit control over which specialist agent handles execution
  • Maintains current functionality: All existing options remain available
  • Leverages sub-agent specialization: Ensures the right agent handles the right type of work

Use Cases & UI Examples

Scenario 1: Dropdown Selection Interface

╭───────────────────────────────────────────────────────────────╮
│ Plan: Refactor authentication module for better security     │
│                                                               │
│ Steps:                                                        │
│ 1. Extract password hashing into separate service            │
│ 2. Add rate limiting to login attempts                       │
│ 3. Update session management                                 │
│ 4. Add comprehensive tests                                    │
│                                                               │
│ How would you like to proceed?                                │
│ ❯ 1. Yes, and auto-accept edits                              │
│   2. Yes, and manually approve edits                         │
│   3. Yes, and use sub-agent: [▼ Select Agent ▼]             │
│      ├─ @security-specialist (recommended)                   │
│      ├─ @code-reviewer                                       │
│      ├─ @refactoring-expert                                  │
│      └─ @test-specialist                                     │
│   4. No, keep planning                                        │
╰───────────────────────────────────────────────────────────────╯

Scenario 2: @ Symbol Reference Interface

╭───────────────────────────────────────────────────────────────╮
│ Plan: Add comprehensive unit tests for payment processing    │
│                                                               │
│ Steps:                                                        │
│ 1. Create test fixtures for payment scenarios                │
│ 2. Add integration tests for Stripe API                      │
│ 3. Mock external payment services                            │
│ 4. Add edge case testing for failed payments                 │
│                                                               │
│ How would you like to proceed?                                │
│ ❯ 1. Yes, and auto-accept edits                              │
│   2. Yes, and manually approve edits                         │
│   3. Yes, and delegate to: @_______________                  │
│      Available agents: @test-specialist, @api-expert,        │
│      @integration-tester                                     │
│   4. No, keep planning                                        │
╰───────────────────────────────────────────────────────────────╯

Scenario 3: Numbered Agent Selection

╭───────────────────────────────────────────────────────────────╮
│ Plan: Optimize database queries and add caching layer        │
│                                                               │
│ Steps:                                                        │
│ 1. Analyze slow queries in user dashboard                    │
│ 2. Add Redis caching for frequently accessed data            │
│ 3. Implement query result pagination                         │
│ 4. Add database indexing for performance                     │
│                                                               │
│ How would you like to proceed?                                │
│ ❯ 1. Yes, and auto-accept edits                              │
│   2. Yes, and manually approve edits                         │
│   3. Yes, with specialist agent:                             │
│      a) @database-optimizer (recommended for this task)      │
│      b) @performance-specialist                              │
│      c) @backend-expert                                      │
│   4. No, keep planning                                        │
│                                                               │
│ [Select 3a, 3b, or 3c, then choose approval mode]           │
╰───────────────────────────────────────────────────────────────╯

Scenario 4: Combined Agent + Approval Mode Selection

╭───────────────────────────────────────────────────────────────╮
│ Plan: Implement new user onboarding flow                     │
│                                                               │
│ Available execution options:                                  │
│ ❯ 1. Execute with main Claude (auto-accept)                  │
│   2. Execute with main Claude (manual approval)              │
│   3. Delegate to @frontend-specialist:                       │
│      ├─ Auto-accept edits                                    │
│      └─ Manual approval                                      │
│   4. Delegate to @ux-specialist:                             │
│      ├─ Auto-accept edits                                    │
│      └─ Manual approval                                      │
│   5. Custom agent: @_____________ [Enter agent name]         │
│   6. No, keep planning                                        │
╰───────────────────────────────────────────────────────────────╯

Technical Considerations

  • Should integrate with existing sub-agent detection mechanisms
  • Could combine with approval mode selection (auto-accept vs manual for the chosen agent)
  • Should fall back gracefully when no sub-agents are available
  • Maintains backward compatibility with current plan mode behavior

Impact on Current Issues

This feature would help address several existing pain points:

  • Reduces the workflow disruption described in issue #2073
  • Provides explicit control over sub-agent usage rather than relying on inconsistent automatic selection
  • Complements the custom command execution request in issue #2233

Priority Justification

Sub-agents are a powerful feature for specializing workflows, but their current integration with plan mode creates friction that reduces their effectiveness. This enhancement would make sub-agents significantly more practical for everyday development workflows while maintaining the safety and clarity benefits of plan mode review.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗