MichaelP17/claude-mods/tree/main/concurrency-guard
concurrency-guard
병렬 subagent와 monitor의 수를 제한하고, 설정된 한도를 넘기려면 이유와 사용자 승인을 요구하는 Claude Code mod입니다.
이 mod 소개
concurrency-guard는 Claude Code가 동시에 실행하는 subagent와 monitor의 수를 제한합니다. 한도보다 적으면 정상적으로 시작됩니다. 한도에 도달한 상태에서 이유 없이 시작하면 거부되고, Claude가 이유를 적어 다시 시도하도록 안내하며 Allow once / No limit this session / Deny 승인 대화상자를 엽니다. 수량을 명시한 입력 프롬프트는 세션 한도를 올립니다. 상태 줄에는 현재 사용량이 표시되고, 한 메시지에서 시작한 subagent는 빈 슬롯 경쟁을 피하도록 순서대로 결정됩니다. maxSubagents(기본값 4)와 maxMonitors(기본값 3)는 /config 또는 ~/.claude/settings.json의 pluginConfigs로 설정합니다. "subagents"/"agents"/"monitors" 앞의 영어와 독일어 수량을 파싱하며, 입력 프롬프트만 한도를 올리고 /clear가 한도를 초기화합니다. Agent-tool로 시작한 항목만 게이트되지만 workflow나 플러그인이 시작한 subagent도 수에는 포함됩니다. CLAUDE_CODE_PLUGIN_DIRS에서 mod를 제거하면 제거됩니다.
설치
먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.
claude plugin marketplace add MichaelP17/claude-mods claude plugin install concurrency-guard
원문 / README
concurrency-guard
Caps how many subagents and monitors Claude runs at the same time. Parallel subagents multiply token use, and a runaway loop can start dozens of monitors; this mod makes going beyond a limit a deliberate decision.
| Situation | What happens | | --- | --- | | Below the limit | The subagent or monitor starts as usual | | At the limit, no reason given | The start is refused; Claude is told how to retry with a reason, and to do so only if another one in parallel is really necessary | | At the limit, reason given | A dialog shows the task and Claude's reason: Allow once, No limit this session or Deny | | Your prompt names a count | "Use 8 subagents", "starte fünf Subagents", "5 monitors" raises the limit to that count for the session; a toast confirms it |
While anything runs, the status line shows the count, for example agents 2/4 · monitors 1/3.
Several subagents started in one message are decided one after another, and a subagent that was let through counts until it is visibly running — otherwise all of them would see an empty slot at the same moment.
Configuration
| Option | Default |
| --- | --- |
| maxSubagents | 4 |
| maxMonitors | 3 |
Change them in /config, or in ~/.claude/settings.json:
"pluginConfigs": {
"concurrency-guard": { "options": { "maxSubagents": 6, "maxMonitors": 2 } }
}
How Claude states a reason
Claude learns the format from the refusal, so nothing has to be configured. For reference: a subagent carries the reason as the first line of its prompt, a monitor in front of its description, each introduced with Over-limit reason:. The mod removes the reason again before the subagent or monitor starts.
Details and limits
- Counts in prompts are read in English and German, as digits or as words up to twelve, when they stand directly before "subagents", "agents" or "monitors". Raising only ever goes up;
/clearresets the limits. - Only typed prompts raise limits. Messages from subagents, other sessions or task notifications never do.
- Running subagents come from Claude Code itself. Monitors are counted by the mod from their start until
TaskStop, their timeout or their end notification; a monitor started before the mod was loaded is not counted. - Only starts through Claude's Agent tool are gated. Subagents that workflows or other plugins start are not stopped, but they count toward the running total.
Uninstall
Remove the mod from CLAUDE_CODE_PLUGIN_DIRS. Its options in pluginConfigs can be deleted.