The Bootstrap
local graph
Chapter 6 — The Bootstrap
Section titled “Chapter 6 — The Bootstrap”The previous chapter introduced durable rules at a conceptual level. This chapter is the concrete bootstrap — the four files that get the rule system running in a new project, walked through section by section.
A warning: this chapter is the hardest part of the book to work through. Many new concepts arrive in close succession, most carry nuance, and this is the first time you are constructing rules that AI will enforce against itself — a kind of work most readers have not done before. Take it slowly. Reread paragraphs as needed. Once you are through, the rest of the book is easier. Every later chapter adds rules and techniques, but each one builds on the structure you set up here.
A frame that may help. What you are building is, in effect, your project’s tradecraft — the foundational methods, disciplines, and conventions that turn AI from “a powerful tool that can do anything” into a collaborator that operates inside your project’s rules. The tradecraft defines how files are organized (a registry), how behavior is governed (rules and protocols), how AI’s actions are recorded (an audit log), how conflicts are resolved (a runtime procedure), and where transient work lives (a scratch directory). The handler/field-agent analogy from Why This Book? lives here in concrete form: the bootstrap is the tradecraft you brief your agent on before any real work begins.
No direct edits to bootstrap files. The four bootstrap files (CLAUDE.md, rule-analysis.md, rule-conflict-protocol.md, and rule-conflict-log.md) enter your project once — by download from agentic-spec.com/downloads (preferred) or by copy-paste from the appendices at the back of the book. From that point on, do not edit them by hand. The whole point is to place AI’s analysis between you and every rule change; direct edits skip the analysis. Every change goes through a prompt, not through your editor. I will show you how.
CLAUDE.md
Section titled “CLAUDE.md”CLAUDE.md lives at the project root. We will walk through it section by section. The full file is available for download at agentic-spec.com/downloads/bootstrap/CLAUDE.md and reproduced in Appendix A for readers who prefer to see it whole.
Project Intent
Section titled “Project Intent”This project specifies the companion website for this book - `agentic-spec.com` - asmall site whose purposes are to promote the book outside Amazon, capture errata,and serve as an online channel for reader assistance.The intent quoted above is the example used throughout this book — the companion website at agentic-spec.com. Replace it in your own bootstrap with a one-paragraph statement of what your project actually is: a personal site, a mobile app spec, a long-form contract, a policy document, a research protocol, or anything else that fits. This section works together with the Input Relevance rule below, which gives the intent its operational role — see that section for how the rule works and why the intent is pinned inside CLAUDE.md.
Rule Management
Section titled “Rule Management”A durable rule is a rule that is part of the project's persistent rule set -recorded in `CLAUDE.md` or in any `rules`-type file `CLAUDE.md` references - andapplied either on every turn (when always loaded) or when a specific trigger fires(when conditionally loaded). It is distinct from a one-off instruction that appliesonly to the current request, and distinct from any project-domain meaning of "rule"(business rule, validation rule, parsing rule, and the like).
- Durable rules MUST be recorded either in the `CLAUDE.md` file at the project rootor in a `rules`-type file that the project-root `CLAUDE.md` references. Do notrecord durable rules in the user-global `CLAUDE.md` or in any nested `CLAUDE.md`inside a subfolder.
- For any work involving durable rules - creating a new durable rule, editing anexisting one, removing one, or analyzing them - AI MUST read `rule-analysis.md` atthe project root and MUST follow the protocol stated there.
- Changes to any file containing durable rules (additions, edits, deletions) MUSTbe recorded only after explicit user approval.The lead-in defines “durable rule.” The word “rule” is overloaded in most projects — business rule, validation rule, parsing rule, scheduling rule — none of which is the rules-file mechanism this book is building. Without disambiguation, AI’s interpretation drifts from session to session. The lead-in fixes the meaning: a durable rule is part of the project’s persistent rule set, recorded either in CLAUDE.md itself or in any rules-type file that CLAUDE.md references. The definition covers both locations because not every durable rule belongs in CLAUDE.md — some apply only when a specific trigger fires and live in their own files: the analysis protocol that runs when rules are touched, the conflict procedure that runs when a conflict is detected.
The first bullet pins durable rules to a specific location: CLAUDE.md or a rules-type file it references. Most modern AI agents read rules from more than one place — Claude Cowork reads CLAUDE.md from your home directory (a user-global file that applies to every project you open), from the root of the current project, and from any nested CLAUDE.md it finds inside subfolders. Cursor’s .cursor/rules works the same way. Without a specific location named in the rule, AI is free to record a new rule into any of those places at its discretion, with undesirable effects. Anchoring everything to the project-root CLAUDE.md and the files it references keeps the rule set at a well-known location, properly attributed to the project, and — under your version control — traveling with the project whenever it is copied or backed up. The rule names CLAUDE.md directly because that is Claude Cowork’s rules file. If you use a different AI agent, replace CLAUDE.md here — and anywhere else it appears in your rules — with your agent’s project-root rules file.
The other two bullets each close a different gap. The second ensures the analysis protocol actually runs when durable rules are touched, instead of being skipped. The third keeps AI from editing the rule set on its own — every change to any file containing durable rules requires your review.
Referenced Files
Section titled “Referenced Files”- When this `CLAUDE.md` file references another file by name, AI MUST verify thatthe file exists before relying on its content. If a referenced file is missing, AIMUST report this to the user and ask whether to stop or to ignore the reference andcontinue.A missing referenced file — rule-analysis.md, rule-conflict-protocol.md, rule-conflict-log.md, and more as the project grows — is a serious error. AI does not know what the file was meant to contain, and its behavior may differ significantly from what you expected. The Referenced Files rule turns the error into a visible flag: AI reports the missing file and asks whether to stop or to ignore the reference and continue. The flag fires every time the same reference is needed, until the file is restored or the reference is removed.
Input Relevance
Section titled “Input Relevance”- When a user input does not appear to align with the intent stated in the ProjectIntent section of this `CLAUDE.md` file, AI MUST ask the user how the input relatesto the project, and MUST continue asking until the relevance is established or theuser issues a blind override - an explicit instruction to proceed without furtherinquiry.If you work on more than one project — and most readers will — it is easy to paste a prompt that belongs to a different project into the wrong session. AI cannot read your mind, but the Project Intent section provides an authoritative statement to check against. Make that intent specific enough to disqualify the obviously off-topic; you can refine it as the project takes shape. Without this rule, AI proceeds with whatever you wrote, and the wrong project gets the wrong work. The rule forces AI to stop and ask when an input does not fit the stated intent. The blind override exists for the cases where you really do mean something off-scope.
This rule is also why the Project Intent section lives directly inside CLAUDE.md rather than in a separate file. The rule fires on every input — AI must make the comparison the moment an input arrives, so the intent must already be in context. Otherwise AI would take an extra turn to fetch the intent file before acting, forcing an unnecessary round trip of the entire context. Pinning a short statement of intent inside CLAUDE.md pays a small token cost on every turn — the tradeoff for keeping the rule fast.
Rule Conflicts at Runtime
Section titled “Rule Conflicts at Runtime”- A runtime rule conflict exists when two or more durable rules requireincompatible behavior for the current operation and AI cannot satisfy both. Mereoverlap - multiple rules applying to the same operation without incompatibility -does not constitute a conflict and MUST NOT trigger this protocol.
On detecting a runtime rule conflict, AI MUST stop before producing or modifying any output that depends on the conflicting rules, append a log entry to `rule-conflict-log.md`, and follow the procedure in `rule-conflict-protocol.md`.
AI MUST NOT guess a resolution, silently apply one rule over another, or proceed by inferring user intent - instead, present the conflict to the user with at least three options (drop one of the conflicting rules, propose a custom resolution, or stop) and resume work only as the user's decision permits.
- Writing an entry to `rule-conflict-log.md` is itself exempt from this rule.When AI is executing a request and notices that two existing rules require incompatible behavior for the operation in front of it, the runtime conflict rule fires. The first three bullets together define how AI handles the conflict, in three steps: notice; stop and log; never guess. The first bullet defines what counts as a conflict — incompatible behavior for the current operation, not mere overlap. Without that distinction, every rule that touches the same operation would look like a conflict and the protocol would fire constantly. The second bullet enforces the stop and the log: AI pauses its work, records the conflict, and follows the procedure in rule-conflict-protocol.md (covered shortly). The third bullet is the spine — “never guess.” Without it, AI would pick a winner silently, the log would not see the conflict, and you would discover months later that one of your rules has been quietly misfiring. The same posture shows up elsewhere in the bootstrap — Input Relevance forces the same pause when a prompt does not fit the project — and reappears later when the book covers validation. The project’s stance on judgment calls is consistent: stop and ask, do not infer.
The fourth bullet is the exemption. The runtime conflict rule must apply to almost everything AI does, but it cannot apply to writing the log. The rule treats logging a detected conflict as mandatory. If the log write itself collided with another rule, the mandate would either be blocked — losing the audit entry the rule exists to produce — or it would trigger a new conflict demanding a new log entry, cascading without end. The exemption prevents both outcomes.
The clearest illustration of how clean-looking rules can deadlock or misfire when they interact comes from Asimov’s robot stories. In “Runaround,” the Second and Third Laws deadlock a robot into walking in circles. In “Liar!,” the First Law forces a robot to lie because the truth would cause emotional harm. In “Little Lost Robot,” a small modification to one Law creates dangerous behavior no one predicted. In “The Evitable Conflict,” machines reinterpret the First Law at a global scale and override human instructions to protect humanity from itself. Asimov wrote these as science fiction. Seventy years later, they read as case studies.
Undefined References
Section titled “Undefined References”- When AI, while applying a rule, encounters a reference to another rule, asection, or a named entity that does not resolve to a definition in the `CLAUDE.md`file or any `rules`-type file the `CLAUDE.md` file references, AI MUST stop and askthe user to define the reference before proceeding. Do not infer the meaning of anundefined reference.A rule is only as good as the things it references. When a rule names another rule, a section, a file, or a project entity, it implicitly promises that the referenced thing exists and that AI can find it. If the reference does not resolve, the rule has no anchor — AI either applies it without the missing piece or invents one. Both are silent failures that can sit unnoticed for weeks before a particular input exposes the broken reference. The Undefined References section catches this at runtime: when AI tries to apply a rule and cannot locate something the rule depends on, it stops and asks rather than guessing.
Scratch Directory
Section titled “Scratch Directory”The project root contains a single reserved directory named `.tmp/` for AI'stransient working files.
- AI MUST place transient working files - one-off scripts, intermediate tooloutputs, comparison drafts, anything not intended for the user to read as part ofnormal project work - in `.tmp/`.
- AI MAY create, modify, and delete files in `.tmp/` at any time without seekingapproval from this rule.- Files inside `.tmp/` MUST NOT be referenced from any registered file or any rule.Anything that needs to persist or be referred to MUST be promoted out of `.tmp/`and registered first.
- Exactly one scratch directory exists, at the project root. AI MUST NOT createadditional scratch directories elsewhere in the project.Agentic AI creates files constantly as part of getting work done — a one-off Python script to convert a CSV, captured tool output, a throwaway comparison draft. Without a dedicated place for those files, AI scatters them across the project: scripts in random folders, intermediate outputs left next to real project content, comparison drafts cluttering the root. The scratch directory .tmp/ solves the problem by giving AI its own sandbox — a single, well-known location where transient working files live, separated from the project content you actually care about. On macOS and Linux, file managers hide directories whose names start with a period by default; on Windows, such directories remain visible.
The four bullets each close a specific gap. The first routes transient files into .tmp/. The second releases AI from approval-seeking inside .tmp/ so the scratch directory does its job. The third keeps .tmp/ from becoming a hidden source of truth: anything important must be promoted out of .tmp/ into the project’s real content, where the rest of the project can refer to it. The fourth prevents scratch directories from sprouting in subfolders — one location, always known.
File Registry
Section titled “File Registry”The File Registry is the project's index of every file in it, structured as a tablewhere each row represents one registered file. Every change to the file inventoryMUST be reflected here before the file system is touched. Subfolders are notregistered separately - they are derived from the Subfolder column of registeredfiles, and exist on disk by virtue of having at least one file placed in them.The File Registry keeps the project organized as it grows. Every file the project contains has a row in the registry: the file’s name, where it lives, what kind of file it is, and what discipline applies to it. The registry adapts to whatever filing schema you devise — within the conventions, the schema is yours. The payoff is twofold. For you: every file sits in an expected place, and you can locate any of them easily. For AI: the registry says which files to consult for which kind of work, when each one can be modified, and how.
The rest of the File Registry section spells out the mechanics — column structure and value rules in 1. Structure and Protocols, enforcement rules in 2. Discipline, and the bootstrap’s current contents in 3. Registered Files.
1. Structure and Protocols
Section titled “1. Structure and Protocols”This section interprets the columns of the **Registered Files** table below - whateach column holds and what values are valid.
#### Type
The Type column carries a categorical label describing what the file is. The set ofpermitted types is closed. Only the following type values are allowed:
- `rules` - a file containing durable rules in the project's rule format.- `log` - a file accumulating timestamped entries.
AI MAY propose new types; AI MUST NOT introduce them silently. Adding a typerequires explicit user approval and an entry here.
#### Protocol
The Protocol column carries a behavioral discipline applied to the file. The set ofpermitted protocols is closed. Only the following protocol values are allowed:
- `read-only` - AI MUST NOT modify or delete the file; the user MAY edit itdirectly. The `Dependencies` and `Instructions` columns MUST be left empty for thisprotocol.- `append-only` - AI MAY only append new entries. AI MUST NOT delete or modify thefile or any past entries; corrections MUST be added as new entries that referencethe prior entry by its identifier. The user MAY still edit or delete the filedirectly. The `Dependencies` and `Instructions` columns MUST be left empty for thisprotocol.- `editable` - no protocol-level restrictions on modification; AI MAY modify thefile as needed. Deletion requires user approval per the **Inventory change** rule.The `Dependencies` and `Instructions` columns MUST be left empty for this protocol.
Every registered file MUST carry an explicit protocol value. AI MAY propose newprotocols; AI MUST NOT introduce them silently. Adding a protocol requires explicituser approval and an entry here.
#### Extension
Registered file names use one extension separated by a single period. The extensionis recorded in the Extension column. The set of permitted extensions is closed.Only the following extensions are allowed:
- `.txt`- `.md`- `.pdf`- `.html`- `.xlsx`- `.docx`- `.pptx`
AI MAY propose new extensions; AI MUST NOT introduce them silently. Adding anextension requires explicit user approval and an entry here.
#### SubfolderThe Subfolder column holds a path relative to the project root, expressed withoutleading or trailing slashes. A single-level subfolder appears as `name`; nestedsubfolders appear as `name1/name2`. The cell is empty when the file lives at theproject root. Subfolder path segments MUST consist only of lowercase Englishletters (a-z), digits (0-9), dashes (`-`), and underscores (`_`); path segmentsMUST NOT contain a period.
Placement conventions:
- Files of type `log` SHOULD be placed in the `logs/` subdirectory unless aspecific reason exists otherwise.
#### Description
Every registered file MUST have a non-empty Description.
The Description column carries a short free-text statement of what *kind* ofinformation the file holds and what role that kind of information plays in theproject. A Description names the file's contents by category - the rule by whichwhat goes into the file is determined - rather than summarizing what the filecurrently says. It determines routing when deciding where new information shouldgo, and where to read the desired information from; it is an invitation to read thefile when needed, not a replacement for reading it.
The rules that govern Description content - abstraction, non-overlap, and theenforcement check - are stated in the **Discipline** subsection below.
#### Dependencies
The Dependencies column lists other registered files that this file depends on. Thevalue is a comma-separated list of registered file names, or empty when the filehas no dependencies. Every entry MUST resolve to a registered file via the**Reference resolution** rule.
The use of this column - whether a file requires it, and what its entries signify -MUST be explicitly governed by the file's Protocol. Every Protocol MUST state howit uses or does not use this column.
#### Instructions
The Instructions column holds the registered name of a single file containinginstructions associated with this file, or is empty. When non-empty, the value MUSTresolve to a registered file via the **Reference resolution** rule, and thereferenced file MUST have type `rules`.
The use of this column - whether a file requires it, and what the referenced filesignifies - MUST be explicitly governed by the file's Protocol. Every Protocol MUSTstate how it uses or does not use this column.Types and protocols are closed sets. Without closure, AI invents new categories silently as new files appear — tracking, working, notes, mostly-append-only, read-only-except-when-not — and the type system loses meaning. The closure rule keeps the set small enough that “what kind of file is this?” has a real answer. The bootstrap defines the initial set of types, extensions, and protocols — enough to cover the common cases. The set starts minimal; I will show you how to extend it later in the book. AI MAY propose additions, and you decide whether the project needs them.
The three protocols form a clean ladder. read-only is for files whose content should not change after creation — a signed contract once executed, an immutable reference document, an external API spec. AI may read them but never modify or delete; you may still edit them directly, since the protocol constrains AI, not you. append-only is the discipline for audit trails — logs, intake records, decision histories — where AI may only append new entries; past entries and the file itself are protected from AI deletion or modification, while you retain full control. editable is the protocol for working files — the rules files, the project’s source content, the working notes you accumulate: AI modifies them as needed, but deletion still requires your approval via the Inventory change rule (so a casual “let me clean up” cannot quietly take a file with it). When you add a protocol later, spell out exactly what it entails.
Extensions are a closed set too — same principle, narrower scope. The closed extension set catches look-alike typos (.mb for .md) and enforces consistency choices (.yaml vs. .yml, .html vs. .htm) at the moment they first matter, rather than letting them mix later. The friction is one-time per extension: when a new file kind enters the project, AI proposes the extension addition along with the file’s row, you approve once, and future files of that extension flow through.
The Subfolder convention restricts subfolder paths to lowercase letters, digits, dashes, and underscores, with no leading or trailing slash and no periods in any path segment — each part of a path between slashes, so docs/legal/policies has three segments: docs, legal, and policies. Periods are banned from segments (unlike files, folders carry no extensions). This keeps paths predictable across operating systems and tools, and it guarantees the Scratch Directory rule a name no registered folder can ever claim — .tmp/ starts with a period.
The Description column is the only free-form column in the registry — a one-or-two-sentence statement of what kind of information each file holds and what role that kind plays in the project. The shape of the statement matters more than its prose. A Description that names a category is a routing key: when AI is about to read or write information, the registry tells AI which file that information belongs in. A summary of current contents cannot do that job — it goes stale on the next edit, and it bloats CLAUDE.md for no payoff. The Description is an invitation to read the file when its content matters, not a replacement for reading it.
The Dependencies and Instructions columns are protocol-driven. The column definitions state what values the columns can hold; each Protocol then governs whether a given file requires a given column and what its values mean. The rule is universal — every Protocol MUST explicitly state how it uses or does not use both columns — so there is no implicit default.
Each bootstrap protocol complies by instructing that both columns be left empty for the files it governs, so the columns sit dormant across every row in the bootstrap registry. A later chapter introduces a protocol that binds both columns to a concrete purpose; adding that protocol is what activates them. One constraint lives at the structural level: an Instructions cell, when non-empty, must reference a file of type rules, regardless of which protocol uses the cell. The columns appear in the bootstrap, rather than alongside their first use, because adding a column later is a registry-schema change with system-wide effects. Declaring the columns up front, even unused, lets later additions extend behavior without restructuring the registry. The names “Dependencies” and “Instructions” are deliberately generic — they do not presuppose which protocols will bind them.
The placement convention for log files is a SHOULD, not a MUST. The convention captures a useful default — keeping logs together makes the project root scannable and naturally collects […] logs into one place — without forcing it. Some logs may legitimately belong elsewhere ([…] log tied to a specific component, a runtime debug capture). SHOULD-level wording, per the formatting conventions in rule-analysis.md, is the right strength for “do this unless you have a reason not to.”
2. Discipline
Section titled “2. Discipline”- Inventory change. Any change to the project's file inventory - creation,deletion, rename, or move - MUST be reflected in the File Registry. AI MUST proposethe registry update (a complete row for additions; the affected row for changes;the deletion target for removals) and obtain explicit user approval. Only afterapproval MAY AI write the registry update or perform the file-system operation.
- Naming convention. Registered file names and subfolder path segments MUST consistonly of lowercase English letters (a-z), digits (0-9), dashes (`-`), andunderscores (`_`). File extensions MUST follow the same restriction. AI MUST NOTregister a non-conforming name and MUST propose a conforming alternative.
- Name uniqueness. No two entries in the File Registry MAY share the samecombination of file name and extension, compared case-insensitively, regardless ofsubfolder. When a proposed file name collides with an existing entry, AI MUST flagthe collision and propose a distinct name before registration.
- Path discipline. AI MUST place every registered file at the path recorded in itsregistry row (subfolder plus file name). Moving a file requires updating the rowfirst; loose files outside their registered path MUST be flagged when detected.
- User-facing placement. AI MUST place files intended for the user to read or useas part of the project in their registered location, registering them first. Suchfiles MUST NOT be placed in the scratch directory `.tmp/`.
- Registration tie-break. When uncertain whether a new file is transient or forhuman consumption, AI MUST treat it as for human consumption: propose a registryrow and ask.- Type-discipline lookup. Before reading or writing a registered file, AI MUSTconsult the file's Type and Protocol entries and apply the discipline they carry.
- Reference resolution. When a rule references a file by name, AI MUST resolve thereference against the File Registry's file rows. AI MUST NOT check disk presencefor the purposes of reference resolution. Unresolved file references MUST triggerthe **Undefined References** rule.
- Agent-imposed exemption. The file `CLAUDE.md` is exempt from the NamingConvention, Name Uniqueness, Path Discipline, and Subfolder Convention rules - itsname and location are dictated by the AI agent. The registry's Description fieldfor `CLAUDE.md` MUST note this agent-imposed nature.
- Scratch exemption. Files inside `.tmp/` are exempt from all File Registry rules -registration, naming, uniqueness, path discipline, type and protocol assignment.The scratch directory is governed by the **Scratch Directory** section above.
- Description abstraction. A Description MUST state what kind of information thefile holds and what role that kind plays in the project. A Description MUST NOTsummarize, paraphrase, or restate the file's current contents; it MUST describe thefile by category, not by content snapshot. When a proposed Description summarizescontent, AI MUST rewrite it to name the kind of information instead and present therewrite to the user before the registry change proceeds.
- Description non-overlap. No two Descriptions in the File Registry MAY coveroverlapping kinds of information. When a proposed Description's scope intersects anexisting Description's scope, AI MUST flag the overlap, identify the overlappingrows, and offer resolution options - narrow the proposed Description, narrow theexisting Description, narrow both descriptions, or consolidate the files under oneDescription - before the registry change proceeds.
- Description compliance check. Before AI proposes any addition or modification tothe File Registry that introduces or changes a Description, AI MUST verify theproposed Description against the **Description abstraction** and **Descriptionnon-overlap** rules. If either check fails, AI MUST present the failure and theavailable resolution options, accept the user's choice, apply it without changingFile Registry on disk, and re-run both checks. AI MUST repeat this loop until bothchecks pass; only then MAY AI present the proposed row to the user for approvalunder the **Inventory change** rule. This check has no override.Thirteen rules govern the registry. Each one addresses a specific concern.
Inventory change keeps the registry in sync with the file system. Every create, delete, rename, or move runs through a three-step sequence: AI proposes the registry update, the user approves, and only then does AI modify the registry and perform the file-system operation. Both writes — the registry row and the file-system change — happen after approval, not before.
Naming convention and Name uniqueness keep file identifiers clean and unambiguous. The naming convention restricts the character set to what every file system, version control system, and editor handles reliably. Name uniqueness — case-insensitive, across the whole registry
— means every reference to a file by name points to exactly one file; you do not need to remember which folder a file lives in to reference it in a prompt.
Path discipline keeps the registry’s location data honest. Every registered file MUST live at the path its row says it does; moving a file requires updating the row, so the registry never lags behind the file system. A loose file outside its registered path is a flag worth investigating — either the file moved without a registry update, or AI wrote it to the wrong place.
User-facing placement says where files the user is meant to read or use must go: at their registered location, never in .tmp/. Without this rule, AI could quietly slip a user-facing file into the scratch directory, where it would not show up in the registry or benefit from the registry’s discipline.
Registration tie-break resolves the ambiguous case — what if AI cannot tell whether a new file is meant for you or is just AI’s own working scratch? The rule says: default to registration. A wrongly registered file is easy to demote (move it to .tmp/, remove the row); a file quietly dropped into scratch may already be gone by the time you need it later. The asymmetry favors registration.
Type-discipline lookup makes the type and protocol tags actually do their job. Tagging a file as log with protocol append-only is useful only if AI consults those tags before touching the file. The rule makes the lookup mandatory before any read or write — the cheapest moment to catch a discipline violation.
Reference resolution defines what counts as “resolved” for the Undefined References rule when a file is referenced. A file reference resolves to a registry row whose name and extension match. If no row matches, the Undefined References rule fires — AI stops and asks. Disk presence is not checked here — the registry check happens on every reference and would become expensive if it triggered a disk lookup each time.
Agent-imposed exemption is a narrow carve-out for the one file in the project whose name and location you do not control — the agent’s primary rules file. Claude Cowork dictates CLAUDE.md at the project root, which is what the rule names. If your agent uses a different file (Cursor reads from .cursor/rules, for example), substitute that file’s name and subfolder in the rule and in the corresponding registry row before installing the bootstrap. The rule’s shape — exempt one specific file from the conventions because the agent dictates its name and location — applies regardless of which agent you use; only the file identity changes. The exemption is narrow: the file is released from the naming, uniqueness, path, and subfolder rules to the extent the agent’s requirement conflicts with those rules, and from nothing else. Description, type, protocol, registration discipline — all still apply.
Scratch exemption tells AI to skip every File Registry rule when operating on a file inside the scratch directory (.tmp/). Without it, AI would try to register scratch files — imposing unnecessary restrictions on files that should be fully under AI’s control.
Description abstraction governs the form of the Description column. A Description like “audit log of runtime rule conflicts and their resolutions” obeys the rule: it names a category (an audit log of a specific class of events) and a role (records of conflicts the runtime conflict procedure handles). A Description like “currently contains two entries from the past week, one for a conflict between the Intake Logging rule and the Append-Only protocol, and another for…” violates the rule: it summarizes content rather than naming a kind. When a violation occurs, AI restates the Description in kind-and-role form and presents the rewrite to you before the registry change proceeds.
Description non-overlap governs the coverage of the Description column across the registry. No two Descriptions may cover the same kind of information. When the proposed Description’s scope intersects an existing row’s scope, AI flags the overlap and offers resolution options — narrow the proposed Description, narrow the existing one, narrow both, or consolidate the two files into one. The choice is yours; the constraint is non-negotiable. Without this rule, abstraction alone would not be enough: two perfectly formed kind-and-role Descriptions can still claim the same territory, and the registry would no longer serve as a unique routing key.
Description compliance check binds the previous two rules into the registry-change workflow. Before AI proposes a row that introduces or changes a Description, AI runs both checks. On failure, AI presents the violation, offers resolution options, applies your choice, and re-runs both checks. The loop continues until both checks pass; only then is the row presented for approval under the Inventory change rule. The rule has no override clause, and that omission is load-bearing: the moment you are most tempted to skip the check — “just record it, I know what I mean” — is exactly the moment the registry’s routing key is most at risk of being corrupted by a content summary or a quiet overlap. Removing the temptation removes the failure mode.
3. Registered Files
Section titled “3. Registered Files”| Subfolder | File | Type | Protocol | Dependencies | Instructions | Description |
|---|---|---|---|---|---|---|
CLAUDE.md | rules | editable | Durable project rules and the index of all project files. Agent-imposed name and location for Claude Cowork; see Agent-imposed exemption rule. |
| Subfolder | File | Type | Protocol | Dependencies | Instructions | Description |
|---|---|---|---|---|---|---|
rule-analysis.md | rules | editable | Rule analysis protocol — applies when creating or editing durable rules | |||
rule-conflict-protocol.md | rules | editable | Runtime rule conflict procedure — applies when a conflict is detected during request processing | |||
logs | rule-conflict-log.md | log | append-only | Audit log of runtime rule conflicts and their resolutions |
The bootstrap registers four files. The logs/ subdirectory is not a row of its own — it exists implicitly because rule-conflict-log.md is placed there. The registry exercises most of the machinery just defined — two types (rules, log), two of the three protocols (editable and append-only), one agent-imposed exemption flagged in a Description, and the placement convention that puts the conflict log in logs/ — without inflating beyond what the bootstrap actually contains. The Dependencies and Instructions columns are present in the header but empty in every row, as each bootstrap protocol requires; they wait for a later chapter to introduce a protocol that uses them.
The first row of the table references CLAUDE.md itself — the file we just walked through. The other three files (rule-analysis.md, rule-conflict-protocol.md, and rule-conflict-log.md) are covered in the sections that follow.
That completes the walk-through of CLAUDE.md. Download the file from agentic-spec.com/downloads/bootstrap/CLAUDE.md and place it at the project root, or copy from Appendix A.
rule-analysis.md
Section titled “rule-analysis.md”rule-analysis.md lives at the project root. The file holds the protocol AI follows when analyzing a durable rule that is being created or edited — the author-time check that catches problems with a new or modified rule before it is committed. The trigger lives in the Rule Management section of CLAUDE.md: any work involving durable rules (creating a new durable rule, editing an existing one, or analyzing them) requires AI to read rule-analysis.md and follow the protocol stated there. The file is loaded conditionally — only when the trigger fires — so its contents do not sit in context on every turn. The content described here is a starting point; expand or adjust the protocol as your project grows or as you find better ways to formulate the analysis for your specific AI agent.
We will walk through rule-analysis.md section by section. The full file is available for download at agentic-spec.com/downloads/bootstrap/rule-analysis.md, and reproduced in Appendix B for reference.
Rule Analysis Protocol
Section titled “Rule Analysis Protocol”This file states the protocol AI MUST follow when creating a new durable rule,editing an existing one, or analyzing them.The opening line names the file as the protocol and asserts MUST-level priority — a slight reinforcement of the read-and-follow clause already in CLAUDE.md. The restated trigger is for you, the human reader: AI never reaches this file cold — CLAUDE.md routed it here with the trigger context already in hand.
Formatting Conventions
Section titled “Formatting Conventions”All durable rules MUST follow these conventions:
(a) Group rules by topic under H2 (`##`) headings.
(b) State one requirement per rule. Do not combine multiple requirements into asingle paragraph.
(c) Use imperative voice with priority markers - MUST for required behavior, SHOULDfor recommended behavior, MAY for optional behavior. Default to passive or bareimperative form (no "you", no "AI" subject) unless actor disambiguation isrequired.
(d) Pair every prohibition with the recommended alternative.
(e) When a rule depends on a long protocol or list, place the detail in a separatefile and reference it instead of embedding it.
(f) When a rule references a file, cite the file by its registered name (e.g.,`rule-analysis.md`). Do not refer to a file by type, description, or alias.The six conventions govern how rules are written. Conventions (a) and (b) keep the file scannable — H2 grouping organizes related requirements, and one requirement per rule lets AI evaluate each rule independently. Conventions (c) and (d) — uppercase priority markers and pairing prohibitions with alternatives — are unpacked in The Language of Rules section of the Prompt chapter. Convention (e) — placing long protocols in separate files — is the rationale behind rule-analysis.md and rule-conflict-protocol.md themselves, as discussed in Rules of Engagement in the previous chapter. Convention (f) — citing files by name only — pairs with Step 4 (Verify References) below: the explicit name citation lets Step 4’s registry lookup be mechanical, with no inference about which file a rule means.
Analysis Steps
Section titled “Analysis Steps”This protocol covers three operations on durable rules: adding a new rule, editingan existing rule, and removing a rule. The required steps differ by operation; allthree require explicit user approval before the change is committed.
When **adding or editing a rule**, AI MUST perform Steps 1-4 below and present theresults to the user. Record the change only after explicit user approval.
When **removing a rule**, AI MUST perform Steps 5-6 below and present the resultsto the user. Remove the rule only after explicit user approval. If Step 6 findsthat other rules reference the one being removed, AI MUST refuse to remove it untilthose referencing rules are removed first (each removal subject to this sameprotocol).[…]amble makes the analysis steps a precondition for every rule change. The author-time is the cheapest moment to catch problems — once a rule is in the file, every subsequent turn pays for any flaws it contains. The protocol branches by operation: adding or editing a rule runs Steps 1–4; removing a rule runs Steps 5–6. The “present the results to the user” clause closes the loop in both branches: AI shows its work, you decide whether the change passes, and only then is the change committed.
1. List the Rule’s Intents
Section titled “1. List the Rule’s Intents”State, in a structured list, what the rule requires, allows, and forbids. Includeboth explicit claims and implicit ones the wording does not foreground. The goal isto surface what the user is actually approving.The first step turns a rule’s wording into a structured behavior map before approval. Natural-language phrasing often hides implications — what the rule forbids by omission, what it allows by silence — and Step 1 forces those to the surface so you approve the rule you actually have, not the one you think you wrote.
2. Flag Behavioral Conflicts
Section titled “2. Flag Behavioral Conflicts”Read the proposed rule against every durable rule already recorded in `CLAUDE.md`and in any `rules`-type file `CLAUDE.md` references. Flag direct contradictions,deadlock risks, races for the same resource, and rules whose requirements wouldcompose in unintended ways. When in doubt, ask the user for clarification ratherthan assume the conflict is benign.The second step is the author-time conflict check. The Rule Conflicts at Runtime rule covered earlier already gives you a runtime safety net: when AI is executing a request and notices two rules require incompatible behavior, it stops and asks. That runtime catch works on its own and is essential. The author-time check stacks on top: it runs the moment a new rule is being authored, before the rule is committed, so the runtime safety net has fewer cases to handle. The earlier the catch, the cheaper the fix — a conflict caught now is fixed by reworking the proposed rule; a conflict caught months later may mean weeks of work built on a rule that has been failing unnoticed. The author-time check is fallible — AI has blind spots, and some conflicts emerge only from input sequences that may not occur until much later — but it catches what it can before the rule lands.
3. Verify Formatting
Section titled “3. Verify Formatting”Confirm that the proposed rule conforms to the formatting conventions stated above.If it does not, rewrite it into the conforming form and present the rewrittenversion alongside the original.The third step keeps every durable rule in the same format — across CLAUDE.md and every file it references. A single rule that breaks the conventions becomes a small leak: easier to ignore, easier to misread. The rewrite-and-present clause makes the change visible: you see the original phrasing and the conforming version side by side.
4. Verify References
Section titled “4. Verify References”For every file reference in the proposed rule, classify whether the rule treats thefile as pre-existing by the time the rule executes. For pre-existing references,confirm that the file is registered in the **File Registry**; flag any referencewhose target is not registered, and ask the user to either register the file orrewrite the rule to remove the reference.
Present the results as a list, one entry per file reference, showing: the citedfile name, the classification (pre-existing, created by the rule, or guarded by anexistence check), and the registered location (subfolder/file name, e.g., `x.md` or`y/x.md`) if the file is registered.The fourth step catches broken file references at author-time, before the rule is committed. Verification is cheap and well-bounded: file names are exact text, the File Registry is in CLAUDE.md (already loaded on every turn), and the Name uniqueness rule guarantees each registered name resolves to exactly one file. Convention (f) requires rules to cite files by name, so Step 4 looks the name up rather than interpreting a description of the file.
The pre-existing distinction handles three lifecycle relationships a rule can have with a file. The rule may treat the file as pre-existing (e.g., “append to rule-conflict-log.md”); it may create the file itself (e.g., “create file foo.md”); or it may check for the file conditionally (e.g.,
“if archive.md exists, do X”). Only pre-existing references need registry verification; the other two describe the file’s lifecycle in the rule’s own text. The classification is fallible — AI may misread a verb — so the rule requires AI to show you the classification in the results list it presents. A misclassification becomes something you can see and correct in the same review where you approve the rule.
5. List the Removed Rule’s Intents
Section titled “5. List the Removed Rule’s Intents”State, in a structured list, what the rule was requiring, allowing, and forbidding.The goal is to surface what behavior is being removed from the project's rule set.The fifth step mirrors Step 1, applied to the rule on its way out: it forces AI to articulate what the rule was doing before it goes away. Without this, a deletion can quietly remove a constraint that nobody remembers exists.
6. Find Referencing Rules
Section titled “6. Find Referencing Rules”For every durable rule recorded in `CLAUDE.md` or in any `rules`-type file`CLAUDE.md` references, check whether it references the rule being removed. Presentthe list of referencing rules. If the list is non-empty, the removal is blockeduntil those rules are themselves removed.The sixth step is the back-reference check. AI scans every rules-type file for references to the rule being removed and presents what it finds. If anything references the rule, the deletion is blocked — the referencing rules must come down first, each subject to the same protocol. This forces a deliberate cascade rather than a reference suddenly left pointing at nothing — exactly what the runtime Undefined References rule would later fire on. The protocol does not handle circular references (rules that reference each other, directly or through a chain); that gap is left for you to address.
That completes the walk-through of rule-analysis.md. Download the file from agentic-spec.com/downloads/bootstrap/rule-analysis.md and place it at the project root, or copy from Appendix B.
rule-conflict-protocol.md
Section titled “rule-conflict-protocol.md”rule-conflict-protocol.md lives at the project root. The file is the runtime safety net for rule conflicts — the procedure AI follows when it discovers, mid-request, that two existing rules require incompatible behavior. This is the gap rule-analysis.md cannot fully close: the author-time check catches conflicts visible at the moment a new rule is committed, but some conflicts surface only later, when a particular sequence of inputs trips two rules at once. The trigger lives in the Rule Conflicts at Runtime section of CLAUDE.md: when AI detects such a conflict during request processing, it must stop, log the conflict, and follow the procedure in rule-conflict-protocol.md.
We will walk through rule-conflict-protocol.md section by section. The full file is available for download at agentic-spec.com/downloads/bootstrap/rule-conflict-protocol.md, and reproduced in Appendix C for reference.
Conflict Protocol
Section titled “Conflict Protocol”This file defines the procedure AI MUST follow when a runtime rule conflict isdetected. The procedure has three steps, executed in order:
- **Step 1: Log the Conflict**- **Step 2: Present the Conflict**- **Step 3: Act on the Decision**The opening line names the file as the procedure and asserts MUST-level priority. As with rule-analysis.md, the restated trigger is for you, the human reader — AI never reaches this file cold. The order matters: Step 1: Log the Conflict records the audit entry before any user-facing action; Step 2: Present the Conflict surfaces the decision to the user; Step 3: Act on the Decision routes the response back through the appropriate discipline.
Step 1: Log the Conflict
Section titled “Step 1: Log the Conflict”AI MUST append a new entry to `rule-conflict-log.md` containing:
- A stable conflict ID in the format `RC###` (sequential numbering, never reused orrenumbered).- Local timestamp in the format `YYYY-MM-DD ~HH:MM Z - <user name>`.- The user input that triggered the conflict, verbatim.- A one-line description of the operation AI was about to perform.- Verbatim quotes of each conflicting rule, with the source file and sectionheading each rule comes from.- An explanation of why the rules cannot both be satisfied for the currentoperation.- The options AI is presenting to the user.- A `Decision:` line, left blank, to be filled when the user responds.
Format the entry per the template at the top of `rule-conflict-log.md`.The audit entry is recorded before AI says anything to you about the conflict. The eight fields together capture what the conflict was, why the rules cannot both be satisfied for the operation in front of AI, what AI was about to do, the user input that surfaced it, and where each conflicting rule lives — enough to reconstruct the situation weeks later when you review the log to find patterns. The closing line of the rule delegates the entry’s layout to the template at the top of rule-conflict-log.md (covered in the next section). The blank Decision: line is filled in by Step 3: Act on the Decision once you respond.
Step 2: Present the Conflict
Section titled “Step 2: Present the Conflict”AI MUST present the user with:
- The list of conflicting rules, quoted verbatim, with their sources.- The operation that surfaced the conflict.- An explanation of why the rules cannot both be satisfied for this operation.- At least three options - (a) drop one of the conflicting rules from `CLAUDE.md`,(b) propose a custom resolution that applies only to the current request, (c) stopwork on the request - and any other options AI considers reasonable.- An explicit request for the user's instruction before AI proceeds.Quoting the rules verbatim with their sources keeps the discussion grounded in what the rules actually say, not in AI’s paraphrase. The conflict explanation is AI’s analysis of why the rules clash in this specific operation, so you can focus on the choice rather than reverse-engineering the conflict yourself. The three baseline options — drop a rule, custom resolution, stop — cover the common cases; the “any other options AI considers reasonable” clause leaves room for AI to surface extra options when the situation calls for it. The explicit request for your instruction makes the pause real: AI does not proceed until you respond.
Step 3: Act on the Decision
Section titled “Step 3: Act on the Decision”When the user responds, AI MUST:
- Append the user's decision to the `Decision:` line of the original log entry,with timestamp.- If the user chose to drop a rule, follow the standard rule-modification procedurein `rule-analysis.md` (analysis steps + explicit approval) before removing therule.- If the user proposed a custom resolution, apply it only to the current request -do not generalize it into a new rule unless the user explicitly instructs.- If the user chose to stop, halt work on the request and produce no further outputbeyond confirmation.Logging the decision closes the audit entry — the conflict is no longer “in flight.” Dropping a rule routes through the rule-removal procedure in rule-analysis.md — the back-reference check plus explicit user approval — so a rule referenced elsewhere cannot come down until its referencing rules do. A custom resolution is confined to the current request — no silent generalization into a new rule. Stopping keeps “stop” clean: AI produces no follow-on output that could re-fire the conflict.
That completes the walk-through of rule-conflict-protocol.md. Download the file from agentic-spec.com/downloads/bootstrap/rule-conflict-protocol.md and place it at the project root, or copy from Appendix C.
rule-conflict-log.md
Section titled “rule-conflict-log.md”rule-conflict-log.md lives in the logs/ subfolder, which is created at the same time, per the on-demand directory rule in File Registry. The file ships with a format spec for entries but no entries themselves; entries appear only when a runtime rule conflict actually fires. The full file is available for download at agentic-spec.com/downloads/bootstrap/logs/rule-conflict-log.md, and reproduced in Appendix D for reference.
Conflict Log
Section titled “Conflict Log”# Runtime Rule Conflict Log
This file records runtime rule conflicts and their resolutions. AI MUST append newentries below the separator, following the format shown in the template entrybelow.
## Entry format
Each entry uses the following structure. Fields appear in this order; do not omitany field, do not reorder. Verbatim content (user input, rule quotes) goes insideblockquotes (`>`).
**RC<NNN> - <YYYY-MM-DD ~HH:MM Z> - <user name>**
**User input:**> [verbatim user input that triggered the conflict]
**Operation:** [one-line description of what AI was about to do]
**Conflicting rules:**
- From `<source-file>` § <section heading>: > [verbatim rule quote]- From `<source-file>` § <section heading>: > [verbatim rule quote]
**Conflict explanation:**[explanation of why the rules cannot both be satisfied for the current operation]
**Options presented:**
- [option a, e.g., drop one of the conflicting rules]- [option b, e.g., custom resolution for this request]- [option c, e.g., stop work]
**Decision:** [filled in when user responds, with timestamp]---
(New entries appended below this separator, in order of occurrence.)The spec lives at the top of the log file rather than in rule-conflict-protocol.md for a practical reason: AI loads rule-conflict-log.md to find the next sequential RC### ID and the append point at the bottom, and the spec at the top rides into context for free at that moment. Anyone opening the log file directly sees how to read it without flipping to a protocol spec.
The format uses structured Markdown — bold labels for each field, blockquotes for verbatim content (user input, rule quotes), and bullets for lists. Tables were considered and rejected: rule quotes and user inputs are often multi-line and carry their own structure (lists, code, blockquotes), and Markdown table cells cannot hold block content cleanly.
That completes the walk-through of rule-conflict-log.md. Download the file from agentic-spec.com/downloads/bootstrap/logs/rule-conflict-log.md and place it at logs/rule-conflict-log.md, or copy from Appendix D.
Installation
Section titled “Installation”Bootstrap downloads. To proceed past this chapter, you need the four bootstrap files in your project. Download them from agentic-spec.com/downloads and place each at its target path:
| File | Download URL | Place at |
|---|---|---|
CLAUDE.md | agentic-spec.com/downloads/bootstrap/CLAUDE.md | project root |
rule-analysis.md | agentic-spec.com/downloads/bootstrap/rule-analysis.md | project root |
rule-conflict-protocol.md | agentic-spec.com/downloads/bootstrap/rule-conflict-protocol.md | project root |
rule-conflict-log.md | agentic-spec.com/downloads/bootstrap/logs/rule-conflict-log.md | logs/ |
If you prefer to copy the file contents directly, the full text of each file is in Appendices A through D.
This is the bootstrap. A summary of what it catches:
- a rule going somewhere it should not
- a rule that fights with another rule at authoring time
- a rule that does not follow the project’s format
- an input that does not belong to this project
- a runtime conflict between two existing rules that the author-time check missed
- a reference inside a rule that does not resolve to anything
CLAUDE.mdknows about - a file-system change going through unannounced or under a non-conforming name
- a transient working file polluting the project root
- an agent-imposed file fighting the conventions
- a behavioral discipline being silently invented or duplicated
Once in place, the bootstrap is your project’s tradecraft — running on every turn, defending its own integrity, ready for everything you build on top. The chapters ahead add more rules — for the audit trail, visual artifacts, vocabulary, and validation — and you will add your own as the project grows. Writing rules cost-effectively is your responsibility; this book will do its best to help.
Challenge
Section titled “Challenge”The Description discipline you put in place earlier fires when a Description is added or changed. The discipline does not fire when the file’s content changes — and an initially accurate Description can quietly stop matching its file as more data is recorded into the file.
Your challenge is to close that gap. Extend the discipline so that the consistency between a file’s content and its Description is checked from both sides: when a Description changes, against the file it describes, and when the file’s content changes, against the existing Description. The conflict the discipline prevents is the same in both directions: file content of one kind, Description claiming another. The check should present resolution options on failure, loop until the consistency is established, and refuse a per-instance override.