Cursor replaces static context injection with "dynamic context discovery": tool outputs, chat history, MCP tools, skills, and terminal sessions are all materialized as files on disk, letting the agent pull only what it needs via grep/read. A/B testing shows 46.9% token reduction for MCP-heavy sessions.
Coding agents suffer from a context allocation problem: the agent harness must decide what to place in the finite context window before the task is known. Static inclusion creates three failure modes:
The problem is analogous to eager vs. lazy evaluation: static context is eager (pay the full cost upfront), while the workload is sparse (only a fraction of available context is task-relevant).
Core mechanism: unify all ancillary context behind a single abstraction — files on the local filesystem — and let the agent decide what to read, when.
The algorithm has five instantiations, all sharing the same lazy-load pattern:
| # | Context source | Static (before) | Dynamic (after) |
|---|---|---|---|
| 1 | Long tool output (shell, MCP) | Full JSON/text in context, or truncated | Written to file; agent gets path + uses tail/read on demand |
| 2 | Chat history at summarization | Summary only; details lost | History written to file; agent searches it if summary is insufficient |
| 3 | Agent Skills | All skill text in system prompt | Name+description in prompt; skill file read on demand via grep/semantic search |
| 4 | MCP tool descriptions | All tool schemas injected per server | Tool names only in prompt; descriptions synced to per-server folders, read on demand |
| 5 | Terminal sessions | User copy-pastes output | Terminal output synced to files; agent greps for relevant sections |
Design choices:
rg, tail, read, jq) rather than a custom retrieval API — models already know how to use these.核心技术壁垒: The insight that files are the correct granularity for lazy context — not a search index, not a new protocol, but the filesystem itself as a universal lazy-loading interface that every LLM already knows how to navigate. The power is in the absence of new abstraction: no custom API means no adoption barrier for new models and no new failure modes to debug.
The key structural shift: context sources move from the prompt (left) to the filesystem (right). The agent's context window holds only minimal metadata; full content is fetched lazily via standard file tools when the agent determines it is needed.
| Evidence type | Strength | Detail |
|---|---|---|
| A/B test (MCP tokens) | Strong | 46.9% reduction, reported as statistically significant; high variance acknowledged |
| Quality improvement | Anecdotal | Claimed reduction in confusing/contradictory context; no metric provided |
| Summarization benefit | Anecdotal | Fewer unnecessary summarizations; no quantitative comparison |
| MCP status surfacing | Anecdotal | Described as a new capability; no user study |
| Design choice (folders vs. flat index) | Engineering judgment | Justified qualitatively (logical grouping); no A/B test of alternatives |
Overall: one solid quantitative result (MCP token reduction) backed by production A/B testing; the remaining four applications rest on engineering reasoning and qualitative observation. No formal proofs, ablation studies, or benchmark comparisons — expected for a product blog post, not a research paper.
无形式化作者证明 — 仅实证. The blog offers no formal model of the token savings or quality tradeoffs; a formal treatment would define a context allocation policy $\pi$ that maximizes task success rate subject to a token budget $B$, and prove that the lazy policy dominates eager allocation under sparsity assumptions on tool relevance.
grep, tail, jq), and require no new protocol. When building MCP integrations, sync tool descriptions to per-server directories rather than injecting all schemas into the prompt.