A rule module is a short Markdown file with a list of file patterns. It reaches an agent only when the agent touches a matching file, so a session pays only for the text its work needs. Every full row is on the reference page. Agents and skills are on Claude Toolkit.
ToolkitA module names its files
paths: lists **/package.json
InstallerThe module is copied
install.sh mirrors it to your machine
AgentAn agent reads a file
The Read tool opens package.json
Claude CodeThe pattern matches
No hook takes part
1 MATCH
ContextThe text arrives
dependency-change.md joins the context
3 KB
How a rule reaches an agent
Claude Code does the loading itself. One tool call on one file decides it.
1. A tool touches a file
The Read, Write or Edit tool, or a Bash read such as cat or head on one file.
2. Is the file under the base directory?
A module from ~/.claude/rules/ uses the session's primary working directory as its base. A repository module uses the directory that holds .claude/.
YESGo to step 3.
NONothing loads, even in a sibling worktree.
3. Does a pattern match?
Claude Code checks the file path against the paths: globs of each module.
YESThe module loads.
NONothing loads, and nothing is spent.
4. The text enters the context
Claude Code removes the frontmatter. A very long module arrives cut: see the size limit.
How the 22 modules arrive
11By fileYour file matches, and the module loads. See Which file.
7On purpose, and when you edit an agentA running pipeline reads them. See who reads them.
install.sh mirrors each folder of rules/ here with rsync -a --delete. install.ps1 does the same with robocopy. These modules apply in every project.
<repo>/.claude/rules/**/*.md
A repository carries its own modules here. See Your repository.
The installer refuses when a required module is missing
A mirror from a missing source deletes the installed copy. So the installer stops if delegation-contract.md, common.md, verification-routing.md, run-journal.md or human-sdd.md is absent from rules/agents/.
Which module loads on which file
All modules hold 338 KB. One file brings in only its share. Open a row for the modules behind the bar.
What one file brings in
An orchestrator file: agents/ft-developer.md143 KB
A file under ft-internal-tools/ or ai-agent/ can add postgres.md (16 KB). The file names are examples. Sizes were measured on 2026-11-03.
Module by file kind
Open a row for its purpose and its globs. The full row, with who reads it, is in Rules Reference.
solid dot Solid: every file of that kindhollow dot Hollow or dashed: only some files or paths of that kind
Module
Agent files
Java, Kotlin
TS, JS
Python
Go, Rust, C#
HTML, CSS
SQL, schema
YAML
Shell
Docker
Manifests
agents/
common.md
Shared operating rules for every agent: scoped searches, untrusted input as data, browser checks, reports, permission requests.
Size: 24 KB. Its globs: **/agents/*.md, **/skills/ft-*/SKILL.md
Agent files: every file
context.md
The orchestrator's own context, its sanctioned reset, and where a run leaves its knowledge.
Size: 25 KB. Its globs: **/agents/ft-developer.md, **/agents/bugfix-agent.md, **/skills/ft-dev/SKILL.md, **/rules/agents/context.md
Agent files: some files
delegation-contract.md
How work is split and handed back: the brief, a measurable Definition of Done (DoD), zones, bounds.
Size: 20 KB. Its globs: **/agents/*.md, **/hooks/delegation-gate.py
Agent files: every file
human-sdd.md
The handshake between ft-developer and ft-sdd: the two documents, the human SDD step before the approval gate, the rule that an unchecked human SDD is never presented, and the repair after the commit.
Size: 22 KB. Its globs: **/agents/ft-developer.md, **/agents/ft-sdd.md, **/rules/agents/human-sdd.md, **/deploy/templates/SDD.md, **/hooks/price-gate.py
Agent files: some files
run-journal.md
The append-only journal that records what each checkpoint already proved.
Size: 5 KB. Its globs: **/agents/*.md, **/skills/ft-*/SKILL.md
Agent files: every file
tiering.md
The model and effort of each dispatch. It prices a dispatch and never changes what is verified.
The mandatory review lenses are in rules/agents/verification-routing.md. Quality Pipelines describes how they run.
Which modules never arrive by themselves
Four modules match no file. Seven more match only when you edit an agent, so a running pipeline must read them on purpose.
Four modules that match no file
ft-fix starts a bug run→bugfix/dependencies.md
The capability manifest of the bug pipeline: each tool, its purpose, how to verify it, how to install it, and the fallback. ft-fix Stage 0 is the only place that installs, with consent per item. bugfix-agent in a standalone run uses it for a self-check only.
A port must match a reference implementation→bugfix/parity-checklist.md
bugfix-agent reads it in Phase 1, in parity mode only. It lists the traps: null semantics, defaults, numbers, collections, ordering. The examples are C# to Java.
A bug is about performance→bugfix/perf-checklist.md
bugfix-agent reads it in Phase 1, in performance mode only. It holds the measurement that replaces Gate A, the layers to sweep and the finding format. A performance fix without a before and after delta is not FIXED.
ft-developer starts a feature run→feature/dependencies.md
The capability manifest of the feature pipeline, read at Stage 0. It verifies a tool by its name, not by its MCP prefix. Sub-agents receive the resulting capabilities map and never probe again.
To opt out, use the sentinel. Do not delete paths:
A module without paths: loads at launch in every session. So these four modules hold __explicit-read-only-never-autoload__/**, a value that no file path has.
Seven agent modules: who reads them in a run
Their patterns fire when you edit an agent file, not when an agent runs. A running agent reads them because its prompt says so. "Sub-agents" means the coding agents, the doc writer, verifier and the other agents that receive a brief. Open a row for the moment.
solid dot Solid: reads ithollow dot Hollow or dashed: reads part of it, or only in some runs
Module
ft-developer
ft-fix
bugfix-agent
refactor-agent
Sub-agents
common.md
Every FT agent reads it. Their prompts point to it and do not copy it.
ft-developer: reads it
bugfix-agent: reads it
refactor-agent: reads it
Sub-agents: reads it
context.md
The top-level ft-developer reads it before Stage 2, at Stage 5, at the diff freeze and at Stage 9. The ft-dev shim reads it too. bugfix-agent reads it for turns and the reset. ft-fix-host cites it for the reset and for long waits. A slice child, the leaves and the reviewers do not read it.
ft-developer: reads it
ft-fix: reads part, or in some runs
bugfix-agent: reads it
delegation-contract.md
Every agent that dispatches a Task reads it, and every agent that receives a brief.
ft-developer: reads it
ft-fix: reads it
bugfix-agent: reads it
refactor-agent: reads it
Sub-agents: reads it
human-sdd.md
The top-level ft-developer reads it at Stage 1, Stage 3, after checkpoint D, at Stage 5 and after the commit. A slice child, a split group and a merge instance never run ft-sdd: a split group reads §1 and §4 and writes the path none — design split, a merge instance reads §5's readers and reports delivered not run — split, and a slice child reads nothing. No other agent reads it.
ft-developer: reads part, or in some runs
run-journal.md
The orchestrators write the journal. A sub-agent reads this module when its brief carries the journal path.
ft-developer: reads it
ft-fix: reads it
bugfix-agent: reads it
refactor-agent: reads it
Sub-agents: reads part, or in some runs
tiering.md
ft-developer reads it at Stage 1 and Stage 6. A child in slice mode reads it whole. bugfix-agent reads it before Phase 4. ft-fix and refactor-agent do not read it.
ft-developer: reads it
bugfix-agent: reads it
Sub-agents: reads part, or in some runs
verification-routing.md
ft-fix reads it at checkpoints 1 and 2, ft-developer at checkpoints D and F. bugfix-agent produces the lens ledger that the routing uses.
ft-developer: reads it
ft-fix: reads it
bugfix-agent: reads it
ft-developer also reads db/schema-design.md on purpose, before the data model of a design. No .sql file exists at that moment, so no pattern can fire.
How standards skills and rules relate
A standards skill decides. A rule module explains. On a conflict, the skill wins.
The Java, Angular and Python coding agents preload their skill through skills:. No agent preloads ft-docker-standards. The main loop, your Claude Code session, gets a standard only when it dispatches the skill.
Just-in-time reference and operating canon
Rule module
Claude Code loads it when a file matches paths:, or a pipeline reads it on purpose. It yields on any conflict.
A skill is invisible to paths:
If you edit a .java file in the main loop, its modules load and ft-java-standards does not. Dispatch the skill yourself.
Which standard wins over which module
A conflict in this module
This wins
design-principles.md
ft-java-standards §J16 to §J18, ft-angular-standards §C13
mysql-oracle.md
ft-java-standards §J-DB
schema-design.md
ft-java-standards §J-DB
postgres.md
ft-java-standards §J-DB, where a repository is under it
backend-security.md
ft-java-standards §J20 for code, §J15 for API surfaces
docker.md
ft-docker-standards
The words in design-principles.md are "the per-stack standard wins on any conflict". A portal standards page, such as Java / Spring Boot, is the readable form of its skill. If the page and the skill differ, the skill wins. Report the difference.
Before you edit a standard
Keep the edit consistent with the locked-decisions table in RESUME.prompt.md, at the repository root. Add a rule from repository X only after you compare it with the other repositories and the existing standard.
How a repository adds its own modules
A large in-repo CLAUDE.md can split into modules per subsystem. A session that never touches a subsystem does not pay for its text.
1
Create the file
Write <repo>/.claude/rules/<area>.md. Subfolders are fine: Claude Code finds every .md file below that folder.
You
2
State the predicate in words
Write when the module applies, in one sentence, before you write a glob. The checks are in Writing a rule's paths:.
You
3
List the globs
A glob is relative to the directory that holds .claude/. This one matches <repo>/frontend/js/app.js. A * stays inside one folder, and **/ crosses folders.
.claude/rules/frontend.md
---
paths:
- "frontend/js/*.js"
---
IllustrationThe start of an example module.You
4
Check the size
Replace <area>, then count the characters. The limit is 40,000 characters in a 200K context window, about 39 KB of plain text. In a 1M window it is 150,000, or 200,000 on Opus 4.6 and Sonnet 4.6. Above the limit, Claude receives only the start and a note to read the rest, so split the module. The largest toolkit module, feature/dependencies.md, has 36,577 characters.
bash
wc -m .claude/rules/<area>.md
You
5
Touch a matching file
The module loads at the next tool call on that file. For a sibling worktree, start the session in it or move there with /cd.
Automatic
One repository went from a 344 KB CLAUDE.md in every turn to a 13 KB index plus 13 modules. Its worst single delivery is 56 KB.
Optional: the rules-loader hook
It is not installed, and modules load without it. If you register it, it stops a write once and names the standards skill that paths: cannot reach.
1. The main loop writes a file
The hook runs at PreToolUse, before the tool call. A sub-agent is exempt, and scratch and build paths are skipped.
2. Has the session seen everything that governs it?
The hook checks the matching modules and the stack's standard.
YESThe write passes.
NOGo to step 3.
3. The write is denied once
The denial names the modules with their size in KB, and the standard. It pastes no text.
4. The session retries
It reads what its change touches, dispatches the standard and writes again. Each name appears once per session.
No installer copies or registers deploy/templates/hooks/rules-loader.py. To use it, copy it to ~/.claude/hooks/ and add the settings.json entry yourself. The entry and every condition are in Rules Reference. Its catalogue entry is in Agent Harness Reference.
Questions
Why did no module load for my file?
Check that the file is under the session's primary working directory, and that a glob matches. For Bash, only a read of one file counts, such as cat or head.
Do sub-agents get modules?
Yes. On 2026-11-03 a sub-agent read package.json with the Read tool and received dependency-change.md, with no hook registered. The same read in a sibling worktree brought nothing.
How do I see what loaded?
Run /context for what loaded at launch. To log modules that load later, and why, use the InstructionsLoaded hook of Claude Code.
What if a personal module and a repository module disagree?
Neither overrides the other, so Claude may follow either one. Keep the two consistent.
Where to go next
This page shows the path of a module. These pages hold the rest.