actual rules <COMMAND>
Subcommands
| Command | What it does |
|---|---|
actual rules ls | List the rule documents under .actual/rules/ |
actual rules index | Build or refresh the scope index over .actual/rules/ |
actual rules select | Select the rule documents that govern a plan, or a path with no plan |
actual rules eval | Score the scope index against the filename scan on a golden set |
actual rules brief | The rules governing one file, for a Claude Code hook |
actual rules report-use | Answer the Stop hook’s question: which of this session’s ADRs shaped this turn’s change, and where |
actual rules ls
List the rule documents under.actual/rules/
actual rules ls [OPTIONS] [PATH]
| Argument | What it does |
|---|---|
[PATH] | Repository root to scan. Defaults to the current directory |
| Option | Default | What it does |
|---|---|---|
--json | Print the parsed rule set as JSON instead of a panel |
actual rules index
Build or refresh the scope index over.actual/rules/
actual rules index [OPTIONS] [PATH]
| Argument | What it does |
|---|---|
[PATH] | Repository root to scan. Defaults to the current directory |
| Option | Default | What it does |
|---|---|---|
--rebuild | Rebuild the index even when the cached one is still valid | |
--clear | Remove every cached scope index, including those left by other repositories, then rebuild this one | |
--json | Print the index summary as JSON instead of a panel |
actual rules select
Select the rule documents that govern a plan, or a path with no planactual rules select [OPTIONS] [PLAN]...
| Argument | What it does |
|---|---|
[PLAN]... | The plan to match against the rule set. Optional when at least one --file is given, because passing "" to satisfy a required argument is not an interface. One of the two is still required, because a query with neither names nothing to match. Omitting it narrows the query to the path signal alone, which is rarely what you want from this command — see --file. A blank plan beside a --file is accepted, as it was when the plan was required and "" was the only path-only form. A blank plan with no --file is refused by rules select itself. |
| Option | Default | What it does |
|---|---|---|
--repo <PATH> | Repository root to scan. Defaults to the current directory | |
--file <PATH> | A file or directory to match against the rule set. Repeatable. Adds the path signal: a document scores here when a glob in its verify block covers one of these paths. With a plan, these are the paths the plan touches, and both signals score. --file is not a stand-in for a plan. Scoring sums weighted field contributions, and with no plan text only the path field can contribute, so a rule set whose verify blocks name no paths returns nothing for every file — which says nothing about whether those rules govern it. To see what briefing would say for a file, run rules brief --file <path>: it builds its own query, and when no glob covers the file it retries with the path’s words as query text. | |
--limit <LIMIT> | 10 | Maximum number of rule documents to return |
--min-score <SCORE> | Score a document must reach to be returned at all. Selection otherwise returns its cap whenever anything scored above zero, so a file no rule governs still gets the least bad few. Defaults to the repository’s floor from config set --repo rules_min_score, then the user-wide rules_min_score config key, or to no floor. | |
--by-adr | Group the result by the decision each document belongs to, and count --limit in decisions rather than documents. A generated rule set splits one decision across many near-identical documents, so a document-level cap can spend itself on aspects of a single subject. Stage 1 only: the rank judges documents, and what is being capped here is decisions. | |
--candidates <CANDIDATES> | 30 | How many candidates the deterministic prefilter retrieves before stage 2 judges them. Raised to --limit when smaller |
--no-rank | Skip stage 2 and return the deterministic prefilter alone. Offline, and exactly reproducible | |
--runner <RUNNER> | Runner to use for stage 2. Probed automatically when omitted. One of claude-cli, anthropic-api, openai-api, codex-cli, cursor-cli. | |
--model <MODEL> | Model for stage 2, overriding the configured one | |
--explain | Show the signal behind every hit, and what the filename scan would have chosen instead | |
--json | Print the selection as JSON instead of a panel | |
--rebuild | Rebuild the index before selecting |
actual rules eval
Score the scope index against the filename scan on a golden setactual rules eval [OPTIONS] --golden <FILE>
| Option | Default | What it does |
|---|---|---|
--golden <FILE> | Golden set: JSON array of {name, plan, paths, expected} cases | |
--repo <PATH> | Repository root holding the rule set the golden set refers to | |
--min-score <SCORE> | 0 | Score a document must reach to be selected, as rules select --min-score. Here it is a measurement knob: the floor trades recall for abstention on cases nothing governs, and this is where that trade is priced. |
--limit <LIMIT> | 5 | Number of documents each selector may return |
--ablate <FIELD> | Score the index with one signal switched off, to measure what that signal is worth. Repeatable | |
--rank | Also score the two-stage selector, which costs one runner call per case | |
--candidates <CANDIDATES> | 30 | How many candidates the prefilter hands to stage 2 under --rank |
--runner <RUNNER> | Runner to use for --rank. Probed automatically when omitted. One of claude-cli, anthropic-api, openai-api, codex-cli, cursor-cli. | |
--model <MODEL> | Model for --rank, overriding the configured one | |
--json | Print the full comparison as JSON instead of a panel | |
--rebuild | Rebuild the index before evaluating, so the measurement is against the files on disk rather than a cached index |
actual rules brief
The rules governing one file, for a Claude Code hookactual rules brief [OPTIONS]
| Option | Default | What it does |
|---|---|---|
--claude-hook | Read a Claude Code hook envelope from stdin and emit the hook’s JSON contract on stdout. PostToolUse on Read is the main path: context delivered there reaches the model before its first edit. PreToolUse on Edit or Write is the reminder for files that were never read. Every failure degrades to empty stdout and exit 0. | |
--claude-session-start | Answer a Claude Code SessionStart envelope on stdin: when the session’s context was emptied (compact or clear), forget which decisions were briefed so they are briefed again. Prints nothing and always exits 0 | |
--codex-hook | Read a Codex hook envelope from stdin and emit the hook’s JSON contract. Codex has no file-reading tool, so PostToolUse on Bash is the read path: the files a read-only shell command names (cat, sed -n, head, grep, …) are briefed. PreToolUse on apply_patch briefs the files a patch adds or updates. Every failure degrades to empty stdout and exit 0. Capability marker: codex-hook | |
--codex-session-start | --claude-session-start for a Codex SessionStart envelope | |
--file <PATH> | The file to brief, in direct mode. Ignored under --claude-hook and --codex-hook, which take the path from the envelope | |
--repo <PATH> | Repository root. Defaults to <root> when --rules-dir is <root>/.actual/rules, then to the envelope’s cwd under --claude-hook, else the current directory | |
--rules-dir <PATH> | Rule directory, when it is not <repo>/.actual/rules | |
--limit <LIMIT> | 2 | Maximum number of decisions to brief |
--rules-per-decision <RULES_PER_DECISION> | 8 | Maximum number of rules to carry per decision |
--max-chars <MAX_CHARS> | 4000 | Maximum size of the whole brief, in characters. Rules are dropped whole, lowest-ranked first, and the brief says how many decisions it left out |
--min-score <SCORE> | Score a document must reach to be briefed at all. Defaults to the repository’s floor from config set --repo rules_min_score, then the user-wide rules_min_score config key, or to no floor | |
--max-session-chars <CHARS> | Stop briefing once this many characters of briefs have been delivered in one session, counted across every agent in it. The first brief that would cross the line is dropped whole and replaced, once, by a note saying briefing has stopped; 0 turns briefing off. Hook modes only, and only with a session_id; unset means no cap. Deliberately not read from ACTUAL_RULES_BRIEF_MAX_SESSION_CHARS: on Claude Code the actual-cli mod enforces that cap itself, and a second one here would add a second exhaustion note. The Codex hook forwards it as this flag | |
--no-brief-notice | Under --codex-hook, leave out the one-line systemMessage that tells the user which files were briefed and how many ADRs and rules the brief carried. The brief itself is unchanged |
actual rules report-use
Answer the Stop hook’s question: which of this session’s ADRs shaped this turn’s change, and whereactual rules report-use [OPTIONS] --claude-session <ID> --turn <TOKEN>
| Option | Default | What it does |
|---|---|---|
--claude-session <ID> | The Claude Code session the question was asked in | |
--turn <TOKEN> | The turn token the question named | |
--claim <ADR=FILE:LINE> | An ADR you used and the line that best shows its effect, as <adr>=<repo-relative-path>:<line>. Repeat for each ADR | |
--plan-claim <ADR=LINE> | An ADR and the line of this turn’s plan it shaped, as <adr>=<line> | |
--none | No ADR shaped this turn’s change. With no claim and no --none, the claims are read as JSON from stdin | |
--repo <PATH> | Repository root. Defaults to the current directory | |
--rules-dir <PATH> | Rule directory, when it is not <repo>/.actual/rules |

