Agents-Concerto: Orchestrating Claude Code for PRs
Blindly signing off on agent-generated PRs is a recipe for technical debt. I noticed a recurring pattern in our workflow: an agent would dump a massive set of changes, validate them itself, congratulate itself, and leave the human reviewer guessing why specific lines were touched. Worse, the "green" tests were often useless—mocking the very code they were supposed to test or asserting on private fields.
To fix this, I built agents-concerto. It isn't a standalone app, but an orchestration layer for Claude Code. Think of it as a conductor and a set of players; the conductor manages the flow but never touches an instrument, ensuring the final merge always stays in human hands.
The system relies on a strict set of constraints to maintain quality:
- Two-party authority: No agent that writes code is allowed to approve or merge it.
- Worktree isolation: Every agent operates in its own git worktree to avoid messing up the local checkout.
- No auto-merge: The process stops exactly at "PR ready."
- Model by complexity: The model isn't tied to a role; it's picked based on the complexity tier of the task.
The Logic of Acceptance Criteria
The biggest shift in my AI workflow was treating acceptance criteria as test specs rather than human notes. Using a Given-When-Then format (Given X, when Y, then Z), the system ensures that every requirement has an observable result.
This criterion travels through the pipeline: it's defined during the shaping phase, converted into a test during implementation, and verified by the reviewer. Because the "then" must be observable, it prevents the AI from cheating by asserting on internal state.
The Agent Pipeline
I've divided the labor across four distinct roles:
- Orchestrator (Opus): Handles decomposition and dispatching. It is strictly forbidden from writing application code.
- Classifier (Sonnet): A read-only agent that assigns a complexity tier (
complexvsstandard) to determine which model handles the task. - Implementer: This agent uses a "Tidy First" approach—it submits a structural refactor commit first, then a separate behavioral commit. It never mixes the two.
- Reviewer (Opus): Limited to
Read,Grep,Glob, andBash. It has noWriteorEditpermissions, meaning it can describe a fix but cannot apply it.
# Example of the lightweight orchestration structure
# CLAUDE.md (Instruction set)
# agents/ (Markdown definitions for the 4 roles)
# scripts/ (Bash wrappers for execution)
For those looking for a real-world LLM agent deployment, the full logic is available here:https://github.com/moruno21/agents-concerto
All Replies (3)
This almost killed my prod build over one missed dependency. Which version of Claude Code are you using?
This saves so much time! Which specific edge cases are you checking for in your PRs?
Can this actually handle merge conflicts automatically or is manual intervention still required?