CursorIntermediate

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.

8 minIntermediate

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.

Cursor — @ menu
@auth |
Files authService.ts
Folders src/auth/
Symbols function authorize()
Docs @Docs @Web
Typing @ opens the context picker.

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.

MentionAddsUse when
@FileOne file's contentsThe change lives in that file
@FolderA directory of filesYou need a feature's whole context
@SymbolA single function or typeYou want a tight, focused edit
@DocsIndexed library docsUsing a framework or SDK API
@WebLive web search resultsYou 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.

Cursor — request with context chips
You
@authorize @Docs:Stripe Add a check that the customer has an active subscription before allowing access.
Agent
Using the Stripe Subscriptions API, I added a guard in authorize() that returns 402 when status is not active.
A focused symbol plus library docs attached to one message.

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.

Less context, more relevant context
Dumping ten files into a request often gives worse answers than attaching the one function and one type that matter. Start narrow with @Symbol, and only widen to @Folder when the model clearly lacks something.

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

Tags
#context#chat#mentions#docs