Rules

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.

  1. ToolkitA module names its files

    paths: lists **/package.json

  2. InstallerThe module is copied

    install.sh mirrors it to your machine

  3. AgentAn agent reads a file

    The Read tool opens package.json

  4. Claude CodeThe pattern matches

    No hook takes part

    1 MATCH
  5. 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. 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. 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. 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. 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

  • 11 By fileYour file matches, and the module loads. See Which file.
  • 7 On purpose, and when you edit an agentA running pipeline reads them. See who reads them.
  • 4 Only on purposeThey match no file. See Read on purpose.

Where the modules are installed

  • ~/.claude/rules/<name>/

    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

common.md (24 KB), context.md (25 KB), delegation-contract.md (20 KB), human-sdd.md (22 KB), run-journal.md (5 KB), tiering.md (29 KB), verification-routing.md (18 KB)

Another agent file: agents/verifier.md96 KB

common.md (24 KB), delegation-contract.md (20 KB), run-journal.md (5 KB), tiering.md (29 KB), verification-routing.md (18 KB)

An entity class: src/entity/Foo.java85 KB

convergent-change.md (19 KB), design-principles.md (15 KB), mysql-oracle.md (5 KB), schema-design.md (23 KB), backend-security.md (6 KB), user-visible-dod.md (17 KB)

foo.ts70 KB

convergent-change.md (19 KB), design-principles.md (15 KB), backend-security.md (6 KB), design-skill-routing.md (13 KB), user-visible-dod.md (17 KB)

foo.js64 KB

convergent-change.md (19 KB), design-principles.md (15 KB), design-skill-routing.md (13 KB), user-visible-dod.md (17 KB)

Foo.java62 KB

convergent-change.md (19 KB), design-principles.md (15 KB), mysql-oracle.md (5 KB), backend-security.md (6 KB), user-visible-dod.md (17 KB)

foo.py, main.go51 KB

convergent-change.md (19 KB), design-principles.md (15 KB), user-visible-dod.md (17 KB)

index.html49 KB

convergent-change.md (19 KB), design-skill-routing.md (13 KB), user-visible-dod.md (17 KB)

schema.sql47 KB

convergent-change.md (19 KB), mysql-oracle.md (5 KB), schema-design.md (23 KB)

values.yaml39 KB

convergent-change.md (19 KB), kubernetes-dev.md (3 KB), user-visible-dod.md (17 KB)

deploy.sh, app.properties36 KB

convergent-change.md (19 KB), user-visible-dod.md (17 KB)

styles.css30 KB

design-skill-routing.md (13 KB), user-visible-dod.md (17 KB)

pom.xml9 KB

dependency-change.md (3 KB), backend-security.md (6 KB)

Dockerfile5 KB

docker.md (5 KB)

package.json3 KB

dependency-change.md (3 KB)

README.md, or any file no pattern matches0 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

ModuleAgent filesJava, KotlinTS, JSPythonGo, Rust, C#HTML, CSSSQL, schemaYAMLShellDockerManifests
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.

Size: 29 KB. Its globs: **/agents/bugfix-agent.md, **/agents/ft-angular-coding-agent.md, **/agents/ft-architecture-audit.md, **/agents/ft-coding-agent.md, **/agents/ft-developer.md, **/agents/ft-doc-writer-agent.md, **/agents/ft-fix-host.md, **/agents/ft-java-coding-agent.md, **/agents/ft-ops.md, **/agents/ft-python-coding-agent.md, **/agents/ft-test-adversary.md, **/agents/ft-ui-ux-design.md, **/agents/refactor-agent.md, **/agents/tr-doc-writer.md, **/agents/verifier.md, **/skills/ft-decide/SKILL.md, **/skills/ft-dev/SKILL.md, **/skills/ft-fix/SKILL.md, **/skills/ft-refactor/SKILL.md, **/rules/agents/tiering.md, **/hooks/decide.py

Agent files: some files
verification-routing.md

Which review lenses run at each checkpoint, and which always run.

Size: 18 KB. Its globs: **/agents/*.md, **/skills/ft-fix*/SKILL.md, **/rules/agents/*.md, **/hooks/diff-router.py, **/hooks/route-schema.json, **/hooks/verify-gate.py

Agent files: every file
code-quality/
convergent-change.md

Finish the whole class of change: the reuse check before you write, the sweep after.

Size: 19 KB. Its globs: **/*.java, **/*.kt, **/*.ts, **/*.tsx, **/*.js, **/*.jsx, **/*.py, **/*.go, **/*.rs, **/*.cs, **/*.html, **/*.vue, **/*.svelte, **/*.sql, **/changelog*.xml, **/*.properties, **/*.yml, **/*.yaml, **/*.sh, **/*.ps1

Java, Kotlin: every fileTS, JS: every filePython: every fileGo, Rust, C#: every fileHTML, CSS: some filesSQL, schema: every fileYAML: every fileShell: every file
design-principles.md

SOLID, DRY, KISS and YAGNI as triggers with numeric thresholds.

Size: 15 KB. Its globs: **/*.java, **/*.kt, **/*.ts, **/*.tsx, **/*.js, **/*.jsx, **/*.py, **/*.go, **/*.rs, **/*.cs

Java, Kotlin: every fileTS, JS: every filePython: every fileGo, Rust, C#: every file
db/
mysql-oracle.md

Dialect behavior of MySQL and Oracle. It applies to SQL, migrations and JDBC code.

Size: 5 KB. Its globs: **/*.sql, **/*.java, **/resources/**/*.xml

Java, Kotlin: some filesSQL, schema: every file
postgres.md

PostgreSQL operations, only where a project runs PostgreSQL. The FT product contract is MySQL or Oracle.

Size: 16 KB. Its globs: **/ft-internal-tools/**/*.sql, **/ft-internal-tools/**/*.ts, **/ft-internal-tools/**/*.js, **/ft-internal-tools/**/compose*.y*ml, **/ai-agent/**/*.sql, **/ai-agent/**/*.java, **/ai-agent/**/*.py, **/ai-agent/**/*.ts, **/ai-agent/**/*.y*ml

Java, Kotlin: some filesTS, JS: some filesPython: some filesSQL, schema: some filesYAML: some files
schema-design.md

How data is laid out: keys, relations, constraints, history, evolution.

Size: 23 KB. Its globs: **/*.sql, **/changelog*.xml, **/db/migration/**, **/db/changelog/**, **/models/**/*.py, **/models.py, **/migrations/**/*.py, **/alembic/**/*.py, **/schema.prisma, **/*.mako, **/entity/**/*.java, **/entities/**/*.java, **/domain/**/*.java, **/model/**/*.java

Java, Kotlin: some filesPython: some filesSQL, schema: every file
deploy/
docker.md

The two-file build pattern, base images, image hygiene and registry tagging.

Size: 5 KB. Its globs: **/Dockerfile*, **/*.j2, **/*.tpl, **/*.tmpl, **/docker-compose*.yml, **/.dockerignore

YAML: some filesDocker: every file
kubernetes-dev.md

Kubernetes as a dev-only environment. QA and production run plain Docker.

Size: 3 KB. Its globs: **/*.yaml, **/*.yml, **/Chart.yaml, **/kustomization.yaml

YAML: every file
deps/
dependency-change.md

Check the current library documentation before a manifest edit lands.

Size: 3 KB. Its globs: **/pom.xml, **/build.gradle*, **/settings.gradle*, **/package.json, **/requirements*.txt, **/pyproject.toml, **/Pipfile, **/go.mod, **/Cargo.toml, **/*.csproj, **/Gemfile, **/composer.json

Manifests: every file
security/
backend-security.md

The deep reference behind the blocking security baseline. A violation is a blocking [MUST-FIX] review finding.

Size: 6 KB. Its globs: **/*.java, **/*.ts, **/*.xml, **/pom.xml, **/build.gradle*

Java, Kotlin: some filesTS, JS: some filesSQL, schema: some filesManifests: some files
ux/
design-skill-routing.md

Which design skill answers which design property. See UI/UX.

Size: 13 KB. Its globs: **/*.js, **/*.mjs, **/*.cjs, **/*.jsx, **/*.ts, **/*.tsx, **/*.vue, **/*.svelte, **/*.astro, **/*.html, **/*.htm, **/*.css, **/*.scss, **/*.sass, **/*.less, **/*.styl, **/*.mdx

TS, JS: every fileHTML, CSS: every file
user-visible-dod.md

The Definition of Done for work that a person reads, sees or decides from. See UI/UX.

Size: 17 KB. Its globs: **/*.java, **/*.kt, **/*.ts, **/*.tsx, **/*.js, **/*.mjs, **/*.cjs, **/*.jsx, **/*.py, **/*.go, **/*.rs, **/*.cs, **/*.html, **/*.vue, **/*.svelte, **/*.scss, **/*.css, **/*.properties, **/*.yml, **/*.yaml, **/*.sh, **/*.ps1

Java, Kotlin: every fileTS, JS: every filePython: every fileGo, Rust, C#: every fileHTML, CSS: every fileYAML: every fileShell: every file
A module does not change what a pipeline verifies

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

Moduleft-developerft-fixbugfix-agentrefactor-agentSub-agents
common.md

Every FT agent reads it. Their prompts point to it and do not copy it.

ft-developer: reads itbugfix-agent: reads itrefactor-agent: reads itSub-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 itft-fix: reads part, or in some runsbugfix-agent: reads it
delegation-contract.md

Every agent that dispatches a Task reads it, and every agent that receives a brief.

ft-developer: reads itft-fix: reads itbugfix-agent: reads itrefactor-agent: reads itSub-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 itft-fix: reads itbugfix-agent: reads itrefactor-agent: reads itSub-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 itbugfix-agent: reads itSub-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 itft-fix: reads itbugfix-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.

Authoritative per stack

Standards skill

ft-java-standardsft-angular-standardsft-python-standardsft-docker-standards

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 moduleThis wins
design-principles.mdft-java-standards §J16 to §J18, ft-angular-standards §C13
mysql-oracle.mdft-java-standards §J-DB
schema-design.mdft-java-standards §J-DB
postgres.mdft-java-standards §J-DB, where a repository is under it
backend-security.mdft-java-standards §J20 for code, §J15 for API surfaces
docker.mdft-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. 1

    Create the file

    Write <repo>/.claude/rules/<area>.md. Subfolders are fine: Claude Code finds every .md file below that folder.

    You
  2. 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. 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. 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. 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. 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. 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. 3. The write is denied once

    The denial names the modules with their size in KB, and the standard. It pastes no text.
  4. 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.

Agents and skillsWho uses what in Claude Toolkit.
Hooks and installed filesEverything the installers place in Agent Harness.
What a dispatch costsThe cost rules in Dispatch Economy.
Rules Reference