You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every token in AGENTS.md enlarges the prefix on every call and pushes the user task toward the weak middle. Keep operational instructions minimal; leave on-demand project knowledge in referenced documentation.
315
-
316
-
**MCP tools: schema exposure trades immediate visibility for prefix cost**
317
-
Eager loading is simple but charges the full catalog to every request. Deferred loading adds discovery steps, then exposes only relevant schemas. Catalog breadth, schema size, and task breadth determine the crossover.
318
-
319
-
**Skills: procedure content arrives only when activated**
320
-
A lightweight catalog supports discovery; the selected workflow enters near the active turn. Manual activation favors reliability, while model activation favors convenience.
321
-
322
-
**Sub-Agents: delegation via isolated windows with per-agent optimization**
323
-
A sub-agent can consume 150K tokens internally while returning only a small synthesis. Use delegation to assign sub-tasks to agents optimized per slice — the right LLM and system prompt for each work item — while the orchestrator stays focused on coordination.
324
-
325
-
**Compaction: working room is recovered by losing detail**
326
-
A summary replaces accumulated history, so facts needed later may disappear. External checkpoint files provide exact recall; a fresh context restores inference quality.
327
-
328
-
**Retrieval: relevant evidence still consumes attention**
329
-
Harness-level retrieval competes for primacy space; tool-driven retrieval enters with recency and drifts inward. Optimize placement and context injection alongside retrieval quality.
330
-
331
-
**The U-curve is the constraint**
332
-
Position matters. Put critical instructions at the edges — primacy (start) and recency (end). Keep supporting evidence in the middle summarized and referenced, not pasted wholesale. Start a fresh phase when the middle becomes crowded.
333
-
334
-
**Choose the mechanism by the required context effect**
335
-
Always needed? → Context file. Callable capability? → MCP tool. Reusable workflow? → Skill or prompt template. Heavy research? → Sub-agent. Accumulated history? → External checkpoint and fresh phase, or compaction when necessary. Domain knowledge or project evidence? → Retrieval.
336
-
337
-
---
338
-
339
311
[^attention-sinks]: Xiao et al. (2023), [_Efficient Streaming Language Models with Attention Sinks_](https://arxiv.org/abs/2309.17453).
340
312
341
313
[^lost-in-middle]: Liu et al. (2023), [_Lost in the Middle: How Language Models Use Long Contexts_](https://arxiv.org/abs/2307.03172).
0 commit comments