Skip to lesson
Exit
Cursor Product & Architecture1 / 4

1 min lesson

Dynamic context discovery (since v2.4)

Connect "Useful context for billing tickets where a user expects every request to be maximally expensive" to the decision you would make.

Step 1 of 4

Dynamic context discovery (since v2.4)

Cursor doesn't shove every file, tool and MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. Press Enter for the full definition. output into the window. Since v2.4 the agent reads from files/tools/MCP and pulls in only what it deems relevant, a filesystem approach that preserves accuracy as context grows.

Combined with caching, this harness behavior reduces agent tokens by around 47%, even on other vendors' models. Useful context for billing tickets where a user expects every request to be maximally expensive.

Learn more

Advanced table

More context power means more places to look when something goes wrong

Context source
Codebase index
What it adds
Semantic retrieval over the whole repo
How it fails
Failed/partial build, ignored paths, repo too large, stale after big changes
Context source
@-files / @-folders
What it adds
Exact files the user names
How it fails
User attached the wrong path or the file is huge and crowds the window
Context source
@-docs / @-web
What it adds
External reference material
How it fails
Doc not indexed, link unreachable, outdated source
Context source
Rules
What it adds
Standing instructions that steer the model
How it fails
Conflicting or overly broad rules producing surprising outputs
Context source
MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. Press Enter for the full definition. servers
What it adds
External tools and data the model can call
How it fails
Server down, auth expired, schema mismatch, timeout

More context power means more places to look when something goes wrong.

Learn more

Full explanation

Rules and MCP, specifically

Rules and MCP, specifically

Rules are standing instructions (project-level or user-level) that get injected into the model's context. They're powerful and easy to forget. A user who set a rule weeks ago like "always respond in terse pseudocode" will later report that "the agent won't write real code," and the cause is sitting in their own rules file.

MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. Press Enter for the full definition. (Model Context Protocol) lets Cursor connect to external servers that expose tools and data - a database, an issue tracker, a docs source. Each connection is a small integration with its own auth and uptime. When an MCP-backed action fails, treat it like any integration. Is the server reachable? Is the token valid? Does the response match the expected schema?

The three MCP servers that make a support team effective

Looking at just the code helps, but the additional sources of context are what actually equip a team. Three platforms do most of the work: ticketing/management (Jira, Intercom), a knowledge base (Notion, docs) and customer context (Salesforce or your CRM).

Cursor's own support stack is concrete: Datadog MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. Press Enter for the full definition. to pull logs directly in for debugging, Notion MCP for their docs (used heavily) and Linear for bug reports.

If you're just looking at the code that can be helpful in and of itself, but providing these additional sources of context is what really makes the difference for a team.

Where historical support context lives

A user asks how to keep accumulated context - past answers, historical tickets - available to the agent. Cursor's team does not store this in a code repository. They use a third-party vendor that holds all the tickets and historical interaction data (enabling deep-research tools) and pull it into Cursor via MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. Press Enter for the full definition..

The forward-looking version worth mentioning: if you did store knowledge as Markdown somewhere Cursor can read, that directly enhances the in-IDE agent. It's a powerful option, not a requirement. As one engineer put it, "it's more stored in an external source and then brought in via MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. Press Enter for the full definition.."

Hooks: deterministic code in the agent loop

LLMs are nondeterministic by design, so you can't rely on the model to decide to protect secrets or log usage. Hooks let you configure a piece of code that always runs in the agent loop, deterministically, instead of trusting the model to do it. Two real uses: filtering agent responses by scanning for secrets, and augmenting your own analytics to track usage at the team level. When a support or security workflow must be guaranteed rather than likely, hooks are the surface.

Why hooks exist

This is our way to basically allow you to hook into that loop and be able to run something that will always consistently run versus relying on the LLM to decide that it should.

Privacy mode changes what's even sent

Privacy mode and data-handling settings change what context leaves the machine and what gets stored. In a privacy-restricted or enterprise-locked setup, certain retrieval or training-data behavior is intentionally limited.

Before you chase a "why doesn't it see my code" ticket as a bug, confirm whether privacy or data controls are constraining the pipeline by design. This is constant in enterprise troubleshooting.

Interview move

When given a "bad output" scenario, say the pipeline out loud: intent → context selection → retrieval/index → rules → model → output and place the failure on it.

That sentence signals you root-cause along a system, not by trial and error. It's the single most impactful thing you can demonstrate in the technical round for this role.

Learn more

Full explanation

Point users at Ask AI in the docs

Point users at Ask AI in the docs

cursor.com/docs has an Ask AI feature that semantic-searches the documentation and returns a detailed answer - ask it "give me an overview of rules, skills, and sub-agents" and it pulls straight from the Customizing section.

It's a good self-serve deflection for the rules/skills/MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. Press Enter for the full definition. questions in this section. Hand it to a user who wants to go deeper rather than retyping the docs into a ticket.