code-review-loop
Code Review Loop
One script owns the loop. Do not re-implement it with ad hoc claude or codex calls, and never edit state.sqlite.
REVIEW="<skill-dir>/resources/review-code.mjs"
node "$REVIEW" --cwd <repo> --goal "<what the change does>" --check "<test command>"
<skill-dir> is the directory that holds this file. Write its absolute path into the variable. The script needs the agent-orchestrate skill in the same skills directory, Node 24.15 or later, and macOS or Linux.
Run
The change under review is everything that differs between the merge-base of --base and the working tree, including untracked files and excluding lockfiles. Committed branch work and uncommitted edits are both covered. On the base branch itself, only uncommitted work is reviewed.
Pass --goal whenever the user has stated intent (a sentence, a ticket, or a plan file path). Correctness is judged against it, and it bounds the scope. Pass --check when the repository has a fast test or typecheck command. The script runs it before the loop and after every Claude turn, and Claude may run exactly that command.
Each turn takes minutes. Start the script with your host's background process facility (in Claude Code, the Bash tool's run_in_background). A bare & and a PID file are not supervision. As soon as stderr prints run dir: …, give the user that path. run.md in it is rewritten after every step and can be read while the loop runs.