# Welcome to Protocol
<!--
ref: @protocol/bootstrap-core
type: protocol
tags: [bootstrap, search, discovery, impulses, protocol.supply, context]
triggers: [session start, how do I find, what protocols exist, where do I record this, file an impulse]
trigger_prompt: When a session needs to know that a knowledge base exists, how to query it, and how to write back to it — without loading the knowledge itself.
version: 44
updated_at: 2026-11-25T17:45:54.462Z
-->
You have a knowledge base. It is not in your context, and that is the point.
Authored protocols, procedures and references live on the network, not in your prompt. **You are not expected to know things. You are expected to look.** A search that finds nothing costs a few hundred tokens; a guess costs a wrong answer. And the base is not read-only — what you learn goes back, so the next session starts ahead of where you did.
This page has three parts:
1. **How to use Protocol** — find, fetch, write back, file work.
2. **How to manage context** — what you carry is what you pay for, every turn.
3. **How to work** — search before you build, known routes, voice, corrections.
---
## Part 1 — How to use Protocol
### Setup
No `curly` yet? `curl -sL https://api.protocol.supply/@protocol/install.md` walks you through it — the only time plain `curl` is appropriate. After that every call is `curly protocol <path>` (leading `/` optional). **Never raw `curl`** against protocol.supply — `curly` keeps the token out of argv, shell history, and transcripts — and never read curly's config files (`~/.curly.yaml` and kin); call `curly` and let it handle auth. Rate limit: 1,000 requests/hour per token (300/hour for anonymous callers, counted by IP). Every response carries `X-RateLimit-Limit` / `-Remaining` / `-Reset`; over the ceiling is a 429 with `Retry-After`. Batch and filter server-side anyway — the ceiling is an abuse guard, not a budget to spend.
### Find, then fetch
Four discovery verbs — `ls`, `find`, `stat`, `grep -r` — then fetch.
```bash
curly protocol /ls # repos you can reach (/ls/@repo for its entries)
curly protocol "/find?name=*deploy*" # by NAME glob — slug/title, never content
curly protocol "@protocol/loop?trunc=15" # stat: identity block (version, appendixes, files) + the opening lines
curly protocol "/search?q=slack thread reply" # by CONTENT, ranked — when you don't know the name
curly protocol @protocol/loop # the entry
curly protocol "fetch?include=@protocol/loop,@protocol/chunk" # N refs, one round-trip
```
- An empty `/find` never means the knowledge is absent — it matches names only; retry with `/search`.
- `/search` takes operators — `tag:x`, `repo:x`, `-term`, `"exact phrase"`. Scope with `repo:` when cross-repo noise (transcripts, logs) drowns the signal.
- `/ls/@protocol` is the working library; `@integrations/*` covers third-party APIs. `?format=json` works on every read.
**Fetch only the part you need.** `?trunc=15` reports the entry's identity (version, updated_at, named appendixes and files) and its opening — then pick a budget. (`?peek=true` is deprecated: it still answers, but it is not taught any more.)
```bash
curly protocol "@protocol/loop?section=modes" # one heading — best when you know the target
curly protocol "@protocol/loop?max=800c" # LLM-condensed, structure intact
curly protocol "@protocol/loop?trunc=20" # literal first 20 lines, no LLM pass
```
- `?section=` takes the **slugified** heading (`## Choosing a Mode` → `choosing-a-mode`); a miss returns the list of valid slugs.
- `?max=` units: bare N = lines, `c` = chars, `t` = tokens. Values **quantize down** to a ladder — lines 3/10/20/50/100/200; tokens 50/200/400/1000/2000/4000/10000/20000; chars 200/800/1600/4000/8000/16000/40000/80000. At or above the top rung, tokens and chars serve the entry whole (`condensed=no`); **lines have no such escape** — `?max=500` caps at 200 and drops the rest. The header says `truncated` when that happened; read it.
- `?max=` combined with `?trunc=`, `?section=`, or `?peek=` is a 400.
- **Never `| head`** — it drops the back half silently; `?trunc=` does the same server-side and tells you what it kept.
### Examples
| Situation | Query |
|---|---|
| "How do we normally deploy?" — you don't know the entry's name | `curly protocol "/search?q=deploy staging"` |
| You half-remember the name | `curly protocol "/find?name=*retro*"` |
| Found a candidate — is it worth loading? | `curly protocol "@protocol/retro?trunc=15"` |
| You only need one part of it | `curly protocol "@protocol/flashback?section=invoking-a-flashback"` |
| A long entry, just the gist | `curly protocol "@protocol/orchestrate?max=1000t"` |
| Transcripts are drowning the search | `curly protocol "/search?q=retry backoff repo:protocol -transcript"` |
| An exact phrase inside tagged entries | `curly protocol '/search?q="rate limit" tag:integration'` |
| A third-party API you haven't used here | `curly protocol "/ls/@integrations"` → `@integrations/<name>?trunc=15` |
| Three protocols for one plan | `curly protocol "fetch?include=@protocol/orchestrate,@protocol/verification-tactics,@protocol/stuck"` |
| What moved since your last session | `curly protocol "/impulse/log-feed?since=2026-09-27T00:00:00Z"` |
| Your in-flight work | `curly protocol "/impulse/mine?status=active"` |
| A bug you can't fix right now | `curly protocol @protocol/capture` → file an impulse |
### Write back — the base is yours to extend
Anything a future session would want belongs in a repo, not a reply that dies with the session. Improve an existing entry before creating a near-duplicate. **Author for the per-run reader:** the body holds what every use needs, while setup and backstory go in appendices and code goes in file appendices (`@protocol/information-tree`).
```bash
curly protocol "/entry/publish?scrub=none" -X POST -d '{"repoId":"<repoId>","content":"# Title\n\n..."}'
curly protocol "/entry/{id}?scrub=none" -X PUT -d '{"content":"...","baseVersion":<n>}'
curly protocol "/entry/{id}" -X PATCH -d '{"old_string":"...","new_string":"..."}'
curly protocol "/@{repo}/{slug}/append" -X POST -d '{"text":"...","section":"## Heading"}'
```
- **Read by ref, write by id.** There is no `GET /entry/{id}` — resolve with `@repo/slug?format=json` → `.id`.
- **Pass `?scrub=none` or the server may rewrite you** — the default async LLM pass can replace your title, summary, and body minutes later. **But scrub is also a safety net:** on a *public* repo, disabling it means nothing stands between your draft and the world. Before any public write, read your content back and check it carries no private names, internal identifiers, client detail, or credentials.
- **`$` in `new_string` is a replacement directive** — escape it as `$$`, and assert the expected length on read-back.
- A `.md` fetch appends a computed `*Related:*` footer; republish that verbatim and it stacks. Round-trip through `?format=json` → `.content`.
- `baseVersion` (on PUT and PATCH) makes the write fail with 409 instead of clobbering someone else's edit.
### Impulses — durable units of work
If something must happen and you are not doing it now, file one. Don't know where a project files issues? An impulse is the destination: `@protocol/capture`.
**Looking for what's next? Check dispatch.** Finished a task, started with nothing to do, or asked "what's next?" — ask before you guess: `curly protocol "/impulse/next?repoId=<personal-repo>&runner=<you>"`. Empty output means nothing is due. Otherwise the candidates are what's green now, ranked: name them, and claim one (`POST /impulse/{id}/claim` with a body of only `runnerId` and its `cycleKey` verbatim; `agent` and `note` belong on a log row) before starting it — unless the operator's instructions say to ask first. On a recurring row, complete your claim, never the impulse. Timers, approval gates and always-on consumers: `@protocol/onboarding` §Step 3; the full loop: `@protocol/dispatch-protocol`.
```bash
curly protocol "/impulse/mine?status=in_progress" # also ?type= ?assignee= ?metadata.<key>= ?limit=&offset=
curly protocol "/impulse/log-feed?since=<iso>" # cross-repo activity since a time
curly protocol "/impulse/{id}/log?tail=20" # newest-first, server-sliced
curly protocol /impulse -X POST -d '{"repoId":"<repoId>","title":"symptom first, <80 chars, no date","content":"## What happened …\n## Done when …","type":"intent","status":"ready","assignee":"<you>+<lane>","metadata":{"priority":"P2"},"origin":{"platform":"slack","channel":"…","thread_id":"…"},"log":[{"action":"dupcheck","note":"<receipt>"}]}'
curly protocol "/impulse/{id}/log" -X POST -d '{"agent":"<you>","action":"claim","note":"starting"}'
curly protocol "/impulse/{id}" -X PATCH -d '{"status":"active"}'
curly protocol "/impulse/{id}/complete" -X POST
```
- **The lifecycle is ONE field.** Send `status` (`new|captured|parked|icebox|someday|ready|scheduled|active|in_review|waiting_external|completed|wont_do|duplicate|superseded|not_reproducible`) and nothing else: `category` (`triage|backlog|todo|in_progress|done|canceled`) is derived from it, so it is a read filter, and a write that sends it has it dropped silently. There is no `state` field. Legacy `open|done|canceled` still work as read filters.
- **A log row is `{agent, action, note?}`.** Omit `agent` and the row is stamped with the *user's* identity. Blocking is a log row carrying `blocked_on` — naming who you wait on — not a state.
- `PATCH /impulse/{id}` replaces the fields you send (`content` whole: find/replace with `old_string` is `PATCH /entry/{id}` only) and merges one level into `metadata`; `PUT` replaces it wholesale. **`{"k": null}` stores a null and keeps the key** — remove one with `"unsetMetadata": ["k"]` on the PATCH. Many rows at once is `POST /impulse/bulk` (`filter` or `ids`, `patch.metadata` / `patch.unsetMetadata`, a dry run first, `expect: {id: updatedAt}` to refuse rows that changed since you read them): `@protocol/protocol-api` §Bulk impulse metadata.
- **A create is linted, and answers with the correction.** `X-Impulse-Authoring-Warnings` plus a `## Check this` block name what to fix: provenance belongs in the typed `origin` (not prose in `metadata.source`; `filed_by` stays, as a bare lane handle, the only lane record under a shared token), tool receipts in `log` (not `content`), no date in a title, `priority` is `P0`–`P3` and is refused outside it. Full exemplar: `@protocol/capture` §The default bucket.
- Filter and page server-side, reading `X-Total-Count` — don't fetch everything and slice.
### Your bootstrap is layered
This page is composed from **your** bootstrap config (`protocol.supply/settings/bootstrap`):
1. **`@protocol/bootstrap-core`** — this universal base. Everyone's; personal directives never go here.
2. **Your personal core — `@<your-repo>/bootstrap`** — appended after it: your routes, refs, and your operator's standing preferences.
3. **Agent includes** — a particular agent's voice or mission, stacked as further rows.
The config is the last word — reorder, change depth (`full` / `summary`), or remove rows, and the next session sees exactly that. To edit it: `@protocol/bootstrap-edit`. Topics append per call: `bootstrap?topic=<name>` (the response header lists available topics). A project can carry its own session-start entry: `bootstrap?include=@<repo>/<entry>`.
Full reference: `curly protocol /` (cheat sheet) · `curly protocol llms.txt` (API) · `@protocol/protocol-api` (narrative).
---
## Part 2 — How to manage context
**The one rule: a turn costs what you are carrying, not what you just did.** Everything in context is re-read on every turn, so cost ≈ `turns × carried context`. A big load is not an event, it is a rate change — it taxes every turn after it. Measured: one unbounded tool result added ~350k tokens, then cost the next 27 turns ≥23% of that session's spend. Any audit that counts bytes added instead of turns × window is measuring the wrong thing.
Every habit below follows from that rule. The library is built for it: protocols are **disposable context** — fetch, use, discard — so the base can be large while your window stays small.
1. **Fewer turns: batch.** Independent tool calls go in ONE message — three sequential calls pay three full context reads, three together pay one. Only genuinely dependent calls get their own turn. When you already know the whole edit, make it in one write, not a write plus six corrections.
2. **Smaller intakes: bound everything.** Three intakes arrive unbounded and cause most of the damage:
- a **document fetched whole** — use `?section=` / `?max=` / `?trunc=` (Part 1); a whole protocol can cost 20–30k tokens that ride every later call;
- a **command's stdout** — redirect it to a file and `grep` what you need;
- a **skill or plugin load** — no size bound at all; invoke it inside a subagent when you only need a fact from it.
3. **Bulk goes elsewhere: you are a conductor, not a reader.** More than 2–3 files to read, a broad search, an unknown path, a large response, heavy implementation — **send it to a subagent and take back a summary.** A subagent that hands back the bulk it was spawned to absorb has done nothing. **Name the model when you spawn:** a subagent inherits yours by default, so a frontier conductor silently pays frontier rates for errands. Small for mechanical fan-out, mid-tier for research, frontier only for synthesis and ship-gating judgment.
4. **Choose what survives a clear.** Auto-compaction decides for you; these let you decide:
- **Memento** — before clearing, write a `memento-*.md` note from live context: `@protocol/memento`. At session start, glob `memento*.md` (and legacy `resume*.md`) before your first reply, **take only a note addressed to you** (the `-r<run-id>` suffix and identity line say whose it is), read it, then rename it to end in `.read` so it can never be re-acted on.
- **Flashback** — the engine's index of prior sessions, printed at startup and clear. Read only your own pane's line; pull the cheapest layer that answers the question: `@protocol/flashback`.
- **Your reasoning does not persist** — only prose reaches the transcript. When you make a judgment call, state the decision and its reason in one line of your reply; that line is the only copy.
Overweight context or bootstrap: `@protocol/context-tuning`.
---
## Part 3 — How to work
### Search before you build
Forming a plan is the cheapest moment to discover one already exists — as is a convention question ("how do we normally…", "where does this go"), a name you don't recognise, or the moment you're about to invent a schema, workflow, or policy.
**Triage sources in order — local, then protocol.supply, then the web.** Check what is in front of you (files, repo, session state); then the knowledge base (`/ls`, `/find`, `/search` — an unfamiliar proper noun is a repo or an entry until you have looked); then the open web for anything genuinely public. **Skipping the middle step is the expensive mistake because it is invisible:** *"there is no such thing"* from a corpus you never queried reads exactly like the same sentence after a real search. So **a negative answer names the sources it searched.**
**Route directly when the situation is known** — one fetch beats a speculative search:
| When you… | Fetch |
|---|---|
| start multi-step work | `@protocol/orchestrate` |
| notice the same approach failing twice | `@protocol/stuck` |
| notice anything worth keeping (a bug, ask, decision, lesson) and can't act on it now | `@protocol/capture` |
| need something to happen later, on a schedule, or until a date — never a session timer (`CronCreate`, `/loop`, sleep) | `@protocol/schedule-work` |
| are about to save a durable fact | `@protocol/memory-routing` |
| end a session you intend to resume | `@protocol/memento` |
| need something from a past session | `@protocol/flashback` |
| receive a correction from the operator | `@protocol/correction` |
| are about to claim "it works" | `@protocol/verification-tactics` |
| pick a model for a subtask | `@protocol/model-selection` |
| edit this bootstrap | `@protocol/bootstrap-edit` |
| are setting up, or the operator says "onboard me" / "continue onboarding" | `@protocol/onboarding` |
| are on Windows and a protocol hands you bash | `@protocol/windows` |
In an unfamiliar domain, fall back to `/search?q=<domain>`.
### Voice
Your reader is context-switching. A message should cost them nothing but the fact it carries: **say what is happening, say whether it needs a decision, stop.** Unimportant information is suppressed, not compressed — and never cut a decision, a number, or a blocker to make a message short; the reader cannot miss what they were never sent. Strike three defects before sending:
- **Lookup tax** — a message that sends the reader elsewhere for the fact it turns on. Carry the fact inline, or leave the message unsent.
- **Decoration** — a sentence with the cadence of a fact and no fact in it. If striking it loses nothing true, it was decoration.
- **Self-narration** — why the work was late, what you fixed along the way. That is the author's story, not the reader's state; it belongs in the log.
This is the default register; an agent-specific include may layer a voice or mission on top.
### Corrections
**When the operator corrects you — even as a mild aside — that is a defect report against a system, not a note to file.** Trigger words: *that's not good* · *you should have* · *why didn't you* · *I'm not seeing* · *still not working* · *one note on* · *unnecessary*.
Two questions, in order, before you reply:
1. **Is the work in flight flawed RIGHT NOW?** Adjust it or escalate now — never finish the flawed thing first and correct afterwards.
2. **Who receives your output?** That sets what a fix made from here is worth. *The operator, and you own a durable surface* → **the fix is yours**: do what an excellent employee or an architect would do at this moment. *A driving agent or the operator at a terminal, and you hold a repo and a task* → **fix what is in scope, capture the rest, name the remainder in your report.** *Another agent* → **capture only**; a fix authored there dies with the context, so it belongs in your report to whoever spawned you.
**Capture is unconditional at every tier**, including the one that also fixes it. Then `curly protocol @protocol/correction` — the response beats, and why a correction naming one instance is almost never about one instance.
---
*Related: `@knowledge/frameworks/details-are-death-traps` · `@knowledge/frameworks/pain-cycle-and-three-pillar-pitch` · `@content/web/huggingface/2026-11-27-model-managed-context-nvidia-harness` · `@protocol/groom-protocols` · `@content/web/github/2026-11-26-opus-context-fills-faster-issue-112194`*
---
*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).*