跪拜 Guibai
← Back to the summary

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:

  1. 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.
  2. 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.
  3. Local uncommitted changes are hard to review consistently: git diff can't see untracked files, git diff --cached can'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.

Mission Control workflow: write code, second local CLI isolated cross-review, track issue states across rounds

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:

Mission Control's approach is to freeze the current workspace into a real Git snapshot commit with zero intrusion:

  1. Create a temporary file as the subprocess's GIT_INDEX_FILE, and copy the repository's real index there;
  2. 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 current HEAD), generating a detached snapshot_sha;
  3. Check out an isolated git worktree from snapshot_sha, and generate a unified patch with merge-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:


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

Mission Control local web workbench preview


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:


Project links

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.

Comments

Top 1 from juejin.cn, machine-translated. The original thread is authoritative.

badhope

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?