Skip to content

discipline:sweep-all — wave cap imports the wrong number and the shared concurrent-subagent budget is unmodeled #1623

Description

@kyle-sexton

Summary

Two concurrency facts the sweep-all fan-out depends on are wrong or absent in
plugins/discipline/skills/sweep-all/SKILL.md.

F6 — the wave-cap pointer imports the wrong number

Step 1 says:

Cap concurrency in bounded waves like the -deep siblings

Following that pointer resolves to do-your-research-deep / recheck-against-upstream-deep:
"Cap concurrency to a modest wave (roughly a dozen or fewer)". Two problems:

  • That number is calibrated for cheap fresh-context subagents, not for forks that each inherit
    the full transcript at the parent model. sweep-all's own Gotchas already record ~170K tokens
    per fork on a mid-length session.
  • "Roughly a dozen" exceeds CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY, documented at
    https://code.claude.com/docs/en/env-vars (fetched 2026-07-26) as: "Maximum number of read-only
    tools and subagents that can execute in parallel (default: 10). Higher values increase
    parallelism but consume more resources".

The same pointer also silently skips the -deep siblings' mid-run checkpointing of the partial
ledger, which is part of what makes their fan-out survivable.

F7 — the shared concurrent-subagent budget is unmodeled

Forks are not exempt from the session's concurrency budget. Per
https://code.claude.com/docs/en/sub-agents (fetched 2026-07-26), verbatim:

By default, when 20 subagents are running in a session, spawning another with the Agent tool
fails with Concurrent subagent limit reached, and the error tells Claude not to retry.

and, on the session cap:

Every subagent Claude spawns with the Agent tool counts toward the limit: nested subagents,
forks, and background subagents […]

sweep-all models neither. The audit that produced this finding fired in a session already
holding 10+ spawned members, so the fan-out was competing for a budget it never accounted for.

Proposed fix

  • State the wave cap as an explicit number chosen for forks, not a pointer to a differently
    calibrated sibling, and keep it under the documented default parallelism of 10.
  • Carry over the -deep siblings' partial-ledger checkpointing rather than dropping it by
    omission.
  • Model the shared budget: the sweep's forks share CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS
    (default 20) with everything else running in the session, and count toward
    CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION (default 200).

These land alongside the preflight work because they occupy the same paragraphs.

Source: plugin-quality:audit post-use audit of discipline@0.9.0 (F6, F7 — both MED).

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.priority: mediumReal value, no hard deadline; normal backlog flow.status: readyTriaged, unblocked, and fully specified; eligible to pick up.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions