← Reddit

Combining /loop + Agent Teams + --max-turns — sharing what's worked (Claude Code 4.7)

Reddit · issuntrix · April 30, 2026
A Claude Code 4.7 user demonstrated that combining Real Agent Teams with verification judges, the /loop command for monitoring, and increased --max-turns parameters produces superior research output compared to single-session work. The technique involves spawning research-lead teammates with judges who iteratively verify deliverables, using /loop to oversee progress without consuming context, and setting --max-turns to 350-500 minimum to prevent teams from prematurely shutting down. Critical implementation details include using the exact phrase "Create an agent team to..." in task briefs and having a synthesizing orchestrator complete work after judges approve each deliverable slice.

Detailed Analysis

A power user on the r/Anthropic community has published a detailed operational account of combining three Claude Code features — experimental Agent Teams, the `/loop` slash command, and tuned `--max-turns` parameters — to produce research and analytical output that, by their assessment, surpasses what a single Claude session can achieve even with Claude 4.7. The author, operating on a Max x20 subscription with multiple long-context parallel sessions, describes a workflow in which a lead agent spawns a team of specialized researchers alongside integrity and sanity judges, with the judges assigned concrete verification tasks rather than vague oversight roles. The `/loop` command then monitors dispatched teams in a self-paced fashion, surfacing only milestone-relevant signals to the orchestrator's context window rather than flooding it with routine progress updates, while the author synthesizes final deliverables themselves using cross-team visibility that the lead agent structurally lacks.

Several of the post's most valuable contributions are its documented failure modes and workarounds, which expose subtle but consequential behaviors in the current Claude Code agent framework. The most significant finding concerns `--max-turns`: the default value causes lead agents to exhaust roughly 30 turns on team setup alone, after which the model misreads session-mode metadata as an impending forced shutdown signal and preemptively issues `shutdown_request` to its specialist subagents — terminating work that the harness itself never requested. The author's fix, setting `--max-turns` to a minimum of 350 for engagement-gated dispatches and 500 for deep audits, prevents this cascading premature termination. A second structural issue — a consistent hang at the synthesis-transition stage after all task gates clear — led the author to permanently remove synthesis from the lead's responsibilities, a workaround that inadvertently produced better output by concentrating synthesis in the orchestrator where cross-team context is actually available.

These findings align closely with the broader capabilities and known rough edges of Claude Opus 4.7, which shipped on April 16, 2026, and introduced formal task budget controls, loop resistance to prevent indefinite cycling, and improved role fidelity for subagents. Anthropic's own documentation and third-party analyses confirm that the model's agentic performance — including a reported 3x improvement on SWE-Bench task resolution relative to 4.7's predecessor — is most reliably unlocked through explicit planning documents specifying scope, file targets, success criteria, and role assignments before dispatching agent teams. The author's gate-iteration pattern, in which a judge returns a PARTIAL verdict, the lead corrects the relevant deliverable slice, and the judge re-verifies before issuing SUPPORT, mirrors the multi-pass review architecture that Anthropic recommends via `/ultrareview` and task budget pairing, and operationalizes it at the team coordination layer rather than within a single agent's context.

The post also surfaces a practical gap between Claude Code's documented protocol and its actual implementation: the shutdown handshake uses `shutdown_approved` as the terminal message type, not `shutdown_response` as some community scripts assume, causing cleanup scripts that grep for the wrong string to block indefinitely. The author's advice — instruct the lead to write a `[TEAM-RESULT]` marker to stdout before calling `TeamDelete`, then kill and clean manually if needed — reflects a pragmatic engineering posture toward experimental tooling where protocol documentation lags implementation. The parallel use of `tmux`, piped stdout logging, and `jq` queries against mailbox JSON files to monitor agent state without relying on Claude Code's rich TUI further illustrates the operational complexity currently required to run stable, observable multi-agent pipelines in production-adjacent workloads.

Taken together, the post represents one of the more granular practitioner accounts yet published of Claude Code's experimental agent orchestration layer, and its value lies less in endorsing a particular configuration than in mapping the precise failure boundaries of the current system. As Anthropic continues maturing the Agent Teams feature from experimental status, the failure modes documented here — misread shutdown signals, synthesis-stage hangs, silent fallback to one-shot Task dispatch when magic phrasing is absent — represent concrete regression targets for the framework's reliability. The broader trend the post reflects is the growing demand among advanced users for persistent, verifiable, multi-agent pipelines that can operate autonomously over extended time horizons, a demand that Claude 4.7's architectural improvements have partially addressed but that the tooling infrastructure surrounding Claude Code has not yet fully stabilized to support.

Read original article →