Tired of AI generating unmaintainable code slop? Discover how orchestrating 8 to 12 concurrent Claude and Codex loops with spec-driven development allowed me to ship a multi-month feature in just one week.
If you ask most senior software engineers about AI coding assistants, you will likely encounter a well-earned roll of the eyes. We have all seen the low-quality results: syntactically valid code that quietly breaks repository architecture, introduces subtle race conditions, or spams pull requests with bloated boilerplate. As I discussed in a previous post, the word for AI's worst output is slop. Unchecked LLM generation simply creates technical debt at an unprecedented velocity.
However, over the past few months, I have been refining a completely new way of working. By shifting from ad-hoc prompts to governed, multi-agent workflows, I recently delivered a feature in a single week that previously would have taken months to implement. The secret is not blindly trusting AI with your codebase, but establishing tight governance, spec-driven development, and self-correcting feedback loops.
Controlling Intent: Spec-Driven Development
The primary reason AI workflows fail in production codebases is a lack of intent control. When you give an agent a vague prompt, it fills the missing context with assumptions, leading straight to architectural drift. To prevent this, every feature starts with strict specification and governance before a single line of executable code is generated.
Using tooling like The Foundry, I establish rigid boundaries for the scope, domain rules, and architecture of a task. The rule is absolute: no agent proceeds until I have personally reviewed and approved its execution plan. The human developer's primary job shifts from writing repetitive boilerplate to acting as a high-level systems architect and gatekeeper of intent.
Orchestrating Concurrent Claude and Codex Loops
Once a spec is approved, execution begins across parallel agent routines. By leveraging Claude Code to spawn sub-agents, I routinely manage between 8 and 12 concurrent loops running Anthropic's Claude and OpenAI's Codex models simultaneously.
Instead of relying on one model in isolation, I set up adversarial loops where Claude and Codex actively cross-examine each other's work using a strict test-driven development (TDD) approach:
The Tester Agent: Creates test suites in isolation based solely on the feature specification, ensuring tests are failing (red) prior to implementation.
The Builder Agent: Receives the sub-task specification alongside the failing tests, writing implementation code strictly designed to make the tests pass (green).
The Reviewer Agent: Analyses the proposed changes against repository guidelines, checking for type safety, performance traps, and naming conventions.
This multi-model checks-and-balances system drastically reduces hallucinations. While Codex excels at catching subtle logic and syntax errors, Claude excels at evaluating higher-level architectural consistency.
Self-Correcting Loops: Turning PR Feedback into Persistent Skills
One of the most powerful aspects of this workflow is its ability to learn from code reviews over time. In traditional teams, a senior engineer might leave a PR comment about a specific repository structure or module boundary rule, and the developer must manually remember that feedback forever.
In my setup, PR review comments are systematically appended to a centralised skill definition. This skill runs automatically every time an agent attempts to complete a new task. For example, if a reviewer points out a specific pattern for organising state stores or API modules in our repository, that finding is added to the pre-submission skill checks.
Before any agent presents a finished diff to me, it executes this self-correcting loop to verify its work against every past PR review comment. As a result, the agents almost never make the same repository-specific mistake twice.
The Developer as the Ultimate Gatekeeper
It is important to emphasise that this workflow does not remove the engineer from the loop, nor does it happen in isolation. Crucially, shipping at this pace would be impossible without an exceptional team around me. They provided clear direction on how the feature was planned and handled the organisation of surrounding work, allowing me to stay focused entirely on implementation and coding. In practice, this approach demands even greater technical rigour. My personal checklist for every ticket includes:
Plan Review: Inspect and adjust the specification before execution starts.
Agent Execution: Monitor parallel Claude and Codex loops as they build and cross-review code.
Diff Inspection: Review the raw git diff myself, line by line, to ensure full alignment with our architectural standards.
PR Submission: Submit the verified code for final team review.
Because the agent loops take care of boilerplate generation, static analysis, and initial cross-reviews, I can spend my time deeply understanding the domain problem and verifying the generated code. I am doing more tickets than ever before, yet I have more time to comprehend the underlying software design.
Conclusion: Control the Intent, Change the Workflow
The shift to agentic software engineering is still in its early stages, and refining these skill loops requires constant tuning. However, the takeaway is clear: AI tools only produce slop when developers abandon governance. By controlling intent upfront with clear specifications and forcing agents through automated, self-correcting feedback loops, you can dramatically elevate your engineering velocity without compromising on quality.
