The Tech ArchiveThe Tech ArchiveThe Tech Archive
Small BusinessMarketingDevelopers
ArticlesTopicsSeriesAbout

Get the practical AI brief

Verified, no-hype AI tips you can actually use - in your inbox. Free.

No spam. We verify what we send. Unsubscribe anytime.

The Tech ArchiveThe Tech Archive

The Tech Archive

AI news, analysis & explainers

AboutSmall BusinessMarketingDevelopersArticlesTopicsSeriesMethodologyAI DisclosureCorrections

© 2026 All rights reserved.

Back to home
0 readers reading
  1. Home
  2. Articles
  3. Artificial Intelligence
  4. The Gauntlet Loop: How to Use Claude Opus 5 Sub-Agents to Build Complex Software on a Single Prompt

Contents

The Gauntlet Loop: How to Use Claude Opus 5 Sub-Agents to Build Complex Software on a Single Prompt
Artificial Intelligence

The Gauntlet Loop: How to Use Claude Opus 5 Sub-Agents to Build Complex Software on a Single Prompt

The Gauntlet Loop method uses Claude Opus 5 sub-agents and a harsh critic loop to turn one short prompt into 55,000 lines of working software. Here is how it works and what it costs.

Sham

Sham

AI Engineer & Founder, The Tech Archive

16 min read
1 views
August 4, 2026

A three-paragraph prompt produced 55,000 lines of working code — a browser-based first-person shooter with procedural textures, physics, and audio, all written by a fleet of AI sub-agents. The method behind it, called the Gauntlet Loop, does not rely on clever prompt language. It relies on a structural trick: an independent critic agent that compares your output against a real reference, rejects it, and sends it back — over and over until the result clears the bar or you stop the run.

The approach is general-purpose. It works for games, but it also works for product design, marketing pages, code refactors, and any deliverable where you can define what "good" looks like. The cost is real — a single Gauntlet Loop run can consume over a billion tokens and burn through your entire Claude subscription. But the technique is repeatable, and understanding how it works will change how you think about delegating complex work to AI.

Last verified: 2026-08-04 — Claude Opus 5 API pricing: $5/$25 per million input/output tokens (Anthropic). Claude of Duty repo: ~55k lines, 11 subsystems, MIT license (GitHub). Critic scores peaked at 5.05/10 against real Call of Duty footage.


How the Gauntlet Loop Works

The Gauntlet Loop is an adversarial iteration pattern for AI coding agents. Instead of asking an AI to "make something good" and accepting whatever it returns, you give it a concrete quality bar and a separate critic agent that grades the output against that bar. The builder agent and the critic agent never share context — the critic sees only the output, not the builder's reasoning, excuses, or effort estimates.

The core cycle has four steps:

  1. The lead agent decomposes the goal into the smallest pieces that can be built and judged independently — for a game, that might mean the weapon model, the lighting system, the enemy AI, and the audio engine each get their own workstream.
  2. A builder agent creates each piece in its own isolated context window, so it cannot inherit the lead agent's assumptions or biases.
  3. A separate critic agent inspects the output and compares it directly against a reference — using a blind side-by-side comparison when possible. If the reference wins, the critic identifies the biggest remaining gap and sends the work back.
  4. The builder fixes the gap. The cycle repeats until the critic can no longer distinguish the output from the reference, or you stop the run manually.

The key insight is not "use more agents." More agents can create more noise at impressive speed. The key insight is separating ownership from judgment — the builder cannot grade its own homework because the critic has a fresh context window and a real-world reference to compare against.


What Did the Gauntlet Loop Actually Produce?

What is the Claude of Duty project?

Claude of Duty is an open-source repository on GitHub (github.com/mshumer/Claude-of-Duty) containing a browser-based first-person shooter built by Claude Opus 5 from a single prompt. The game runs on Three.js r180 and WebGL2 with no external art assets — every texture, mesh, animation, and sound is generated procedurally from code at load time. The repository contains roughly 55,000 lines of code across 11 subsystems, including a custom physics engine (binned-SAH BVH with swept-capsule character controller), HDR rendering pipeline with cascaded shadow maps and PCSS contact hardening, procedural weapon geometry with ballistic physics, and skinned enemy soldiers with navmesh pathing.

The entire prompt that produced this repository was published on GitHub and runs three short paragraphs. In full: it told Opus 5 to build a first-person shooter at the level of recent Call of Duty games, to fan out sub-agents for individual pieces, and to loop each piece through a separate harsh critic comparing it blind against real Call of Duty footage until it looked "utterly perfect." The prompt is 152 words long.

Did the output actually match Call of Duty?

No. The repository's own "Honest assessment" section is explicit: the game does not match a modern Call of Duty. Eleven independent critic agents scored the output against real Call of Duty screenshots across multiple rounds. The scores climbed from 3.59 out of 10 in the first round to 5.05 out of 10 by the final round — meaningful improvement, but still "AMATEUR" on most frames. In blind A/B comparisons, every critic in every round picked the real Call of Duty frame.

The repo identifies specific shortcomings: blocky hands that do not convincingly grip weapons, surfaces that read as procedural noise rather than photographed reality at close range, enemies that look like mannequins at distance, and a frame rate of 28-30 fps at Retina resolution after optimization. This honesty is what makes the project valuable as a case study — it shows both what multi-agent AI can produce and where it falls short.

How much did it cost to run?

The creator, Matt Shumer, did not disclose exact token counts or dollar costs for the original run. However, independent replications provide concrete cost data. One developer ran a Gauntlet Loop to build a Formula 1-style game by modifying the Call of Duty prompt target. That run consumed 1.7 billion tokens across 137 agents over 19 hours, reaching an estimated $1,200 in API usage before the developer stopped it manually.

At Claude Opus 5's standard API pricing of $5 per million input tokens and $25 per million output tokens (Anthropic), a run of that scale is plausible. The Claude Max subscription (starting at $100/month for 5x Pro usage) would be exhausted well before completion — this is API-territory work, not subscription work.


How to Run Your Own Gauntlet Loop

What do you need to run a Gauntlet Loop?

You need three things: a capable agentic coding harness, a strong reference for what "good" looks like, and a tolerance for significant API spend. Specifically:

  • Claude Code with Opus 5 — the method depends on sub-agents running in isolated context windows, which Claude Code supports natively. A standard Claude chat window will not work because it cannot spawn sub-agents or loop autonomously. Codex is a viable alternative for backend work but is weaker at visual creation.
  • A real-world reference — a screenshot, a working product, a benchmark, or any concrete artifact the critic agent can inspect and compare against. "Make it look professional" is not a bar. "Make it match this screenshot of Stripe's pricing page" is.
  • The /loop and ultracode settings — /loop is Claude Code's built-in skill for repeating fix-test-adjust cycles. Ultracode (activated via /effort then selecting "ultracode") lets the model write its own orchestration plan and fan work across sub-agents autonomously, capped at 1,000 agents per run.

Step-by-step: Running a Gauntlet Loop

  1. Choose your goal. Pick something where the output can be inspected visually or measured against a reference. Games, landing pages, product UIs, and render-quality comparisons work well. Three-line bug fixes do not.

  2. Find your bar. Identify the strongest concrete reference the agent can compare its output against. For a game, use screenshots of the game you want to match. For a product polish pass, use screenshots of the best competitor's interface. If you cannot find one, instruct the agent to find its own reference and justify it.

  3. Write a minimal prompt. Describe the goal and the bar, but do not prescribe the architecture. The original Claude of Duty prompt did not list the 11 subsystems or describe how the renderer should work — it said "build a shooter at AAA quality, compare it blind against real Call of Duty, and keep looping until it's perfect." The model decides the decomposition.

  4. Activate ultracode. In Claude Code, type /effort and select "ultracode." This tells the model it can write its own orchestration plan and spawn sub-agents. Without it, the model will produce one result and stop.

  5. Walk away. The entire point of the Gauntlet Loop is that you do not steer the agent. Let it run for hours. Check the progress page or screenshots periodically, but resist the urge to intervene. The model needs time to decompose, build, critique, and iterate.

  6. Stop when the returns plateau. The developer who ran the F1 game variant reported that Claude itself told them the scores would plateau in the 70s out of 100 — the 90+ target ("indistinguishable from the original game") was not realistic. Knowing when to stop is a human judgment call. The critic scores will tell you when you are hitting diminishing returns.

What is the meta-prompt version?

Matt Shumer published a meta-prompt — a prompt you give to an AI to generate the final Gauntlet Loop prompt for you. You paste your goal and any optional references, and the model produces a minimal prompt in the style of the original Claude of Duty prompt. The meta-prompt instructs the model to choose the strongest concrete bar, write a short prompt for Claude Code or Codex, give the lead agent the goal and bar but let it choose the approach, and tell it to divide the goal into the smallest independently improvable pieces.

This is useful when you are not sure how to phrase the bar yourself. The meta-prompt is published in full at somethingbig.ai/gauntlet-loop.


What the Agents Built That Nobody Asked For

The agents created their own tools

One of the most remarkable findings from the Claude of Duty project is that the AI agents built a custom harness — without being told to. The repository includes six tools the agents created autonomously:

Tool Purpose
capture.mjs Screenshot a single named shot via GPU-backed headless Chromium
shotset.mjs Capture all 11 subsystem shots in one fast review session
baseline.mjs Reproducible capture: each shot in an isolated page, fixed frame budget, bit-identical across runs
imagediff.mjs Per-pixel gate: exits non-zero if any pixel moved between versions
profile.mjs Gameplay profiler reporting p50/p95/p99 frame times with hitch attribution
playtest.mjs Scripted movement and fire smoke test

The agents also created 136 single-purpose tools for tasks like road material A/B testing between runs and scripted driving sequences. This is not a model following instructions — it is a model recognizing what it needs to evaluate its own work and then building the infrastructure to do so.

Two findings that invalidated earlier measurements

The repository's documentation records two honest discoveries that changed how the project measured quality:

Median frame time hid the real problem. A static-camera benchmark reported 94 fps while the game was actually unplayable. Real gameplay at Retina resolution ran 12-17 fps with 728-1,236 ms stalls caused by 34+ WebGL programs compiling lazily mid-frame. The profiler tool the agents built surfaced this by reporting p50, p95, and p99 frame times separately.

Screenshots were not reproducible. The initial screenshot tool reused one page across all 11 shots, so particle age, decal buffers, and exposure state leaked forward — two identical runs differed on 10 of 11 shots. The agents built a new tool that isolated each shot in a fresh page, producing bit-identical captures that made regression detection possible.


What the Gauntlet Loop Costs in Practice

How much does a Gauntlet Loop run cost?

Metric Value Source
Opus 5 API input price $5 / million tokens Anthropic pricing
Opus 5 API output price $25 / million tokens Anthropic pricing
Reported token usage (F1 game run) 1.7 billion tokens Developer report
Reported dollar cost (F1 game run) ~$1,200 Developer report
Run duration 19 hours Developer report
Agent count 137 agents Developer report
Claude Max subscription (5x) From $100/month Anthropic pricing
Claude Code lines produced (original) ~55,000 lines GitHub repo

A Gauntlet Loop is not a casual experiment. At $1,200 per run, it is a committed investment in a single deliverable. A Claude Max subscription will not cover it — the usage caps are too low. You need API credits and a budget tracked from the start. The Claude Code CLI does not surface real-time spend, so set a hard cap on agent count and rounds before you begin.

Is it worth the cost?

That depends on what you are building. If you need a prototype or a proof-of-concept that you can show investors, play for 10 minutes, or use as a design exploration, the method produces genuinely impressive output — far beyond what most people get from a single prompt. But if you need shipping software, the honest assessment in the Claude of Duty repo is sobering: the output scored 5.05/10 against its reference, lost every blind A/B comparison, and the creator describes what they got as "slop games that you'll probably only play for 15 minutes and throw them away."

The value is not in the artifact. It is in the method. The Gauntlet Loop demonstrates a prompting pattern — adversarial iteration with independent critics — that scales beyond games to any domain where output can be inspected against a reference.


What This Means for You

If you build software, design products, or create visual content with AI, the Gauntlet Loop changes your workflow in three ways:

Stop prescribing implementation. The most effective prompts describe the destination, not the route. The Claude of Duty prompt did not list 11 subsystems or describe how the renderer should work. It said "build a shooter at AAA quality" and let the model decide how. If you are writing detailed architecture specs in your prompts, you are replacing the model's judgment with your own — and the model is often better at decomposition than you are.

Use independent critics. The single most important architectural decision in the Gauntlet Loop is that the critic agent has a fresh context window. It cannot see the builder's reasoning, effort, or intent. It sees only the output and the reference. This prevents the most common AI failure mode: the model convincing itself its own work is good enough. If you are building multi-agent workflows, separating the builder from the judge is the pattern that matters most.

Accept that quality scales with spend. The Gauntlet Loop is not a cheap trick. It is a brute-force quality escalator that works by spending more tokens than anyone else would. The developer who spent $1,200 on an F1 game got a result that looks impressive for AI-generated work — but it still scored 67.3/100 and the model itself said it would plateau in the 70s. Understanding the cost-quality tradeoff is essential before you commit.

For practical guidance on making Claude Code agents retain context across sessions — which matters when a Gauntlet Loop runs for 19 hours — see our Claude Code agent memory guide. And if you are exploring how self-improving agent systems work more broadly, the Gauntlet Loop is one of the most concrete examples of that pattern in the wild.


FAQ

Q: What is the Gauntlet Loop? A: The Gauntlet Loop is a prompting method where a lead AI agent decomposes a goal into small pieces, assigns each piece to a builder agent, and routes every piece through a separate critic agent that compares the output against a real-world reference. The work loops between builder and critic until the critic can no longer distinguish the output from the reference, or the human stops the run.

Q: Can I run a Gauntlet Loop with a Claude subscription? A: Probably not for a serious run. The original Claude of Duty project and independent replications consumed billions of tokens. A Claude Max subscription (starting at $100/month for 5x Pro usage) has usage caps that would be exhausted well before a full Gauntlet Loop completes. You need API credits budgeted for the run.

Q: Does the Gauntlet Loop only work for games? A: No. The method works for any output that can be inspected and compared against a reference — product UIs, marketing pages, code refactors, design systems. The creator published a meta-prompt that adapts the pattern to any goal by having the model choose its own quality bar.

Q: Did the AI-generated game actually match Call of Duty? A: No. The repository's own documentation states the game scores 5.05 out of 10 against real Call of Duty footage, with every blind A/B comparison won by the real game. The output is impressive for AI-generated work but not competitive with a professionally produced AAA game.

Q: What is ultracode in Claude Code? A: Ultracode is a Claude Code setting (activated via /effort then selecting "ultracode") that lets the model write its own orchestration plan and fan work across sub-agents autonomously, with a cap of 1,000 agents per run. It is different from a reasoning effort level — it enables dynamic multi-agent workflows.

Q: How is the Gauntlet Loop different from regular prompt engineering? A: Regular prompt engineering asks a model to produce a result and accepts it. The Gauntlet Loop gives the model a reference bar, then routes the output through an independent critic that can reject it and send it back. The structural difference — a separate agent with fresh context doing the grading — is what prevents the model from stopping at "pretty good for AI."


Sources
  • Claude of Duty GitHub repository — github.com/mshumer/Claude-of-Duty (MIT license, ~55k lines, 11 subsystems)
  • Original prompt (full text) — github.com/mshumer/Claude-of-Duty/blob/main/prompt.md
  • Gauntlet Loop method writeup by Matt Shumer — somethingbig.ai/gauntlet-loop (July 27, 2026)
  • Claude Opus 5 API pricing — anthropic.com/pricing ($5/$25 per million input/output tokens)
  • Claude Opus 5 model specifications — llmreference.com (released 2026-07-24, 1M context window)

Updates & Corrections
  • 2026-08-04 — Initial publication. All facts verified against primary sources on this date. Pricing and model details are volatile and should be re-checked monthly per our re-verification cadence.

Get the practical AI brief

Verified, no-hype AI tips you can actually use - in your inbox. Free.

No spam. We verify what we send. Unsubscribe anytime.

Tags

#"multi-agent"#["AI agents"#["Claude Opus 5"#"Claude Code"#"prompt engineering"]#gauntlet-loop

Discussion

0 comments
Sham

Sham

AI Engineer & Founder, The Tech Archive

AI engineer (Azure AI-102/AI-900). Writes practical, tested, hype-free guides on using AI for real work and small business at The Tech Archive.

Related Articles

View all
How to Run a Fleet of AI Coding Agents for Free With Orca in 2026 (Parallel Worktrees, Compared)
Artificial Intelligence

How to Run a Fleet of AI Coding Agents for Free With Orca in 2026 (Parallel Worktrees, Compared)

17 min
How to Build an AI Job Search Agent With Claude Code in 2026 (The 29K-Star Open-Source Framework, Explained)
Artificial Intelligence

How to Build an AI Job Search Agent With Claude Code in 2026 (The 29K-Star Open-Source Framework, Explained)

18 min
Hermes Agent v0.20 (2026): The Open-Source AI Release That Merges Voice, Multi-Agent Protocols, and Cited Research
Artificial Intelligence

Hermes Agent v0.20 (2026): The Open-Source AI Release That Merges Voice, Multi-Agent Protocols, and Cited Research

15 min
How to Build a Multi-Model AI Coding Workstation in 2026 (System Over Model)
Artificial Intelligence

How to Build a Multi-Model AI Coding Workstation in 2026 (System Over Model)

19 min
OLIX Photonic AI Chips: Inside the $312M Bet on HBM-Free Inference
Artificial Intelligence

OLIX Photonic AI Chips: Inside the $312M Bet on HBM-Free Inference

8 min
Google Gemini 2026 Updates: The 5 Changes That Turn AI Chat Into an Agentic Workbench
Artificial Intelligence

Google Gemini 2026 Updates: The 5 Changes That Turn AI Chat Into an Agentic Workbench

15 min