# Bootstrap Hygiene
<!--
ref: @protocol/bootstrap-hygiene
version: 2
updated_at: 2026-10-26T04:23:39.541Z
-->
What belongs in each layer of the context a session loads before the user types, and how to keep each layer lean. Read it before adding anything that loads every session: a bootstrap row, a route, a global-config rule, or a memory-index line.
## The rule
**Every session pays for every byte of the base, on every turn.** So the base holds only what is a *trunk*: knowledge most sessions in that layer need, plus an index that tells the reader what exists deeper and when to fetch it. Everything else is a branch fetched at the moment of need (`@protocol/information-tree`). A good base doesn't make the reader know everything. It makes sure the reader knows what they don't know.
## The layers: put each fact in the narrowest one that still reaches every reader who needs it
| Layer | Loads for | Belongs here | Never here |
|---|---|---|---|
| **Universal core** (`@protocol/bootstrap-core`) | every user's every session | how to find, fetch and write back; context discipline; universal working norms | one person's preferences, routes, projects |
| **Personal core** (`@<user-repo>/bootstrap`) | every session of one user | that user's routing table (situation → ref), standing preferences, corrections that apply everywhere | universal practice (promote it to the core); one project's or topic's detail |
| **Agent includes** (extra rows in the bootstrap config) | sessions of one agent or lane | that agent's mission and voice | anything every agent needs |
| **Topic** (`bootstrap?topic=<name>`) | sessions that ask for it | a domain's routes and vocabulary (business, development, personal) | material every session needs |
| **Project entry** (`bootstrap?include=@<repo>/<entry>`) | sessions in one project | that project's conventions and traps | cross-project rules |
| **Harness global config** (`CLAUDE.md`, `AGENTS.md`) | every session on one machine | only what must work *before* the bootstrap is fetched: the instruction to bootstrap, and machine-only hazards | anything fetchable; restating bootstrap content |
| **Harness memory index** (`MEMORY.md` and kin) | every session in one harness project | one line per item that is genuinely about this machine, or a capture awaiting migration | portable knowledge (`@protocol/memory-routing`): that goes to a protocol |
The test for any line: *if I deleted it, which session would fail, and would that session have fetched the branch anyway?* If no session fails, cut it. If a session fails but it's one topic or project, move it down a layer. If most sessions fail, it stays as trunk.
## Routes, not copies
A layer carries a **route**, one row of *when you … → fetch `@ref`*, rather than the knowledge itself. The trigger names the moment in words the reader will be in ("about to save a memory", "the context feels overweight"). The ref does the teaching. A route costs one line; a copied paragraph costs a paragraph on every turn and drifts from its source.
When a standing instruction arrives from the operator ("this is how to do X"), it goes **into the protocol that owns X in the same turn**, or a new one if none does. Then it gets a route in the narrowest layer that reaches its readers. It is never left only in chat or local memory. An instruction the operator has to repeat is a missing protocol, not a forgetful agent.
## Keeping it lean: the passes and where they live
| Symptom | Fetch |
|---|---|
| Composed bootstrap over ~15k tokens | `@protocol/tighten-bootstrap-token-budget` |
| An include unread for 14+ days | `@protocol/retire-unused-bootstrap-include` |
| Adding, demoting or confirming a bootstrap row | `@protocol/bootstrap-edit` |
| Whole session base heavy: harness config, memory index, tool schemas, listings | `@protocol/context-tuning` (measure first; keep-test; deconstruct into a tree) |
| About to save a memory | `@protocol/memory-routing` (portable → protocol; local is the exception) |
| Explaining the same thing across sessions | `@protocol/promote-recurring-explanation` |
| Periodic sweep of all surfaces | `@protocol/groom-protocols` §The surfaces |
## Signs a layer has gone wrong
- **Memory index as shadow bootstrap.** The harness memory index grows one line per lesson and ends up bigger than the personal core. That's portable knowledge stranded in the wrong layer. Migrate it to protocols and leave a route.
- **Promotion by accident.** A one-project rule lands in the personal core because that's where the agent was writing. Move it down.
- **Mirror.** Global config restates a bootstrap section "to be safe". The two drift apart; keep one and route to it.
- **Silent growth.** Nobody measures the composed size after an edit. Measure before and after every pass (`@protocol/context-tuning` §Then measure the after state).
- **Cut delivery.** The layers are right but the reader never sees the back half. Measured 2026-10-25: half of one fleet's sessions piped the bootstrap through `head` and booted without the personal core (routes, standing preferences), which sits last. Grade the outcome, not the command: does the bootstrap's last heading reach the context? A harmless pipe (`head -c 50000`) passes, `head -80` fails. A post-tool hook that checks for that heading and names the re-fetch call fixes it where the rule in the text did not.
- **Near the inline limit.** A harness inlines only so much tool output (Claude Code's Bash: 30000 chars), and past that a whole fetch arrives as a file preview, which silently cuts it for every session at once. Keep the composed bootstrap well under the limit, and alarm before it gets there, not after.
- **Every subagent pays the session base.** Subagents load the harness config and the memory index too, and often the bootstrap because a brief or the config says "bootstrap first". A one-task worker needs its brief, not the base. Keep machine hazards in the harness config short, and give the subagent what it needs in the brief.
---
*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*
*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*