proctor checks your git diff for deleted tests, weakened assertions, hardcoded answers,
swallowed errors, and disabled checks. Its hooks block changes that trigger an error finding.
The default check runs offline: no account or API key. The optional --ai judge sends candidates
to Anthropic and needs ANTHROPIC_API_KEY. You need Node 22.12 or newer; building from source needs
Node 22.18+, 24.11+, or 26.

Contents
Getting started
- Quickstart, try it from source against a repo
- Install, and exactly what it writes
- What that setup does
- One thing to do afterwards
- Checking it worked
- Removing it
Using it day to day
- See it catch a real cheat
- What happens when it blocks
- What do the codes mean?
- Badges
- CI
- Dynamic checks, opt-in runtime evidence
Why it works
- How it works
- Can the agent get around it?
- What proctor is for, scope and limits
- By the numbers, with the full history in docs/BENCHMARKS.md
Reference
- Going further, every doc page
- The Proctor
- License
Quickstart
Check the changes in any git repository, with nothing to install first:
cd /path/to/repository
npx @kavishdua/proctor check
To run it from source instead:
git clone https://github.com/catfish-1234/proctor.git
cd proctor
npm ci
npm run build
node dist/cli.js check /path/to/repository
The ✓ proctor: honest pass line means there are no error-level or approved findings. Warnings
may still be reported. Checks cover source and configuration changes as well as tests.
The check writes nothing to the repository being checked and makes no runtime network call.
npm ci installs dependencies in the proctor checkout.
Install
Agent plugins install the ruleset. The Gemini CLI extension also bundles an AfterAgent hook
(experimental, opt-in: contract-verified only, and consumer Gemini CLI auth is retired by Google;
Antigravity CLI is the supported successor).
For CLI checks and project hooks, use the local npm installation below. proctor setup adds
turn-end enforcement for Claude Code and Codex CLI, and for Gemini CLI when you opt in with
proctor setup --agents gemini-cli (experimental). The Cursor plugin also includes
a stop hook.
Claude Code
/plugin marketplace add catfish-1234/proctor
/plugin install proctor@proctor-marketplace
Gemini CLI or Qwen Code (experimental: contract-verified only, never exercised against a live
Gemini CLI session; consumer Gemini CLI auth is retired by Google, and Antigravity CLI is the
supported successor)
gemini extensions install https://github.com/catfish-1234/proctor
qwen extensions install https://github.com/catfish-1234/proctor
The Gemini CLI extension loads its AfterAgent hook from hooks/hooks.json and runs the bundled
CLI, so no separate npm installation or proctor setup is needed for that hook. The manifest
keeps contextFileName: "PROCTOR.md". This follows the
Gemini extension hook layout.
Other agents, or CLI use without an agent (30 agents supported)
Add it to the repository as a dev dependency:
npm install --save-dev @kavishdua/proctor
Proctor does not install guards during npm installation by default. npm still updates your
package files and node_modules. Proctor prints what setup would write, then stops. From the
repository you want to guard, run:
npx proctor setup
What that setup does
This is what proctor setup writes. It makes no network call. Git chooses the hook directory,
which may be outside the working tree when you use worktrees or core.hooksPath.
| Path |
What it is |
If it already exists |
The ruleset file for each agent this repo uses, e.g. .claude/skills/proctor/SKILL.md, .cursor/rules/proctor.mdc, AGENTS.md |
The honest-completion rules your agent reads before it works |
A shared file like AGENTS.md keeps your content; only proctor's delimited block is replaced |
Git's hook directory (.git/hooks/pre-commit normally), or .husky/pre-commit when Husky is a dev dependency |
Blocks a cheat at commit time; the Husky file is also staged |
A foreign hook is backed up to pre-commit.bak, then replaced; merge it manually if needed |
.claude/settings.json |
The Claude Code Stop hook, written only if this repo uses Claude Code |
Merged into the existing JSON; nothing else in the file changes |
.codex/hooks.json |
The Codex CLI Stop hook, written only if Codex is a selected or detected agent |
Merged into the existing JSON, preserving other hooks and top-level fields |
.gemini/settings.json |
The Gemini CLI AfterAgent hook (experimental), written only when Gemini CLI is explicitly selected (--agents gemini-cli or --all), never on detection alone |
Merged into the existing JSON, preserving other hooks and settings |
.github/hooks/proctor.json |
The GitHub Copilot agentStop hook (experimental), written only when GitHub Copilot is explicitly selected (--agents github-copilot or --all), never on detection alone |
proctor's own file; merged preserving other events and entries, and other files in .github/hooks/ are never touched |
.proctor-adapter-manifest.json |
Records what was written, so uninstall can take exactly that back out |
Rewritten |
proctor detects agents from their config files, such as .cursor/, .claude/, .codex/, .gemini/, or WARP.md,
and installs the ruleset for those agents. If it finds none, it writes AGENTS.md.
Run proctor agents to check the list before installing. Use --all for all 30 supported agents,
or --agents claude-code,cursor to choose them yourself.
The npm postinstall notice and automatic setup stay quiet in CI, global installs, transitive
installs, outside a git repository, and under npx. An explicit proctor setup still runs.
Set PROCTOR_AUTO_SETUP=1 to run proctor setup automatically during installation.
Set PROCTOR_NO_POSTINSTALL=1 to silence the install-time notice.
One thing to do afterwards
Commit what it wrote. The ruleset files and .proctor-adapter-manifest.json are ordinary files
in your repo, and they only reach your teammates and your CI once they're committed.
git add -A && git commit -m "chore: add proctor"
If you use Claude Code, restart it so it picks up the new Stop hook.
If you use Codex CLI, two trust steps are required before the hook runs:
- Trust the project at Codex's interactive prompt, or set
trust_level = "trusted" under
[projects."/absolute/path/to/repo"] in ~/.codex/config.toml. Project hooks are silently
ignored in untrusted projects.
- Review and approve the new or changed hook when Codex prompts, or via
/hooks in the CLI.
The Codex hook runs proctor stop-hook --format codex, which emits a JSON block decision with
finding feedback and exits 0. It stays silent on clean checks and a follow-up
Stop with stop_hook_active: true, preventing a loop. Internal failures allow the turn with
bounded UNVERIFIED stderr diagnostics and no stdout (exit 1, a nonblocking hook failure).
Verified end-to-end against codex-cli 0.164.0 on November 8, 2026: in codex exec, a change that
deleted a failing test was blocked at Stop with an RH001 finding, and Codex continued and acted on
the block reason; an honest fix completed with no block. Hook trust is one-time: Codex asks to
review new or changed hooks (the interactive prompt or /hooks), records trust against the hook
definition, and after that the hook runs in both interactive sessions and codex exec. The
--dangerously-bypass-hook-trust flag exists for one-off automation that vets hook sources outside
Codex; it is not part of standard setup. Contract source:
Codex hooks.
If you use Gemini CLI (experimental, opt-in), hooks are enabled by default since v0.26.0. Gemini fingerprints project
hooks and warns before running new or changed ones. Review the one-time trust prompt and manage
hooks in the /hooks panel.
Gemini's AfterAgent fires once per turn after the final response. It runs
proctor stop-hook --format gemini, which checks the same uncommitted diff as the Codex hook.
A blocking finding emits only {"decision":"deny","reason":"<finding output>"} and exits 0;
Gemini sends the reason to the agent as a new prompt requesting correction. Clean checks,
stop_hook_active: true and malformed input silently allow the turn. Internal failures allow the
turn with bounded UNVERIFIED diagnostics on stderr and no stdout (exit 1, a nonblocking warning).
Ordinary blocks request a retry; they do not set continue: false to end the session.
Verified locally with documented AfterAgent payloads: a deleted test returns deny feedback with
RH001, a clean working tree is silent, and loop-guard/malformed-input skips silently allow.
Internal-error cases allow with UNVERIFIED diagnostics, not a block or clean claim. Tests also cover settings merge/uninstall round-trips and execution of the bundled
extension command without a separate npm install. This verifies the hook contract and local
integration; live Gemini CLI sessions were not exercised. Contract source:
Gemini hooks reference.
Antigravity CLI (agy) ships a Stop-hook plugin in antigravity-plugin/. Read the limits
first, because this hook is local feedback, not a gate:
- The independent check is CI.
proctor check --base <ref> on the pushed diff (see the GitHub
Action) is the only check that does not run inside the agent's session. It is independent only
if the workflow, proctor config and required-check settings are controlled outside the agent's
write and admin scope (for example branch protection that the agent's token cannot change).
proctor does not set up branch protection or change account permissions.
- The Stop hook is bounded feedback. A block is a message to the agent. The agent can read it,
keep the change anyway, or inspect the hook (a live trial did all of that). Antigravity has no
stop_hook_active flag, so proctor re-checks on every Stop and re-blocks while the finding
remains, up to a budget of 5 consecutive blocks per conversation
(PROCTOR_STOP_HOOK_BLOCK_BUDGET, 1-50), so a stuck agent cannot burn unlimited model quota.
- After the budget the finding is recorded as unresolved, not forgotten. proctor writes
proctor/unresolved.json inside the worktree's git directory (never into the working tree, so
it cannot be committed), with the original finding, a baseline commit and timestamps, and no
transcript content. proctor unresolved shows it and exits 2. The pre-commit hook runs
proctor unresolved --gate, which blocks commits until a fresh complete check (working tree
against HEAD plus every commit since the baseline) passes. Only that check clears it; a
--staged or --uncommitted check alone never does, and an error or a missing baseline is
reported as "unverified", not as clean. Credential-looking literals (tokens, keys, password=
values) are redacted from stored findings on a best-effort basis, and the harness-supplied
conversation id is sanitized and never used as a path. The record is a file anyone with access to the git
directory can delete, and git commit --no-verify skips the hook, so this is not tamper-proof.
PROCTOR_STOP_HOOK_MODE=advisory is an explicit opt-in that allows the Stop after the budget
without recording anything. The default is enforce.
- proctor's checks are static diff checks. This hook does not catch cheating those checks cannot
see.
- Verified live on Antigravity CLI 1.5.3 only: a deleted test was blocked and the reason reached
the model; the agent did not restore it within four minutes and instead inspected the hook.
Other versions, the desktop app and IDE, and tamper-resistance were not tested. The Antigravity
docs disagree on the Stop response (
block on the plugin page, continue on the hooks page);
block is what 1.5.3 honors.
Install from a checkout of this repository (Antigravity installs plugins from a local
directory), with proctor on your PATH (npm install -g @kavishdua/proctor):
agy plugin validate --strict ./antigravity-plugin
agy plugin install ./antigravity-plugin
The plugin's Stop hook runs proctor stop-hook --format antigravity and returns
{"decision":"block","reason":"<finding output>"} when the uncommitted diff games the tests.
proctor setup does not edit Antigravity settings; agy plugin uninstall proctor removes the
plugin. Install the git hook with proctor install-hook to get the unresolved-findings gate.
A pre-commit hook installed by an older proctor version does not have the gate: rerun
proctor install-hook (a hook from another tool is backed up to pre-commit.bak, never silently
overwritten, and you merge it by hand). proctor unresolved tells you whether the gate is installed.
If you use GitHub Copilot (experimental, opt-in), proctor setup --agents github-copilot
writes .github/hooks/proctor.json, registering an agentStop hook that runs
proctor stop-hook --format copilot. A blocking finding emits only
{"decision":"block","reason":"<finding output>"} and exits 0; per GitHub's hooks
reference, a block forces another agent turn with the reason as the prompt. Clean checks,
stop_hook_active: true and malformed input silently allow the turn, so proctor blocks at most
once per turn and never approaches the documented 8-block runaway guard. The entry carries
bash, powershell and command fields so both the Copilot CLI and the cloud agent (Linux
sandbox, bash with command fallback) run the same handler. Other files in .github/hooks/
load independently, so proctor's file cannot disable a hook you already have.