跪拜 Guibai
← All articles
GitHub

Stop Letting the Same Agent Review Its Own Code: Mission Control Orchestrates a Second CLI and Freezes Uncommitted Changes

By robllv1 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

This fixes a concrete reliability gap in AI-assisted coding: a single agent tends to rubber-stamp its own output, and diff-based review is unreliable when files change during the review. Cross-agent review with snapshot isolation catches real bugs before push, and since it rides on CLIs you already pay for, the marginal cost is near zero.

Summary

Mission Control (command `amc`, MIT license) targets three pain points in AI-assisted coding: same-model review blind spots, losing track of issues across review rounds, and inconsistent reviews of uncommitted local changes. The tool does not call models itself or require extra API keys. Instead, it spots a second coding agent CLI already installed on your machine (for example, after Claude Code writes code, Codex is invoked for review) and freezes the current uncommitted changes into a real Git snapshot commit.

The snapshot mechanism avoids the pitfalls of simply concatenating `git diff` and `git diff --cached`. It uses a temporary `GIT_INDEX_FILE`, `git write-tree`, and `git commit-tree` to generate a detached commit, then checks out an isolated `git worktree` so the patch shown to the reviewer and the source code the agent reads are guaranteed to be from the same commit. A SQLite-backed finding state machine tracks issues across rounds: `New`, `Persistent`, `Unverified` (not mentioned this round but code unchanged, so not auto-marked fixed), `Likely fixed` (code lines changed between snapshots), and `Resolved`/`Dismissed` which only the developer can set.

In its own PR #35, cross-review with a second agent caught four P1 defects before merge: a concurrency race in task deletion, a Git security issue around `core.fsmonitor`, a Windows-specific path resolution issue, and a misleading progress bar that claimed every backend was a read-only sandbox. The tool is available as an Agent Skill via `npx skills add robll-v1/mission-control -g` or as a Python package via `uvx --from agent-mission-control amc`. Known limitations: it is not a full sandbox (only Codex passes `--sandbox read-only`), it consumes your existing CLI subscriptions/quotas, and it does not cover submodule uncommitted changes.

Takeaways
— Mission Control (`amc`) is a local-first, open-source (MIT) tool that orchestrates a second coding agent CLI (e.g., Codex) to review changes written by another (e.g., Claude Code), without calling models or requiring extra API keys.
— To avoid inconsistent diffs, it freezes uncommitted changes into a real Git snapshot using a temporary GIT_INDEX_FILE, git write-tree, git commit-tree, and an isolated worktree, so the review prompt and the agent's file reads refer to the same commit.
— A SQLite-backed state machine tracks findings across rounds: New, Persistent, Unverified (code unchanged so not auto-fixed), Likely fixed (code lines actually changed), and Resolved/Dismissed (only developer can mark these).
— In its own PR #35, the tool caught four P1 bugs before merge: a concurrency race in task deletion, a Git security issue via core.fsmonitor, Windows path resolution causing cmd.exe misparse, and a progress bar that falsely labeled all backends as read-only sandboxes.
— Install as an Agent Skill via `npx skills add robll-v1/mission-control -g`, or run as a CLI/web workbench via `uvx --from agent-mission-control amc` (Python wheel bundles frontend assets, no Node needed).
— Limitations: only Codex CLI natively supports `--sandbox read-only`; other backends use PATH guards, not container isolation; it consumes your existing CLI subscriptions/quotas; and it does not include uncommitted submodule changes.
Conclusions

Using a different model for review exploits the diversity of independent fallible systems; the same model tends to follow its own prior reasoning, so a second, independent CLI provides a genuine second opinion rather than a rubber stamp.

The finding state machine's decision to never auto-close an issue without a real diff change is a sound engineering choice: it forces the developer to confirm fixes, preventing silent regressions when a model simply misses a previously reported problem.

The tool's design of not being a full sandbox (only Codex has native read-only) is an honest tradeoff; PATH guards prevent accidental edits but cannot defend against malicious or misbehaving agents, so it is a guardrail, not a security boundary.

Concepts & terms
Cross-agent review
A code review workflow where a different AI coding agent (e.g., Codex) reviews changes produced by another agent (e.g., Claude Code), rather than having the same model review its own output. The diversity reduces the chance the reviewer inherits the writer's assumptions.
Snapshot isolation
The practice of freezing the current uncommitted workspace into a real Git commit (via temporary index and a detached commit) and checking out a separate worktree, so that a review agent's view of the code exactly matches the patch being reviewed, without touching the user's actual staging area or HEAD.
From the discussion
Featured comments
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?

See top comments, translated →
Source: juejin.cn ↗ Google Translate ↗ Backup ↗