
"Cursor has introduces a new approach to minimize the context size of requests sent to large language models. Called dynamic context discovery, this method moves away from including large amounts of static context upfront, allowing the agent to dynamically retrieve only the information it needs. This reduces token usage and limits the inclusion of potentially confusing or irrelevant details. Cursor employs five distinct techniques to implement dynamic context discovery."
"A common feature across all of them is the use of files as the primary interface for LLM-based tools, allowing content to be stored and fetched dynamically by the agent instead of overwhelming the context window. As coding agents quickly improve, files have been a simple and powerful primitive to use, and a safer choice than yet another abstraction that can't fully account for the future."
"The first technique Cursor uses involves writing large outputs, such as those from shell commands or other tools, to files, ensuring that no relevant information is ever lost. The agent can then use tail to access the end of the file as needed. Secondly, to prevent the loss of information when long context is summarized to fit token limits, Cursor saves the full history to a file, allowing the agent to retrieve any missing details later."
Dynamic context discovery minimizes request context size for large language models by retrieving only required information instead of including large static context blocks. Five techniques implement this approach, all using files as the primary interface for LLM-based tools so agents can store and fetch content dynamically without overwhelming the context window. Large tool outputs are written to files and accessed with tail when needed. Full interaction histories and domain-specific capabilities are saved to files for later retrieval and semantic discovery. For MCP tools, agents receive only tool names and fetch details on demand. An A/B test showed a 46.9% reduction in total agent tokens when MCP tools were called.
Read at InfoQ
Unable to calculate read time
Collection
[
|
...
]