Stop Letting the Same Agent Review Its Own Code: Mission Control Orchestrates a Second CLI and Freezes Uncommitted Changes
Don't Let the Same Agent That Writes Code Also Do the Review: I Built a Local Cross-Agent Review Tool
When I use AI Coding CLIs (Claude Code, Codex, OpenCode, etc.) for daily coding, I repeatedly run into three problems:
- Same-model review blind spot: An agent that just finished writing a patch, when asked to review it, tends to follow its own recent context and excuse itself.
- Multi-round reviews lose track: After fixing the first round of issues and running a second round, if the model doesn't mention an old issue again, you can't tell whether it's truly fixed or just happened to miss it this time.
- Local uncommitted changes are hard to review consistently:
git diffcan't see untracked files,git diff --cachedcan't see unstaged changes; if you edit while reviewing, the patch and the disk file might not even be the same version.
To solve these pain points, I wrote a local-first open-source tool Mission Control (CLI command amc, MIT license), just released v0.1.0 to PyPI, and also packaged it as a standard Agent Skill.
It does not call models itself, and does not ask for additional API keys. Instead, it orchestrates a second Coding Agent CLI already installed on your machine (e.g., after Claude Code writes, automatically invokes Codex for cross-review), freezes uncommitted changes into a snapshot for isolated review, and tracks each issue across multiple rounds of fixes.
Below I share two core engineering designs, and a few real bugs it caught on my own project's PRs.
1. Why can't we just throw git diff at the model?
The easiest approach is to concatenate git diff and git diff --cached and stuff them into the prompt. But that has two hard problems:
- If the same file is first
git added as version A, then further modified to version B, concatenating the two diffs creates an intermediate state that never actually existed; - The Agent CLI will open files in the workspace itself. If the patch describes time T0, it reads the on-disk file at T1, causing line numbers and context to drift.
Mission Control's approach is to freeze the current workspace into a real Git snapshot commit with zero intrusion:
- Create a temporary file as the subprocess's
GIT_INDEX_FILE, and copy the repository's real index there; - After excluding the framework's own runtime directories, on the temporary index run
git add -A->git write-tree->git commit-tree(with parent set to currentHEAD), generating a detachedsnapshot_sha; - Check out an isolated
git worktreefromsnapshot_sha, and generate a unified patch withmerge-base(base, HEAD)..snapshot_sha.
The whole process does not touch the user's real index, workspace files, or HEAD, while guaranteeing that the "patch in the prompt" and the "source code the agent reads in the worktree" strictly point to the same commit.
2. Cross-round tracking: not mentioning it in round two doesn't mean it's fixed
The easiest pitfall in multi-round reviews is treating "the model didn't report this issue this round" as fixed.
Mission Control maintains a cross-round Finding state machine using SQLite:
- New: newly discovered issue this round;
- Persistent: existed in the previous round and still detected this round (supports merging across agents/languages, tracking even if file renamed or line numbers shift);
- Unverified: reported in the previous round, not mentioned this round, but the code at that location did not change between the two snapshots — never automatically marked as fixed;
- Likely fixed: reported in the previous round, not mentioned this round, and the real diff between the two snapshots did modify the corresponding code lines;
- Resolved / Dismissed: only the developer can manually confirm; the system never auto-closes anything.
3. Real results: caught 4 P1s in its own PR #35
While developing the project's own PR #35 (refactoring the local web workbench), I used a second agent for cross-review and intercepted 4 real P1 defects before merging:
| Category | Real issue caught before merge | Fix approach |
|---|---|---|
| Concurrency race | DELETE /api/tasks/{id} released the lock after checking active status, racing with concurrent start_task and the background ValidationService |
Unified mutual-exclusion placeholder by task ID (shared by start, validation, delete) and added blocking concurrency tests |
| Git security | Repository pre-check executed git status, which could trigger the core.fsmonitor external command configured on the target repo and write to the index lock |
Forced --no-optional-locks, explicitly disabled core.fsmonitor, core.hooksPath, diff.external, and LFS filters |
| Windows security | Whitelisted editor name code resolves to code.cmd on Windows, causing cmd.exe to misparse file paths from the repo |
On Windows require absolute paths to native .exe, use open -t on macOS, and shell=False across all platforms |
| Status honesty | The progress bar labeled all backends as "read-only sandbox", but only Codex actually passed --sandbox read-only |
Only show sandbox badge for Codex; other backends are honestly labeled as PATH guards |
4. Quick start (now on PyPI and skills.sh)
The only prerequisite is having at least one supported CLI installed locally (Codex / Claude Code / OpenCode / Copilot); model permissions and quotas are entirely your existing CLI's.
Method 1: Embed as an Agent Skill into Claude Code / Codex / Cursor (most convenient)
npx skills add robll-v1/mission-control -g
After installing, before git push, simply tell your coding agent:
Use mission-control to cross-review my current uncommitted changes, fix confirmed issues, then run a second review round.
The built-in Skill automatically avoids the current host, picks another local CLI for review, and returns structured JSON results.
Method 2: Run CLI or local web workbench with zero cloning (no Node.js needed)
Frontend static assets are directly bundled into the Python wheel, no extra Node environment needed:
# Terminal review of uncommitted changes (structured JSON + CI exit code)
uvx --from agent-mission-control amc review --backend codex --reasoning high --format json --exit-code
# Start local web workbench (default listens on 127.0.0.1, stop with amc stop)
uvx --from agent-mission-control amc start
For persistent installation:
pipx install agent-mission-control
# or: pip install agent-mission-control
amc doctor # static probe without calling models, checks installed CLIs and reasoning levels
5. Current limitations
Just released v0.1.0, a few limitations to note upfront:
- Not a full sandbox: only the Codex CLI natively has
--sandbox read-only; other backends use PATH guards (prevent misoperation, not a substitute for container isolation). - Not offline or free inference: the framework charges no extra fees, but underneath it still consumes your local Agent CLIs' own subscriptions or API quotas.
- Does not include submodule uncommitted changes: the local snapshot only covers the parent repository workspace.
Project links
- GitHub: https://github.com/robll-v1/mission-control
- PyPI: https://pypi.org/project/agent-mission-control/
If you also use more than two Coding Agents in your daily work, I'm curious how you control quality before git push? Do you prefer embedding as a Skill for automatic triggering, or running a standalone CLI / viewing a web UI? Feel free to critique and file issues.
Top 1 from juejin.cn, machine-translated. The original thread is authoritative.
Strongly agree that 'same-model self-review will just talk itself out of it using the context from a moment ago.' Our approach also splits review and code-writing into two Agents, but I add one more condition: the review input must be a frozen patch plus a list of untracked files, not just git diff. Otherwise you end up reviewing the previous version. How does your amc handle new files that aren't committed yet?