> ## Documentation Index
> Fetch the complete documentation index at: https://docs.actual.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# actual impl-check

> Check a git diff against the same committed .actual/rules/ corpus plan-check checks plan text against

```bash theme={null}
actual impl-check [OPTIONS]
```

## Options

| Option | Default | What it does |
| - | - | - |
| `--diff-file <PATH>` | | Read the diff from this file instead of stdin or the working-tree diff. Mainly for scripting and testing. Ignored under `--claude-hook`, which always resolves the diff from the working tree (tracked changes plus untracked, non-ignored files, against the commit the turn started from when a `UserPromptSubmit` hook recorded one, otherwise against `HEAD`). Ignored under `--codex-hook` for the same reason |
| `--repo <PATH>` | | Repository root to resolve rules, paths, and the working-tree diff against. Defaults to the current directory |
| `--rules-dir <PATH>` | | Rules directory to score against, overriding `<repo>/.actual/rules`. This is what `ACTUAL_RULES_DIR` becomes on the way into the CLI: the hook resolves the override itself and forwards the resolved path here rather than leaving this command to rediscover it from `--repo` |
| `--claude-hook` | | Parse a Claude Code `PreToolUse` hook envelope from stdin and emit the hook's JSON contract on stdout instead of a panel. The diff is always resolved from the working tree in this mode (tracked changes plus untracked, non-ignored files, against the commit recorded for this session at the start of the turn when it is still an ancestor of `HEAD`, otherwise against `HEAD`); every failure degrades to fail-open rather than an error exit, per that contract. An envelope whose `hook_event_name` is `UserPromptSubmit` checks nothing and prints nothing: it records `HEAD` as the commit the turn starts from, keyed on `session_id`, so the check that ends the turn also sees work the agent committed, or committed and pushed, during it. |
| `--codex-hook` | | The same check for a Codex `UserPromptSubmit` or `Stop` envelope. A `Stop` that ends a Plan-mode turn checks nothing, since Plan mode makes no edits; a conflict is a `{"decision":"block"}` reply. On a `UserPromptSubmit`, besides recording the turn start, it hands the agent the conflicts a `--codex-ask` check stopped the last turn on, and records an override the user typed as `actual override <rule-id\|all> [code] [reason]`. Capability marker: codex-hook |
| `--codex-ask` | | Under `--codex-hook`, end the turn on a conflict instead of sending the agent back: the reply is `{"continue":false,"stopReason":…}`, which shows the user the conflicts and how to answer, and the conflicts are handed to the agent with the user's next message. Without it, a conflict is a `{"decision":"block"}` that sends the agent back to revise at once, which suits a run with nobody to ask |
| `--codex-picker` | | With `--codex-ask`, have the agent show the user a picker (`request_user_input`) instead of ending the turn, when the session rollout says the tool works in the turn's mode: Plan mode always, and Default mode with Codex's `default_mode_request_user_input` feature on. The conflict is a `{"decision":"block"}` telling the agent to ask; the answer comes back through `impl-check --codex-hook` on `PostToolUse`. Without the tool, or when the question goes unanswered, the turn ends as plain `--codex-ask` ends it |
| `--limit <LIMIT>` | `20` | Maximum number of rule documents to judge the diff against |
| `--candidates <CANDIDATES>` | `30` | How many candidates the deterministic prefilter retrieves before the limit is applied. Raised to `--limit` when smaller |
| `--no-rank` | | Skip stage 2 (a runner-backed rank refining which documents apply) and select with the deterministic prefilter alone. Direct-mode use only: `--claude-hook` always uses the prefilter alone regardless of this flag, so its one model call stays reserved for the conformance judge — see `crate::cli::commands::plan_check` for why running both there risks that budget. A human at a terminal has no such constraint, so direct mode runs stage 2 by default, the same way `rules select` does |
| `--runner <RUNNER>` | | Runner to use for stage 2 selection (direct mode only) and the conformance judge. Probed automatically when omitted. One of `claude-cli`, `anthropic-api`, `openai-api`, `codex-cli`, `cursor-cli`. |
| `--model <MODEL>` | | Model for stage 2 selection (direct mode only) and the judge, overriding the configured one |
| `--json` | | Print the result as JSON instead of a panel. Ignored under `--claude-hook`, which always emits the hook's own JSON contract |
| `--rebuild` | | Rebuild the scope index before selecting |
| `--max-rounds <MAX_ROUNDS>` | `3` | How many times a single rule may be denied within one Claude Code session (`--claude-hook` only) before the gate stops blocking on it specifically, regardless of verdict. Tracked per rule, not per round: a brand-new conflict always gets its own fresh count, no matter how exhausted some other rule's count already is. Direct mode ignores this — there is no session outside a hook envelope. Must be at least 1: a value of 0 is rejected outright rather than treated as "always fail open" (see `parse_max_rounds`). Uses its own environment variable, distinct from `plan-check`'s `ACTUAL_PLAN_CHECK_MAX_ROUNDS`: deny counts, rounds, and content-scoped clearances are per artifact kind inside the shared session file, so a plan-stage denial cannot spend this budget. Human overrides on the same `(session_id, rules_dir)` still apply to both commands. Also set by `ACTUAL_IMPL_CHECK_MAX_ROUNDS`. |

## Exit codes

0 for conforming, requires\_decision, or not\_checked (no runner available, no applicable rules, or the judge call itself failed) -- only a real conflict exits nonzero. A CI job that gates on exit code alone cannot distinguish "checked and clean" from "could not check"; read --json's `status` field for that distinction.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.