[BUG] claude-security scan at medium effort spawned 95 agents for 208-file scope — no timeout or cap, ran 2.5+ hours

Status Open
Reported on v2.1.195
Maintainer reply None cached
Activity 1 comment · opened Jul 24, 2026

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?

Plugin: claude-security v0.10.0

Job: scan-codebase

Effort: medium

Scope: single directory, 208 tracked files

What happened

Running a scoped medium-effort security scan on a 208-file C# API project spawned 95 agents over ~2.5 hours before I stopped it manually. The workflow never completed.

Breakdown:

~25 research agents (expected, reasonable)
~70 verification agents (3-lens panel × ~22 candidate findings = ~66 verifiers) with no sign of finishing
The verification panel scales with the number of candidate findings and has no cap or timeout relative to the scope size. For a 208-file scoped scan this is completely disproportionate.

What Should Happen?

A medium-effort scoped scan of ~200 files should complete in 20–30 minutes with a bounded agent count.

Error Messages/Logs

Steps to Reproduce

  • Install the claude-security plugin v0.10.0
  • Open a Claude Code session in a git repository with 150–250 tracked files (a C# or similar multi-file API project works well)
  • Run /claude-security and select Scan codebase
  • When prompted for scope, select a single directory containing ~200 files at medium effort
  • Confirm the scan when asked
  • Observe agent count by watching the workflow directory at .claude/projects/<session>/subagents/workflows/<run-id>/ — count agent-*.jsonl files over time
  • Note that after the research phase completes (~25 agents, ~35 min), the verification panel begins spawning 3 verifier agents per candidate finding with no apparent cap
  • With ~20 candidate findings, the panel spawns ~60 additional agents — the workflow does not complete within a reasonable time and must be manually stopped via TaskStop

Key condition: The issue is proportional to the number of candidate findings surfaced by researchers. More findings = more verifier agents = longer unbounded runtime. A codebase with ~15–22 candidate findings at medium effort reliably triggers this.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.195

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

Actual behavior:

95 agents spawned over 2.5 hours, verification panel still running when manually stopped. No indication of progress or estimated completion time visible to the user.

Token cost: ~$12–15 (147k output tokens + ~2.3M cache-read tokens) for an incomplete result.

References: Related to #61405 (no timeout on subagent delegation) and #75314 (background tasks running unboundedly).

Additional issue: The workflow tool bypasses CLAUDE.md agent economy rules. Our project CLAUDE.md explicitly restricts parallel agents to 4. The claude-security:scan workflow ignored this entirely, spawning 95 agents. Plugin workflows should either respect CLAUDE.md constraints or document clearly that they do not.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗