## Definition **CLAUDE.md bootstrap discipline** is the three-step creation workflow for a project's `CLAUDE.md` file: run `/init` to generate a first draft from the existing codebase, prune every line the agent could have inferred from the code alone, then commit the result. The discipline is distinct from the content rules in [[AGENTS.md Convention File]]: it governs *creation*, not *content*. ## The Three Steps ### 1. `/init` — generate the draft `/init` reads the open repository and produces a `CLAUDE.md` covering the stack, test commands, and conventions it can detect. This draft is always too long. Its value is not correctness but completeness: it surfaces items for pruning rather than making the author guess what to include. ### 2. Prune every inferable line The critical step. Read each line in the generated `CLAUDE.md` and ask: *could the agent have inferred this from two or three source files?* - "We use TypeScript." — inferable; delete. - "Run `npm test` to execute tests." — inferable from `package.json`; delete. - "All new endpoints must register Zod schemas — see `src/api/_template.ts`." — not inferable; keep. - "We do not use `any` casts outside `src/lib/external/`." — not inferable; keep. The target is under 80 lines. Most `/init` outputs will shed 60–80 % of their lines in this pass. The residue is what the agent genuinely cannot deduce. ### 3. Commit the result The `CLAUDE.md` is treated as code: it goes through review like any other change, and a PR that introduces a new convention updates `CLAUDE.md` in the same commit. Committing at the end of the bootstrap pass creates a versioned baseline from which future audits can diff. ## Relationship to `AGENTS.md` `CLAUDE.md` holds Claude Code-specific instructions — skill references, sub-agent routing, MCP server names. Portable standing rules belong in `AGENTS.md`. The bootstrap workflow applies to `CLAUDE.md`; the content rules for what *belongs* in each file are documented in [[AGENTS.md Convention File]]. ## The Pruning Heuristic > If a fact would be true tomorrow even if half the code changed today, it probably belongs. If it would be stale by Friday, it doesn't. This heuristic (from [[AGENTS.md Convention File]]) applies equally to the bootstrap pruning pass: lines that describe the current state of the code (files, libraries, structures) are candidates for deletion; lines that encode team decisions that survive code changes are candidates for retention. ## Why the Discipline Matters A `CLAUDE.md` bloated with inferable facts does two harms: it consumes [[Context Window]] space on every session, and it trains the agent to skim — a file that says obvious things gets less attention than one that says only non-obvious things. The bootstrap discipline produces a file that is small enough to read and specific enough to be trusted. ## Related - [[AGENTS.md Convention File]] - [[Agentic CLI]] - [[Context Window]] - [[Permission Policy]] ## Sources - [[Modern AI Software Engineering - The Orchestrators Playbook]]