What it does
four-agent-engineer takes a task typed in everyday language ("add pagination to the grants endpoint") and carries it through to a reviewed, tested commit in the property-technology ecosystem, with a different AI agent responsible for each step and a mechanical check on the agents themselves. It is built on Anthropic's Claude Agent SDK as a standalone command-line tool.
The four agents
- Executive Engineer (Claude Opus). Reads the request and the project, turns it into a precise engineering specification, and directs the other three. It never writes code.
- Implementer (Claude Sonnet). Builds what the specification asks for, test-first, with file reading, editing, writing, search and shell tools, optionally in its own isolated git worktree.
- Gate-Runner (Claude Haiku). Runs the project's quality gate and reports the result word for word, including the exit code.
- Auditor (Claude Opus). Reviews the change with zero context from the Implementer: read-only tools and the diff, nothing else. Every finding must carry five pieces of evidence (file, line, code snippet, description and the rule broken), so a vague complaint cannot pass as a finding.
The quality loop
- The Executive Engineer amplifies the request into a specification, using guidance presets for six kinds of work: feature, bug fix, refactor, test, migration and general. The bug-fix preset, for example, requires a search for the same bug elsewhere in the codebase.
- The Implementer builds it.
- The Gate-Runner runs the gate.
- The Auditor reviews.
- Any finding or failed gate sends the work back for another attempt, up to three, after which the task is escalated to a person.
The quality standard is zero tolerance: any finding is a failure, and an Auditor that crashes or times out counts as a failure too.
The stream processor: a check on the lead agent
The Executive Engineer decides internally whether the work passed. four-agent-engineer does not take its word for it. A stream processor reads every message the agents produce as it happens, picks out each Auditor finding and each "clean" verdict from the helper agents' own output, and reads the gate's exit code from the Gate-Runner's report. It records every attempt with its gate result, findings and token use. If the processor sees findings or a failed gate where the Executive Engineer reports success, the processor wins and the commit does not happen.
Committing safely
- Only the files the Implementer changed are staged, one at a time, never everything in the working tree, so unrelated work is never swept into a commit.
- If staging fails partway, everything is unstaged so the index is never left half-prepared.
- Conventional commit messages are written to a temporary file and committed from it, so no part of the message passes through a shell.
Before it starts
- Preflight checks confirm Node 20 or later, pnpm, authentication, the project's settings and instructions files, and a git repository.
- Project and profile detection work out what kind of project it is in and which stack presets apply.
- Configuration comes from an optional
.engineer.jsonand command-line options, validated against a Zod schema: maximum attempts (one to three), the models for the Implementer and Auditor, the gate command, worktree isolation, a maximum diff size and a maximum budget in dollars.
Sessions
- An interactive prompt accepts tasks, shows the status of past sessions and resumes a session by its ID.
- Session persistence and resume, a progress view, a cost tracker and a clean shutdown on Ctrl-C.
- JSONL session logs of every run.
- SDK wrappers retry failed calls with exponential backoff.
- A public library interface of 52 exports, so other tools can call the orchestrator directly.
What it achieved
- 832 unit tests in 8,978 lines of tests across 42 files, against 3,616 lines of application code in 39 files: two and a half lines of test for every line of code.
- An 80 percent branch-coverage gate that fails the build below it.
- No agent grades its own work. The builder, the gate and the reviewer are different agents, and a non-AI processor checks the lead agent's verdict.
- Built in three days across seven phased specifications.
The problem it solves
When one AI agent writes code and then reports on it, it tends to report success. Reviewers that have watched the code being written inherit its assumptions, and a lead agent that summarizes its helpers' results can summarize a failure away. four-agent-engineer separates every role (specification, building, gating and review), gives the reviewer no context it could be anchored by, demands evidence for every finding, and puts a mechanical reader of the raw output above the lead agent so a disagreement always ends in no commit.
How he built it
Maxwell wrote seven phased specifications, each broken into red, green and gate tasks, and directed AI agents to build them test-first: a failing test, then the code that passes it, then pnpm gate (zero-warning lint, strict type checks and tests with coverage) as the only acceptance check. The code follows strict TypeScript with every strictness flag on, explicit return types, no any, strict boolean expressions and no console.log. The tests follow a 30-rule standard: parameterized cases instead of loops, no control flow inside a test, errors asserted rather than caught, and names that state the outcome and the condition. Review findings became numbered fixes recorded in the code where they apply, such as staging only changed files and keeping the commit message out of the shell. The tool follows the ecosystem's rules too: UUIDv7 identifiers, fail-closed security and trunk-based development.