> ## 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 plan-check

> Check an implementation plan against the selected .actual/rules/

```bash theme={null}
actual plan-check [OPTIONS] [PLAN]...
```

## Arguments

| Argument | What it does |
| - | - |
| `[PLAN]...` | The plan to check. Omit to read from `--plan-file` or stdin. Ignored under `--claude-hook`, which resolves the plan from the hook envelope |

## Options

| Option | Default | What it does |
| - | - | - |
| `--plan-file <PATH>` | | Read the plan from this file instead of the positional argument or stdin. Ignored under `--claude-hook` and `--codex-hook` |
| `--repo <PATH>` | | Repository root to resolve rules and paths 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. This is the mode `hooks/plan-gate.sh` drives; every failure degrades to fail-open rather than an error exit, per that contract |
| `--codex-hook` | | Parse a Codex `Stop` hook envelope from stdin and, when the turn that just ended was in Plan mode, check the plan it proposed. Codex has no `ExitPlanMode` tool, so the plan and the turn's mode are read from the session rollout at the envelope's `transcript_path`; a turn in any other mode, or one whose rollout cannot be read, prints nothing. A conflict is a `{"decision":"block"}` reply that sends the agent back to revise the plan. 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 (reply to revise, or type `actual override <rule-id\|all> [code]`), 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 plan 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 inside Claude Code's 120-second `PreToolUse` timeout — 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`). Also set by `ACTUAL_PLAN_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.