2 min lesson
What indexing actually stores: the privacy answer
Explain the practical rule behind "'It didn't see my other file' almost always means that file wasn't retrieved into context."
Step 1 of 2
What indexing actually stores: the privacy answer
Be precise about the mechanic, because it doubles as the most-cited security reassurance. On first open Cursor chunks the repo into pieces such as functions and generates vector embeddings. The embeddings are encrypted and stored, while the raw code is held in memory briefly, then discarded, so the long-term store is just the vector DB. At prompt time, semantic search pulls the most relevant chunks into context. A .cursorignore file specifies files Cursor should never index or view, the control surface for sensitive code. It does not govern terminal 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. tools, which are separate.
Other tools lean on grep, a substring search that slows down on a large, deep codebase. Cursor indexes the whole repo into a vector DB, so it matches what you mean and stays fast: even an ambiguous prompt like "change the button to blue" returns an applicable result. One demo ran against Grafana, roughly ten years old, and indexing behaved the way it does on a new project. Carry the scaling idea, not a file count.
"It didn't see my other file" almost always means that file wasn't retrieved into context. The fix is mechanical: open the file, @-mention it or write a rule that points the agent at it. @-mentioning guarantees a file lands in context instead of relying on semantic search to surface it. Reasoning in terms of 'what's in context right now' turns a frustrating mystery into a debuggable system.
Learn more
Full explanation
When the window fills up
When the window fills uphanding off a long session
When a long session fills the window, the context the next agent needs lives in the codebase, the commits, the new code and the docs the previous agent left. The handoff takes three steps.
- 1Ask for a summary. Tell the agent to "summarize what you've done up to this point."
- 2Paste it into a fresh agent. Copy that small text into a new chat.
- 3Continue. The new agent starts light and reads the repo for the rest.
Two built-ins cover the same ground: you can fork a chat from a message to branch with only part of the prior context, since you can't selectively delete context, and for long runs Cursor auto-detects a near-full window, compacts the key learnings and initializes a new agent to resume the task.
How rules and AGENTS.md shape the slice
Retrieval is automatic, but you still have levers. Cursor gives developers explicit ways to bias what lands in context, and a DX Engineer should be able to teach when to reach for each.
Persistent instructions and pointers the agent should always honor for this project or path.
Use them to encode conventions and steer the agent toward the right files and patterns.
A project-level brief the agent reads: how the codebase is laid out, how to build and test, what to avoid.
Good for the orienting context every task needs, the README written for an agent.
Explicitly pull a file, folder or symbol into the current request's context.
The most direct fix when retrieval missed something you know is relevant.
Implicit signals that bias retrieval toward what you're working on.
Why keeping the relevant file open often quietly fixes a 'wrong context' problem.
The model isn't reading your repo. It's reading a small slice the harness retrieved for this request. So when the agent misses a file, I ask whether that file was in context. If it wasn't, I open it, @-mention it or add a rule, and that's the fix.
Learn more
Optional practice
Test yourself on What indexing actually stores: the privacy answer
QA developer says 'Cursor indexed my repo, so the agent has read all of it.' What is wrong with that claim?