How Context Engineering Improves Coding Agents

41.8K views
•
October 8, 2025
by
OpenAI
YouTube video player
How Context Engineering Improves Coding Agents

TL;DR

Coding agents produce better results when they receive minimal, high-quality context and can retrieve relevant code with both direct and semantic search. Cursor’s evolution from fast autocomplete to autonomous agents shows that planning, specialized tools, persistent task lists, reusable rules, and flexible execution surfaces can improve code quality while preserving user control over autonomy.

Transcript

[Applause] I'm Lee and I'm on the cursor team and I'm going to talk about how building software has evolved. So, thanks for being here. We started with punch cards and terminals back in the 60s where programming was this new superpower, but it was inaccessible to most people. And then in the 70s, programmers grew up writing basic on their Apple 2s ... Read More

Key Insights

  • Autocomplete quality depends on balancing latency, relevance, and presentation. Cursor found that suggestions slower than 200 milliseconds interrupt developer flow, while fast but unhelpful suggestions are also undesirable, leading the latest Tab release to show fewer suggestions with higher confidence of acceptance.
  • Cursor Tab handles over 400 million requests per day, providing extensive data about accepted and rejected suggestions. Cursor uses that feedback for positive and negative reinforcement, and its online reinforcement learning process can update the specialized next-action model about 30 minutes after a user accepts a suggestion.
  • Coding agents evolved by gaining more autonomy and better tool use. Cursor progressed from inline suggestions based on the current line and file context to Composer for conversational multifile edits, then added a fully autonomous agent in 2024 that could gather its own context.
  • Context engineering is the practice of giving models intentional, high-quality context rather than relying mainly on prompting techniques. Because model recall becomes worse as context grows, the goal is to use a minimal quantity of relevant tokens instead of pushing the context window to its limit.
  • Semantic search finds conceptually related code when exact terminology does not match. An instruction to update the top navigation can lead an agent to a file named header.tsx because embeddings represent semantic relationships that direct string-search tools such as grep or ripgrep may miss.
  • Offline codebase indexing shifts computation and latency away from agent execution. Embeddings can be created before a request arrives, allowing semantic retrieval to operate faster and more cheaply at runtime without making the user wait for all of the retrieval work during inference.
  • CLI-based agents are scriptable execution surfaces rather than the expected final interface for coding agents. Their flexibility allows agents to run from terminals, websites, phones, Slack bug reports, Linear backlog items, documentation workflows, or automated codebase updates, with text or structured JSON returned.
  • Longer-horizon agents improve when they research and plan before editing code. Editable plans let users verify requirements and correct direction, while persistent to-do lists preserve critical task context, reduce forgotten work, and help agents avoid wasting tokens during extended assignments.

Explore YouTube Video Summarizer or Get YouTube Transcript Extractor

Questions & Answers

Q: What is context engineering for coding agents?

Context engineering is the process of supplying a coding agent with intentional, high-quality information that is relevant to its task. It places less emphasis on isolated prompting tricks and more emphasis on retrieval, tools, plans, rules, and persistent task context. Because recall becomes worse as context grows, the objective is to provide a minimal amount of useful context rather than fill the available context window.

Q: How did Cursor evolve from autocomplete to autonomous agents?

Cursor began with Tab in 2023, moving from prediction of the next word to the next line and eventually the developer’s next action. It then introduced inline diff suggestions using the current line and broader file context. Composer added a conversational interface for multifile edits, and a fully autonomous coding agent arrived in 2024 with tool-calling abilities and the capacity to gather its own context.

Q: Why does Cursor combine direct search with semantic search?

Direct tools such as grep and ripgrep are effective when an agent knows the exact text to locate, but they can miss relevant code when terminology differs. Semantic search uses indexed embeddings to identify conceptual matches. For example, an agent asked to update a top navigation can find header.tsx. Cursor’s stated takeaway is that using both approaches produces the best retrieval results.

Q: How does codebase indexing improve agent performance?

Codebase indexing creates embeddings before the coding agent is invoked, enabling semantic retrieval across files and directories. This shifts expensive computation and latency to an offline process instead of performing all retrieval work during inference. As a result, the agent can locate relevant code more quickly and accurately at runtime while producing faster and cheaper responses without sacrificing performance.

Q: What makes AI code autocomplete useful in practice?

Useful autocomplete requires an appropriate balance among response speed, suggestion quality, and the way suggestions appear in the editor. Cursor reports that latency above 200 milliseconds can disrupt a developer’s flow, but immediate irrelevant suggestions are not valuable either. Its latest approach presents fewer suggestions while maintaining greater confidence that users will accept them, particularly where typing speed remains the main bottleneck.

Q: Why should coding agents plan before editing files?

Planning and research provide higher-quality input context for longer-horizon work. They also give users an opportunity to verify requirements and correct the agent’s direction before extensive code is generated. Cursor found that this process significantly improves generated code quality. Effective planning requires product integration for storing plans, editing files, and providing tools, rather than merely adding an instruction to plan better.

Q: How do to-do lists help autonomous coding agents?

A to-do list gives an agent persistent context about the assignment it is completing. The agent can consult its notes throughout a longer task, which helps prevent forgotten requirements and avoids wasting tokens reconstructing prior decisions. Cursor is also exploring a model in which to-dos share the codebase as their source of truth, particularly for smaller projects that may not need a separate task-management tool.

Q: How can teams standardize workflows for coding agents?

Teams can package repeatable workflows through custom commands and rules. Custom commands share prompts for recurring operations, while rules insert important context into every agent conversation. Cursor engineers use this approach to package commit standards and guidelines into a slash command, then provide the relevant Linear ticket. These mechanisms make established practices reusable instead of requiring each developer to restate them for every task.

Summary & Key Takeaways

  • Cursor evolved from Tab autocomplete and inline diffs to Composer for conversational multifile editing, followed by a fully autonomous coding agent in 2024. As models improved at tool calling, the agent became capable of gathering its own context instead of requiring users to supply all relevant information before work began.

  • Context engineering focuses on supplying intentional, high-quality information rather than filling the model’s context window. Cursor combines direct string search with indexed semantic search so agents can locate relevant code even when a user’s terminology differs from filenames. Offline indexing also reduces computation and latency during agent execution.

  • Longer tasks benefit from research, editable plans, persistent to-do lists, and deeper integration with file-editing tools. Cursor also supports reusable custom commands and rules for team workflows, while specialized agents such as Bugbot demonstrate that agents can review code for meaningful logic errors as well as write and modify it.


Read in Other Languages (beta)

Share This Summary 📚

Explore More Summaries from OpenAI 📚