Rules Reference
This page holds the facts of the rule modules. Read it to look one fact up.
For how a module reaches an agent, see Rules.
To write a new paths: predicate, see Writing a rule’s paths:.
The rules/ directory holds the toolkit’s just-in-time (JIT) canon. A canon is a set of short reference modules for one area.
The main loop is the Claude Code session in which you talk to the agents.
Every module
The column "Read by" says who reads the module. For the rules/agents/ modules, the paths: globs name the agent files, so a module loads when someone edits an agent. The pipelines read those modules on purpose.
A row that says "the hook names it" applies only where you registered rules-loader.py by hand.
The exact globs are in the matrix on Rules.
| Module | Predicate in words | Governs | Read by |
|---|---|---|---|
Agents canon ( |
|||
|
You write or edit an agent file or an |
Shell and search discipline, graph-first code discovery, browser verification, report economy, untrusted content as data, evidence, asking the user by position, permission requests, vault and self-tuning. |
Every FT agent |
|
You edit |
The orchestrator’s own context, the sanctioned reset ( |
The top-level |
|
You edit any agent or |
How work is split and handed back: the evidence-pack brief, measurable Definition of Done (DoD), ownership zones, |
Every agent that dispatches a |
|
You edit |
The human SDD handshake: which path a run takes, the two documents, the |
The top-level |
|
You edit any agent or an |
The append-only run journal under |
The orchestrators that write it, |
|
You edit an agent or a pipeline skill (the glob lists them one by one). |
Model and effort per dispatch, escalation, unit size, slices, who decides, the report lines. It prices a dispatch and never changes what is verified. |
|
|
You edit an agent, an |
Which verifier lenses run and when: the mandatory core, routed lenses, the no-repeat rule, sequencing, evidence reuse, |
|
Bugfix canon ( |
|||
|
Never matches a file. A pipeline reads it on purpose. |
The capability manifest of the bugfix pipeline: each tool, its purpose, how to verify it, how to install it, and the fallback. |
|
|
Never matches a file. You are in reference-parity mode. |
Traps when a port must match a reference implementation (the examples are C# to Java): null semantics, defaults, numbers, collections, ordering. |
|
|
Never matches a file. You are in performance mode. |
The measurement that replaces Gate A, the layers to sweep, the finding format. A perf fix without a before and after delta is not FIXED. |
|
Feature canon ( |
|||
|
Never matches a file. A pipeline reads it on purpose. |
The capability manifest of the feature pipeline. Verification is by tool name, not by MCP prefix. |
|
Code quality ( |
|||
|
You change code or configuration: Java, Kotlin, TypeScript, JavaScript, Python, Go, Rust, C#, HTML, Vue, Svelte, SQL, Liquibase changelogs, |
Finish the class, not the instance: the reuse check before you write, and the sweep for the same question answered elsewhere. |
Every FT agent and the main loop |
|
You write or review non-trivial code in Java, Kotlin, TypeScript, JavaScript, Python, Go, Rust or C#. |
SOLID, DRY, KISS and YAGNI as triggers with numeric thresholds. The per-stack standard wins on conflict. |
Whoever writes or reviews matching code; the hook names it to the main loop |
Database ( |
|||
|
You write SQL, migrations or JDBC code in |
Dialect behavior: timezone and timestamp discipline, MySQL specifics, Oracle specifics, cross-dialect discipline. |
Whoever writes matching code; the hook names it to the main loop |
|
You write SQL or code against PostgreSQL in |
PostgreSQL operations: MVCC, migrations without downtime, indexes, types, upsert, locking, pooling. It applies only where a project runs PostgreSQL; the FT product contract is MySQL or Oracle. |
Whoever writes matching code in those paths |
|
You design or review a table, entity, migration or schema in SQL, Liquibase, Alembic, Prisma, SQLAlchemy or a Java entity package. |
How data is laid out: keys, relations, constraints, history, evolution. |
|
Deploy ( |
|||
|
You write or review a |
The two-file build pattern ( |
Whoever writes matching code; the hook names it to the main loop |
|
You write Kubernetes YAML, a |
Kubernetes as a dev-only environment: probe semantics, resources, graceful shutdown, config and secrets. QA and production run plain Docker. |
Whoever writes matching code; the hook names it to the main loop |
Dependencies ( |
|||
|
You edit a dependency manifest: |
Check the current library documentation (the |
The main loop and any agent |
Security ( |
|||
|
You touch auth, secrets, crypto, HTTP endpoints, parsing, SQL, files or dependencies in |
The deep reference behind the blocking baseline of |
Whoever writes matching code; the hook names it to the main loop |
UI/UX ( |
|||
|
You edit a UI file: script, markup or style files such as |
The routing table from a design property to the installed design skill. See UI/UX. |
See UI/UX |
|
The outcome is something a person reads, sees or decides from. The globs cover Java, Kotlin, TypeScript, JavaScript and Python files, among others. |
The Definition of Done for user-visible work. See UI/UX. |
See UI/UX |
Optional: the rules-loader hook (not installed)
deploy/templates/hooks/rules-loader.py is a stricter gate on top of the native loading. A hook is a script that Claude Code runs at a fixed event, here PreToolUse, before a tool call.
The hook predates native loading in Claude Code.
The installers neither copy it nor register it in settings.json. A module loads natively without it.
If you register the hook by hand, it behaves as follows.
| Question | Answer |
|---|---|
Registration |
Copy the file to |
Event |
|
What it does |
It denies the write once and names the modules that govern the file, with their size in KB. It does not paste the modules in. The session reads the modules that its change touches, then retries the write. |
How often |
Once per module per session, and once per standard. It keeps the names already shown in |
Standard |
For |
Who is exempt |
A sub-agent. It arrives with a brief, and a deny in the middle of a pipeline breaks the run. The main loop is the measured gap, so the hook targets the main loop. |
What it skips |
Scratch and build paths: |
Opt out |
A module whose |
Failure |
It fails open. Any internal error exits 0 silently, because a gate that blocks editing when its own state is unreadable gets switched off. |
The hook finds the nearest .claude/rules/ directory above the target file and names its modules in the same deny message.
-
The walk stops at a directory that holds a
.gitentry. This covers a worktree, where.gitis a file. -
A
.claude/rules/directory with no.mdfile is not a canon, so the walk continues above it. -
The personal directory
~/.claude/rulesis never treated as a repository directory. -
A repository glob is matched against the path relative to the directory that holds
.claude/. The globfrontend/js/.jsmatches<repo>/frontend/js/app.js. A*/glob also matches the absolute path. -
The hook matches with Python
fnmatch, so aalso crosses/. In the native loading, astays inside one folder.