How to Add Context to Cursor Chat with @ Mentions
Pull files, folders, symbols, docs and the web into a request with @ so the model answers about your actual code.
The single biggest lever on answer quality in Cursor is context: what the model can see. The @ menu lets you attach exactly the right files, symbols, folders, documentation or web pages to a request. This guide covers the most useful @ sources and when to reach for each.
What you need
- Cursor open on a real project
- A question that depends on your code, not general knowledge
- A few minutes to learn the @ sources
Step 1: Open the @ menu
In the chat input, type @ to open the context menu. As you keep typing, it filters to matching files, folders and symbols. Pick one to attach it as a context chip on the message.
Step 2: Attach files, folders and symbols
Use @file to add a whole file, @folder to add a directory of related code, and @ a symbol name to add just that function or type. Attaching a focused symbol is often better than a whole file because it keeps the context tight.
| Mention | Adds | Use when |
|---|---|---|
| @File | One file's contents | The change lives in that file |
| @Folder | A directory of files | You need a feature's whole context |
| @Symbol | A single function or type | You want a tight, focused edit |
| @Docs | Indexed library docs | Using a framework or SDK API |
| @Web | Live web search results | You need current, outside info |
Step 3: Pull in docs and the web
Use @Docs to attach indexed documentation for a library so the model uses the real API instead of guessing. Use @Web to let it search the live web for current information that is not in its training data.
Step 4: Index your own docs
You can add a documentation site to Cursor's index from Settings so it appears under @Docs. Paste the docs URL, let Cursor crawl it, and afterwards reference it by name in any chat.
Result: instead of a generic answer, the model edits your actual authorize() function using the real Stripe API, because you handed it exactly the code and docs the task needed.
Watch related tutorials
2:14
23:41
30:00
1:42:18
28:14
41:09