Skip to content

[BUG] Subagent cascade bug: Multiple parallel instances spawn on test failure #7955

Closed as not planned

Description

@mstHex

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Description

When a subagent creates a Python test script that encounters an error during execution, Claude Code spawns multiple parallel instances of the same subagent task instead of handling the failure gracefully.

Steps to Reproduce

  1. Initiate a task that requires creating a test script
  2. Have the subagent (in this case "flow-hawk") create a test file
  3. When the test file encounters an error during execution
  4. Observe multiple parallel instances of the same subagent task spawning

Actual Behavior

  • Multiple "flow-hawk" instances executing "Implement adaptive window sizing" in parallel
  • Redundant parallel execution of the same task
  • Resource waste and potential conflicts from parallel writes

Evidence

Image

Environment

  • Claude Code version: 1.0.120

  • OS: macOS Tahoe 26

  • Context: Creating test_adaptive_integration.py (134 lines)

Impact

  • Performance degradation
  • Resource exhaustion
  • Potential file conflicts from parallel writes
  • Poor user experience requiring manual interruption (ctrl+t)

What Should Happen?

Expected Behavior

  • Single subagent should handle test failure and retry/fix
  • Error handling should be sequential, not parallel
  • No duplicate subagent instances should spawn

Error Messages/Logs

Steps to Reproduce

  1. Ask Claude Code to create a Python module with tests:
    "Create an adaptive window sizing module with unit tests"

  2. When it creates the test file, ensure it fails by asking:
    "Make the test import a non-existent module"

  3. Watch Claude Code attempt to run the failing test

  4. Bug: Multiple parallel "flow-hawk" subagents spawn immediately (20+ instances all running "Implement adaptive window sizing")

Minimal trigger code:

# test_adaptive_integration.py
from non_existent_module import Something  # This import fails
def test_something():
    pass


Result: Cascade of parallel subagents instead of single error handling

### Claude Model

Opus

### Is this a regression?

Yes, this worked in a previous version

### Last Working Version

_No response_

### Claude Code Version

1.0.120

### Platform

Other

### Operating System

macOS

### Terminal/Shell

VS Code integrated terminal

### Additional Information

_No response_

Activity

  1. PaulRBerg commented on Sep 24, 2025

    @PaulRBerg

    I am also noticing this buggy behavior - not quite sure what triggers it as in my case, I wasn't writing tests. I'm also not sure if this means that that many subagents are run in parallel - or if it's just a UI error.

    Image
  2. github-actions commented on Dec 6, 2025

    @github-actions

    This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

  3. github-actions commented on Jan 9, 2026

    @github-actions

    This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

  4. github-actions commented on Jan 16, 2026

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  5. locked as resolved and limited conversation to collaborators on Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:coreautocloseIssue will be closed automaticallybugSomething isn't workinghas reproHas detailed reproduction stepsperf:memoryplatform:macosIssue specifically occurs on macOS

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions