Essentials In, Everything Else One Call Away
Wolffish used to front-load the system prompt: whole memory files, a two-day episode dump, and a 16K-token prose catalog of every tool. The lean context redesign (v1.0.203) inverts that. The prompt now carries only the essentials plus two compact indexes — a capability index and a memory map — and the model retrieves everything else with tools, on demand, in milliseconds. A fresh conversation’s system prompt is ~5,000 tokens (was ~44,000). Add the core tool schemas (~4K) and a fresh request costs ≈9.4K tokens vs ~94K before — a 10× reduction.What a Fresh Prompt Contains
Conditional sections appear only when they apply:
<variables>— your user-defined variables fromconfig.json(only when you’ve defined any)- Role overlay — master/agent instructions in workflow mode, including the master’s
<workflow_models>catalog of spawnable models <channel>— channel formatting rules (e.g. WhatsApp’s no-Markdown overlay)<local_model>— a small honesty overlay for local (Ollama) models: acknowledge when out of depth, suggest a more capable model, but comply fully if the user insists. Nothing is withheld — local models get the same lean context, full core toolset, memory map, and tool discovery as cloud models.
What’s Gone
Four things were deleted from context assembly:
None of that information is lost. It all lives on disk, indexed by the cortex, one tool call away — see Retrieval Tools.
The Token Economics
Measured live, not projected:
- An hourly automation went from 96,442 input tokens (0.019/run).
- The prompt prefix is byte-stable, yielding ~99% provider prompt-cache hits measured across 50 conversations.
- Worst case — the 10 heaviest capabilities all activated at once — is base ~9.6K + activations ≈ 41.5K tokens, still under half the old floor.
- The memory map regenerates once per calendar day and rounds counts to coarse buckets, so it doesn’t churn between turns.
- Live counters (iteration number, tools called) ride the outbound volatile tail instead of the system prompt.
- Tool activation is conversation-scoped — loading
githubin a heartbeat run never invalidates a live chat’s prompt cache.
The Capability Index
Instead of shipping every tool’s schema, the<capabilities> section lists every installed capability — including MCP servers — in one line each:
[loaded] marks the capabilities whose tools are callable right now (the core set plus anything activated this conversation); everything else loads on demand via tool_search or tool_activate, and its tools become callable the same turn.
Past 60 capabilities, the unloaded remainder collapses to a grouped count (…plus 23 more capabilities (187 tools) — tool_search finds any of them), so the index’s prompt cost is O(1) in installed-capability count — you can install a hundred MCP servers without growing the prompt.
See Capabilities Overview for how discovery, activation, and the core set work.
The Memory Map
The<memory_map> tells the model what exists to be recalled — never the content itself:
The memory map is a map, not the territory. A count of “~150 episode records” tells the model there’s history worth searching — it never substitutes for retrieving the actual content.
Retrieval Instead of Injection
The operating contract (agents.core.md) teaches the model to treat its context window as a lean working set: what’s in the prompt is the essentials, not the extent of what it knows. Recall is driven by the intent of your message, unprompted:
- Definite references — “send me the flight plan”, “that file”, “like last time” — mean you know it has it. It searches first.
- Repeat-task smell — “send an email to Sarah” — triggers a quick search for prior instances: there may be an established pattern or template to reuse.
- Preferences — it checks the learned-preferences digest in the prompt, then searches before guessing.
- Pure-present tasks — weather, a calculation — need no recall. It just acts.
conversation_read — see Context Compaction.
Retrieval Tools
The full memory_search / memory_get / conversation_read reference.
Capabilities Overview
How tool discovery and the capability system work.
Context Compaction
How long conversations stay within the context window.
Stateless by Design
Why every request carries the full conversation.