[FEATURE] Workflow: the concurrency limit counts agents, not the weight of their local commands; no cap across runs or sessions

Status Open
Reported on v2.1.268
Maintainer reply None cached
Activity 0 comments · opened Oct 3, 2026

What exists. A Workflow runs up to 16 agents at once by default, fewer on machines with fewer CPUs, and CLAUDE_CODE_WORKFLOW_MAX_CONCURRENT_AGENTS (1–256, v2.1.269+) changes that number. The docs list its purpose as "Bounds local resource use".

The gap. The limit is one number per run, the same for an agent that only reads and searches and for one that starts a heavy local process (video decode, transcription, mutation testing, a browser test suite). Lowering it to protect the machine also slows every light fan-out, and it does not apply across separate runs or across several Claude Code sessions on the same machine.

Two cases on a MacBook Pro M3 Pro (18 GB):

  • 11 Sep (CLI 2.1.268, macOS 27.0, before the setting existed): over two hours, 17 Workflow agents made 46 whisper transcription calls. In the jetsam snapshot, 9 Python processes from that session's process coalition had a combined footprint of 52.1 GiB (most of it compressed), and the report lists 2,071 low-swap kills. A handful of concurrent agents is a reasonable count for research, but not when each one loads a multi-GB model on 18 GB.
  • 2 Oct (CLI 2.1.287, macOS 27.0.1): a Workflow with eight parallel search agents. Between 19:16 and 20:46 they downloaded 58 short videos and software-decoded each into a contact sheet with ffmpeg. The heavy command ran inside each search agent as it found candidates, so the script could not know in advance which step would be heavy. The owner noticed the laptop running hot during the run; we did not save a thermal series for it.

Ask (any of these would help):

  1. A per-step weight or a "heavy" marker in the Workflow script (for example, agent(prompt, { heavy: true }) runs at most N such agents at once), separate from the general agent limit.
  2. A machine-wide cap or lock for heavy steps that holds across runs and sessions.
  3. A sentence on the Workflows page that settings PreToolUse hooks run for workflow agents (the sub-agents page implies it), so users can gate heavy commands on their own resource checks.

Related: #63938 (earlier request for a configurable limit, closed), #92829 (Workflow starves an 8 GB machine, Desktop), #89865 (fan-out past the size guideline without confirmation), #90483 (concurrency derived from CPU count), #98769 (fseventsd growth on agent-heavy Macs).

View original on GitHub ↗