actual plan-check judges a plan and actual impl-check judges a diff, each against the rule files committed under .actual/rules/. Both run the same way: they select the rules that apply, ask a model to judge the plan or diff against them, and report one outcome. The plugin runs them in your coding agent, and you can run them yourself in a terminal or CI.
The two checks
actual plan-check and actual impl-check list every flag.
How rules are selected
A check judges only the rules that apply to the change, at most--limit rule files (20 by default). Selection runs in two stages over an index of your rule files.
The scope index
The CLI indexes every.md file directly under .actual/rules/ and caches the index in your config directory, under ~/.actualai/actual/scope-index/, never in the repository. The cache is keyed by a SHA-256 of every rule file’s bytes, so any edit, addition or removal rebuilds it. Building an index over 425 rule files takes about 130 ms, and a query against it is sub-millisecond. A decision whose status doesn’t govern, such as draft, is left out of the index, so no check ever sees it. actual rules index shows the index, --rebuild on either check rebuilds it first, and actual rules index --clear removes every cached index.
Stage 1: the prefilter
The prefilter ranks every rule file against the plan or diff with no model and no network. It scores five signals, each weighted on its own:
A word scores by how rare it is across your rule files (inverse document frequency), so a word every file shares counts for nothing, and by how often the rule file uses it, with a cap so repetition can’t buy rank. Paths match by depth: a rule for the exact directory a change touches outranks one for the whole tree. A decision’s
! excludes are a hard limit, applied before any scoring, and so is its root when its header declares paths. For a diff, the paths come from the diff’s file headers.
The prefilter keeps up to --candidates rule files (30 by default; raised to --limit when smaller).
Stage 2: the rank
When the prefilter keeps more candidates than--limit and there’s plan prose to read, a model sorts the candidates into governs, related and unrelated, and the check drops unrelated. The model only judges the fixed list: it can’t add a rule file or reorder within a verdict, and a rank that keeps nothing counts as failed. Any failure, including no runner or a 90-second deadline passing, falls back to the prefilter’s answer.
In the agent, the checks skip this stage and use the prefilter alone, keeping their one model call for the judge inside Claude Code’s 120-second hook timeout. In a terminal, --no-rank skips the stage too, which makes selection offline and exactly reproducible.
To see what a check would select without judging anything, run actual rules select "<plan>", or actual rules brief --file <path> for one file.
The judge
The judge is one model call, through the runner the CLI finds or the one--runner names. It gives each selected rule a verdict:
Before CLI 0.15.0,
followed and not_applicable were one verdict, conforming.
The check’s outcome, the status field in --json, is one of four:
Only a conflict exits non-zero, so a CI job that gates on the exit status alone can’t tell “checked and clean” from “couldn’t check”. Read
status from --json to tell them apart. Unattended agents and CI has examples.
In a session
Inside Claude Code or Codex, the plugin runs the checks in their hook modes, which add session rules:- A rule judged
followedornot_applicableis cleared for the session, so later rounds don’t ask about it again. requires_decisionblocks like a conflict, until you revise the change or override the rule.- Each rule has a round limit. A rule that stays unresolved stops blocking after three denied rounds in a session (
--max-rounds), counted per rule, and separately for plans and changes. A new conflict always starts its own count. - Overrides last the session. An override clears a rule at both checks for the rest of the session. Overrides covers how to give one.
- Failures fail open. A missing or crashed CLI, a runner that can’t be reached or an unreadable hook input lets the agent continue, with a message instead of a block.
~/.actualai/actual/plan-check-overrides.log.
Run the checks yourself
From inside the repository:actual runners lists the others and Configuration keys shows how to choose one. They need no Actual AI account.
