Afk claude review
Part of the afk pipeline. Runs Claude (Claude Code CLI) as an independent, read-only external review gate on the current PR/branch, then triages and fixes the findings. For use when another model implemented the change — it declines to review its own work. Interchangeable with afk-codex-review, afk-kimi-review and afk-glm-review, subject to .afk/config.md gate priority and min-pass. Triggers include "/afk-claude-review", "run claude review", "claude gate".From its SKILL.md
npx -y skills add jimmy1992abc/afk --skill afk-claude-reviewAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
7.4 KB, as published. Nobody here has run it
afk-claude-review
An independent second-opinion review by Claude, used as an external gate after
afk-internal-review. Interchangeable with afk-codex-review,
afk-kimi-review and afk-glm-review: run the number of gates required by
.afk/config.md, and never use a gate whose model matches the implementer's.
This gate exists for the case where Claude is not the implementer — Codex,
Kimi, Gemini or Copilot wrote the change and Claude reviews it. It refuses to run
otherwise (see Independence below), so under a Claude Code driver it will
normally self-skip and the next gate in priority takes its place. That is the
intended behaviour, not a fault.
The helper claude-gate.mjs ships with this skill and travels with the plugin.
Independence — this gate declines to review its own work
The gate resolves who wrote the change and skips if the answer is Claude:
--implementer <family>— per invocation. The only source that may permit a run as well as block one.implementer:in.afk/config.md— may only block. A per-repo file written once must not outrank a live per-run signal.CLAUDECODEin the environment — set by Claude Code in every process it spawns. Present and undeclared means the driver, and so probably the implementer, is Claude.
An unrecognised implementer value fails closed: the gate skips rather than guess that it is independent.
Pass --implementer <family> whenever the implementer is not the driver — most
often when afk-agent-relay relayed the implementation to another model. Known
families: claude, codex, kimi, glm, gemini, copilot.
Known gap: CLAUDECODE identifies the driver, not the model. A Claude
implementer driven from Copilot, Cursor, CI, or a plain terminal leaves it
unset, so the gate would run. Close it with --implementer claude or an
implementer: claude line in .afk/config.md.
Read-only
The reviewer session loads Read, Grep and Glob and nothing else — no Bash,
no Write, no Edit. It is read-only by construction rather than by an allowlist,
so there is no command list to maintain and none to get wrong.
Because the reviewer has no shell, the gate pre-injects the diff and its stat
into the prompt; the reviewer uses its read tools for anything the diff does not
answer. This is the gate's advantage over afk-glm-review, whose reviewer is
limited to the snapshot it was sent.
Metering
Metered like any external gate. Batch confirmed structural findings into one fix pass, self-review, then re-run once. Defer minor items to a single final pass.
Run it
The bundled helper claude-gate.mjs sits beside this SKILL.md. Locate its
directory as ${CLAUDE_PLUGIN_ROOT}/skills/afk-claude-review if the env var is
set, else <pluginRoot>/skills/afk-claude-review from .afk/config.md, else this
skill's own directory. If .afk/ is absent, the afk-init bootstrap runs
automatically first:
node "<helper-dir>/claude-gate.mjs" --implementer codex
Run it in the background with a generous timeout; redirect stdout to a file
and read it when it completes. Pass through any target flag (--base <branch> /
--commit <sha> / --uncommitted). Do not poll in a sleep loop.
Design mode (--design <path>) reviews a design document's reasoning instead
of a diff — the opt-in design-stage gate (see ../afk/SKILL.md, "Design-stage
external gate"). The reviewer keeps its read-only Read,Grep,Glob tools, so it
can check whether the code says what the design claims. A missing or unreadable
--design path fails loudly (ERROR, non-zero), never a skip.
Read the verdict between the ===== CLAUDE REVIEW (final message) ===== markers.
A SKIPPED: … line is not a failure — record it and continue per the afk
gate-selection rule. The reasons are distinct on purpose, so the ledger can tell
"correctly declined" from "could not review":
SKIPPED: independence check — …— the gate refused to review Claude's own work. Correct behaviour; use another gate.SKIPPED: Claude gate disabled via CLAUDE_REVIEW_GATE.SKIPPED: Claude CLI not installed …SKIPPED: Claude not authenticated (HTTP 401) …SKIPPED: Configured model "…" is unavailable (HTTP 404) …SKIPPED: No changes found for …
An ERROR: … line with a non-zero exit means the gate ran and could not produce
a verdict; that is not a clean round.
Handle findings
Same discipline as the other gate skills:
- Sort structural findings from minor items.
- Verify each finding to the standard below.
- Fix confirmed structural findings in one batch and sweep for the same pattern.
- Self-review once.
- Re-run the gate once if structural findings were fixed.
- Resolve minor items in a single final pass without another gate round.
A structural finding claims both that the code is as described and that it goes
wrong; reading the cited file:line settles only the first. Demonstrate the
consequence before fixing, and account for every consumer of what you change
that lives outside the diff — ../afk/SKILL.md ("External gate") holds both
rules.
Apply any invariant in .afk/config.md as an extra lens.
Stop rule
Stop when the loop-termination rule in ../afk/SKILL.md ("External gate")
holds: a round with no new structural finding and every prior structural
finding closed by a recorded disposition — a driver-verified fix, a
refutation, or an accepted risk.
Report CLEAN, or OUTSTANDING with what remains. A clean pass is not
authority to merge.
Setup
Optional and self-skipping. Needs the Claude Code CLI installed and logged in,
plus Node and git on PATH. Uses the operator's existing Claude subscription —
no API key. Disable with CLAUDE_REVIEW_GATE=off.
Config knobs:
CLAUDE_REVIEW_MODEL(defaultclaude-opus-5)CLAUDE_REVIEW_EFFORT(defaultmedium)CLAUDE_REVIEW_MAX_CTX_BYTES(default400000)CLAUDE_GATE_BIN— override the resolvedclaudebinary
No fallback model is passed: a quiet downgrade to a weaker reviewer is a quality regression with no visible symptom, so an unavailable model surfaces as a skip.
The reviewer model is pinned, and checked against what answered
CLAUDE_REVIEW_MODEL must be a full model ID. An alias (opus, sonnet) is
resolved by the host and can select an older generation without a symptom —
--model opus answered as claude-opus-4-8 while the pipeline required a
current generation — so an alias is refused before any call is spent.
The gate then reads modelUsage in the result envelope and requires the
requested identity to be present; a dated snapshot of the same model satisfies
it, and the auxiliary models a normal run also bills are ignored. A review whose
envelope names another generation, or names nothing, is discarded with an
ERROR rather than attributed to a model that may not have run. Neither case is
a clean round:
ERROR: cannot review — CLAUDE_REVIEW_MODEL "…" is an alias …ERROR: reviewer identity unverified — requested "…" but …