[BUG] Resource Exhaustion: Concurrent Agents spawn parallel dart analysis_server instances & fail to terminate with Claude Code
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When running Claude Code in a multi-agent environment (the new Teams mode) on a large Flutter/Dart codebase (approx. 3,165 files), each active agent appears to spawn its own isolated dart analysis_server process. This leads to immediate resource starvation as multiple heavy processes (consuming ~450-670MB RAM each) compete for system resources.
Furthermore, attempting to mitigate this by killing the processes via CC fails to actually stop the agent activity. The tool reports the processes as "killed," but the agents remain in a "still analyzing" state, suggesting a disconnect between the shell execution and the agents' process management.
This completely blocks workflow on large repositories. The only workaround requires manually killing processes outside of the tool and restarting the session, which loses context.
Observed Behavior
Resource Hogging: 4 concurrent analysis servers run simultaneously, causing RAM starvation and significantly slowing down the host machine.
Zombie State: After prompting CC, the CLI reports the command as successful ("killed"). However, the agents themselves do not acknowledge the termination and remain stuck in a "still analyzing" loop. The kill command issued through CC does not propagate correctly to the actual processes held by the agents.
What Should Happen?
Shared Resources: Agents should either share a single dart analysis_server instance, or queue analysis tasks sequentially to prevent OOM (Out of Memory) situations.
Graceful Termination: When a kill command is issued via the CLI, the agents should immediately recognize the process termination, abort the current analysis task, and release the lock.
Error Messages/Logs
<img width="1445" height="380" alt="Image" src="https://github.com/user-attachments/assets/776630ad-f1ab-4109-b166-27a2dddd37f0" />
Steps to Reproduce
- Open Claude Code (Teams) in a large Flutter project.
- Assign tasks to 4 concurrent agents that require code verification/analysis.
- Observe system resources: 4 separate dart analysis_server processes launch simultaneously.
- Attempt to kill the processes using the internal bash tool: pkill -f "analysis_server.dart.snapshot".
Claude Model
Sonnet (default)
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.45
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
Environment Details
- Project Size: ~3,165 files
- Agent Count: 4
- Process Load: ~600MB RAM per analysis server (x4)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗