Framing: a solo developer's workflow (2026-11). Claude and Codex are one example pair; the method is vendor-neutral (Kimi, GLM, Qwen, DeepSeek, … work too). Claude: Anthropic has not supported mainland China, Hong Kong or Macau since 2026-11-12, including use while physically there (checked 2026-11-23; Supported Regions).
Situation
- Audience: solo developers and small teams who use AI to write code but won't take "done" from the same agent that wrote it, and want merge/release to stay a human decision.
- When to use: changes beyond a file or two, with design trade-offs, or headed for a release branch.
- When not to use: ~20-line changes with no design/API/protocol/security/dependency impact (use the fast path).
This is steps 4–5 of the seven-step method: "plan → review → human approval → implement → review → human merge" expressed as spec + quality gates + human gates. It is the evaluator-optimizer pattern from Anthropic's "Building effective agents" with a max-round stop condition.
Steps
- Isolate: one worktree and
feat/<slug>branch per feature; agents never editmain. - Plan: the implementer writes
PLAN.mdandTASKS.md, self-reviews, updatesSTATE.md, writesHANDOFF_REQUEST.md. Keep process files in.agents/work/<slug>/, gitignored as a whole directory. Caveat: per Codex's docs its writable sandbox treats.agentsas a protected, read-only path (read 2026-11-23, not re-tested here). If Codex is the implementer, use a directory outside.agents(e.g..work/<slug>/, also gitignored) and change the paths in AGENTS.md; other implementers are unaffected. - Read-only review: run the reviewer read-only in the same worktree (Codex CLI shown; other tools have read-only/plan modes), e.g.
codex exec --sandbox read-only "<review prompt>"orcodex review --uncommitted. Verdict isAPPROVEorCHANGES, issues tagged blocker/major/minor; only blocker/major start another round. A read-only reviewer writes no files: the writable side saves its stdout asHANDOFF_VERDICT.md. - Human gate 1: after the reviewer approves the plan, you approve and write
plan_approved_by: <name>inSTATE.md. Humans only. - Code phase: checkpoint, implement, self-review, then the implementer (or a helper) actually runs tests/build/lint and records who, full command, cwd, revision, time, exit code and log path in the handoff file. Pass = tests green + lint/build green +
APPROVE. - 3-round cap: still blocker/major after 3 rounds → stop, write
ESCALATION.md, and notify by message; a file alone is not a notification. - Human gate 2: push, merge, release, store submission happen only after you read the diff, or with your explicit authorization.
Fast path: ≤ ~20 lines with no design/API/protocol/security/dependency impact may skip plan review (mode: fast-path + reason in STATE.md); stop and switch to the full loop on any design impact.
Templates
- Express the loop as pipeline.yaml:
plan(model) →plan_review(model, read-only) →plan_approval(human) →implement(model) →checks(code: tests/lint, keep exit codes) →code_review(model, read-only) →merge_approval(human). Gates: "test exit code is 0", "verdict is APPROVE", "plan_approved_bycommitted by a human";reliability.timeout_seconds/reliability.max_agent_turnsbound each stage; "max 3 review rounds per phase" is a process rule tracked asround: n/3inSTATE.mdand AGENTS.md — the template has no dedicated field. - Test the reviewer prompt itself with the eval / golden-set checklist: feed 3–5 old diffs with known defects and see whether it catches them. The reviewer is a pipeline step too.
- Scaffolding for these files: see
review-kit-bootstrap.
AGENTS.md snippet, STATE.md and reviewer prompt: see the code blocks in the Chinese section (they are already in English).
Cost and time (order of magnitude, estimate, not reconciled against bills)
- A review call mostly reads the diff and logs, so it usually emits an order of magnitude fewer tokens than the implementation step, but every extra round re-reads everything. The 3-round cap is your cost ceiling.
- No dollar figures here: fill the ROI input table from your own usage logs, and count your own diff-reading time as human review cost.
Failure cases and guards
From a solo developer's use and the PR #14 draft; per-item primary records are still to be added. The scaffold docs carry matching rules for "read-only sandbox can't run tests", "tee swallowing exit codes" and "process files committed"; the rest are common risks the flow already guards against, not itemized incident records.
- Read-only sandbox can't run tests that write to disk: the implementer runs them and attaches command + exit code + log. Only missing or suspicious evidence (stale, truncated, not matching this revision) is
BLOCKED; an unwritable build directory alone is not. teeswallowing the exit code: the log says PASS but the command failed. Record exit codes, not just output.- Asking the read-only reviewer to write the verdict file: it can't; the caller saves stdout.
- An executing agent recording "approved" for the human: forbid it in AGENTS.md; since
STATE.mdis untracked, treat the approval note in your PR comment or commit message as the record and check that it matches thePLAN.mdhash. - A reviewer that "helpfully" fixes things stops being a reviewer; enforce read-only technically.
- Endless ping-pong over minor issues without a round cap.
- Same model reviewing itself shares blind spots; change session at least, model family ideally.
- Process files committed: gitignore the directory;
git ls-files -- .agents/workshould be empty before merge.
China alternatives
china_availability: partial. The method only needs two different models: Kimi Code + GLM Coding Plan, Qwen Code + DeepSeek, or a cloud writer + a local reviewer (seelocal-airecipes).- Claude: see the region note above. Codex: as of 2026-11-23 mainland China is not on OpenAI's supported-countries list (carried over from the PR #14 draft; re-check before relying on it).
- Reaching a service through a proxy from an unsupported region does not make use compliant; this recipe does not teach circumvention.
Safety notes
- Run the reviewer in a read-only sandbox with no secrets and no write-capable network.
- Executors must not push, merge or publish; never commit
.env; scan logs for tokens before pasting them into handoff files. - Unattended runs should use notifications (
hooks-not-polling-notifications) plus human gates, not looser approvals.
Test notes
- 2026-11-23: the companion scaffold
orca-kit-initpasses its 5 automated tests (Python unittest, isolated temp dirs); the loop is used day to day in a solo developer's iOS/Flutter repos, one of which has an adoption branch. The AGENTS.md and prompt templates here are cleaned-up rewrites that were not re-run verbatim. - Tool versions: Codex CLI 0.171.0, Claude Code 2.1.330 (local, 2026-11-23).
- Evidence trail: FIRST_HAND_SEEDS.md.
Verification
- Pick any merged feature: can you reconstruct who approved what and when from PLAN → VERDICT → STATE?
- Does every merge to main have a human approval record?