CursorJediah KatzExplainer
Dynamic context discovery
Summary
Cursor describes dynamic context discovery, a coding-agent pattern that provides fewer details initially and lets the agent retrieve relevant information instead of injecting everything as static context. The approach uses files as a simple interface: long tool responses, chat history, Agent Skills, MCP tool descriptions, and integrated terminal output are stored or synchronized so the agent can inspect only what it needs with tools such as tail, grep, rg, and jq. For MCP, only tool names are included initially, while descriptions are synced into one folder per server; an A/B test found a 46.9% reduction in agent tokens for runs that called an MCP tool, with high variance based on the number of MCPs. Cursor says the design reduces context bloat, preserves information truncation could lose, supports recovery after summarization, and can expose MCP re-authentication status. The changes are planned to become available to all users in the coming weeks.
Context
As coding agents and their underlying models improve, Cursor found that providing fewer details up front can make it easier for agents to retrieve relevant context. Static context can consume tokens, introduce confusing or contradictory information, and lose crucial details when long outputs are truncated or summarized.
Approach / What changed
Cursor stores or synchronizes long tool responses, chat history, Agent Skills, MCP tool descriptions, and integrated terminal output as files. Agents receive limited static context and use tools such as tail, grep, rg, and jq to discover and retrieve relevant details dynamically. MCP tools are grouped in one folder per server, with names provided initially and descriptions loaded when needed.
Takeaways
Cursor writes long shell-command and MCP results to files instead of truncating them, allowing agents to inspect the end with tail and read more only when necessary.
Chat history is exposed as a file during summarization, allowing the agent to search for details that were lost from the summary after the context window fills.
In an A/B test of runs that called an MCP tool, dynamically loading MCP descriptions reduced agent tokens by 46.9%; the result had high variance based on the number of MCPs.
Source and freshness
- Source
- cursor.com
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.