Skip to content
BENIBIX Learn

CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS

AI⌨️ Claude CodeConfiguration

Also known as CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS environment variable

It sets how many subagents can run at the same time.

Think of it like

It is like a small kitchen. Only so many cooks fit at once.

Example

Jack's laptop slows down when Claude starts many helpers. He sets the cap to 5, and the work runs steady.

Why it matters

Each helper uses memory, tokens and API calls. A cap keeps a burst from swamping you.

Definition

CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS sets how many subagents can run at once in one session. The default is 20. Past that, the Agent tool will not start another. It takes a whole number above 0, so you can move the cap but not remove it. It needs version 2.1.217 or later.

Example code

bash
export CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS=5
claude
Run at most five helpers at once.
The cap counts the helpers side by side.

Common mistake

Trying to set 0 to turn the cap off. Anything that is not a whole number above 0 is ignored.

Key takeaways

  1. 1
    Default 20. At once.
  2. 2
    Whole number. Cannot remove it.
  3. 3
    2.1.217 or later. Older ignore it.