The flow
- I decide
- An agent acts
- A gate checks
Numbers match the steps below.
Steps
-
MeStart a session
A new session in a terminal or an app, with no memory of earlier ones. Everything below is read from files, not remembered.
-
HarnessBuilds the base prompt
The system prompt and the built-in tool definitions. The app may add its own reminders on top.
-
The agentLoads the rules
The global instructions file on every session, then the instructions file for the working directory on top of it. A repository's own file loads only in sessions that touch that repository.
-
The agentLoads the memory index
Only the index of the shared memory folder, cut at a fixed length. The notes themselves stay on disk until one is needed.
-
Session-start hookAdds a few nudges
On a genuine new session only, not on resume or clear. It never blocks: it asks whether a broad scope was intended, reminds me to consolidate memory when it has gone stale, lists to-dos that are due, and names branches whose upstream is gone.
-
The agentLists skills and tools by name
Skill names and descriptions, and tool names. Full schemas and skill bodies stay out until something asks for them.
-
MeType the first message
From here the session has what it started with. Anything else is fetched.
-
The agentFetches the rest on demand
Individual memory notes, the body of the to-do inbox, specs, plans, decision records, skill bodies and tool schemas, each through a tool call when the task needs it.
Guardrails
A small, fixed start
- The start is a short, ordered list. Anything that is not in it has to be fetched, which keeps a session cheap and its context clean.
- The memory index is capped, so growth in notes cannot silently crowd out the rules.
- Files tracked in a repository load in the same order on every machine.
Rules are mine to write
- I write and change the instructions files. An agent proposes an edit; it does not rewrite the rules it follows.
- A lesson that should outlive a session goes into memory, and a superseded fact is dropped in the same pass.
- Machine-local settings stay on the machine and are never copied by an agent.
Missing context is visible
- A missing file means a missing rule, so the first message of a session shows what was loaded.
- If the hook fails, it is silent rather than blocking: the nudges are a convenience, never a gate on starting work.
- A conflict between two sources is settled once, in the owning file, and the loser is corrected.
The idea
Treat context as an architecture, not a pile. The instruction files are layered from general to specific, memory is an index that points at notes rather than a dump of them, and a hook adds only the few reminders worth interrupting for. The layers in prose, in the order a session meets them: the global rules, then the repository's own rules, then the memory index and the inbox of open to-dos, then the specs and decision records that explain why. A fresh session is only as good as that stack, so I keep each layer short and give each fact exactly one home.