Context and skills: what the model reads
In short Keep everything, show the model a summarised view, store big results as files, and compact in two tiers. Put mechanical steps in skill scripts, because an agent's latency is its number of model steps.Full verdict ↓
A model only knows what is in its prompt on this call. Everything the agent does well or badly follows from what I put there. Context is the working memory of one conversation. Skills are the procedures it can follow. Both are about spending a small window wisely.
The design
Context decisions
| Decision | Why |
|---|---|
| Context is the whole conversation, not one turn | Starting each turn blind to the one before was a real gap, found by reading the code |
| Summaries form a tree, the current turn stays verbatim | Old content folds into summaries of summaries as it ages, so the window stays bounded |
| Big tool results go to a file | The model sees the head, the tail, a short summary and a path, and reads more on demand |
| Two compaction tiers | A soft tier summarises in the background at 50%. A hard tier blocks at 85% because the window is about to overflow |
| Compaction always converges | Try a careful summary, then an aggressive one, then plain truncation with no model. The last step cannot fail to shrink |
| Nothing is deleted | The prompt is a derived view over an immutable store, so compaction changes what is shown, not what is kept |
| Memory enters on two triggers only | At the start of a conversation, or when the model asks. Re-judging relevance on every call would break the prompt cache, and cache stability won |
Skills
A skill is a directory: a procedure the model follows, short prompt files, and scripts it can call as functions. The reason is a measurement, not a taste.
Latency is the number of model steps, not the cost of the tools. The steps were mechanical: finding tools, reading a catalog, hand-building a batch with its own ids, retrying a failing call. Prose in a prompt cannot make those deterministic. A script can. So the model asks what is missing, writes a plan, and calls one function that checks everything, builds the batch, dry-runs it and applies it all or nothing.
| Skill rule | Why |
|---|---|
| The prompt says when, the script does how | The model keeps the judgement, the function keeps the arithmetic |
| Fail loudly, and list every problem at once | No fallback path hides a failure. The model sees what to fix in one go |
| A script cannot start a process or open a socket | It runs in the sandbox from post 6 and reaches the world only through the toolbox |
| The agent can write a skill from a source I point it at | It goes live without a restart. Learning skills automatically from transcripts is banned |
| No category filter on skill search | I built one and removed it the same day: labels describe the shape of a process, not the domain, so filtering excluded relevant skills |
The journey
- A session-wide context design. Summary tree, big-result files, two compaction tiers, informed by a published design.
- Skill search. Skills found by meaning, loaded on demand. A category pre-filter was added and removed within the day.
- The 22-step task. A planning task took 570 s, and the trace showed why.
- Skills with scripts. A procedure plus functions the model calls.
- Soft compaction. Background summarising added at the 50% tier.
- Scripts as modules. Skill scripts moved from a shell to code run in the sandbox.
What already exists
| Idea | Source | What I took |
|---|---|---|
| Page memory in and out like an OS | MemGPT | The split between what is in the prompt and what is stored |
| An immutable store plus a summary tree | LCM: Lossless Context Management | The shape of my prompt. The authors' benchmarks are their own results |
| Skills with progressive disclosure | Anthropic's Agent Skills | Load a skill's body only when it applies |
Where it stands, and my verdict
| Component | Status | |
|---|---|---|
| Memory (post 2) | Built, traceable; two memory journeys pass | thin |
| Tools (post 3) | Running; journey suite measures discovery, chaining and failure | measured |
| Harness (post 4) | Running, shrinking | stable |
| Context | Tree, big-result files, both compaction tiers built | stable |
| Skills | One skill built to cut a 22-step task to about 4. Not re-measured yet | unproven |
Verdict: the context design is sound and the skill idea is promising, not proven. The 22 steps were measured; the 4 is what the script should need, and I have not re-run it. Most skills I wanted are not written. The principle generalises: find where the steps are mechanical and give them to code. Next: where that code runs.