Basics
@ Mentions in Cursor: Attaching Context to a Chat
Type @ in the Cursor chat input to attach specific context to the conversation. You can mention files and folders, indexed docs, terminal output, past chats, git diffs and the built-in browser. Each mention is added to the conversation, and you can type @ as many times as you need.
On this page
What does @ do in the Cursor chat?
It attaches specific context to the conversation so Agent focuses on the right files and information. Nothing more mysterious than that: you are handing it the material instead of hoping its search finds the same material on its own.
Attaching @auth.ts does not stop Agent looking elsewhere. It guarantees that file is in the conversation.
This is covered hands-on in Cursor First Hour — 4 short modules, free to read.
What can I reference with @?
Six kinds of context, and the last three are the ones people forget exist. Terminal output, a previous conversation and a branch diff are all attachable without copy-pasting them into the prompt.
- Mention
- Files & Folders
- What it attaches
- The file or folder contents
- Example
@auth.tsor@src/components/
- Mention
- Docs
- What it attaches
- Indexed documentation, including your own
- Example
@Docs, adding new ones via@Docs > Add new doc
- Mention
- Terminals
- What it attaches
- Terminal output as context
- Example
@Terminals
- Mention
- Past Chats
- What it attaches
- Context from a previous conversation
- Example
@Past Chats
- Mention
- Git diffs
- What it attaches
- Uncommitted changes, or your full branch diff
- Example
@Commit (Diff of Working State),@Branch (Diff with Main)
- Mention
- Browser
- What it attaches
- Context from the built-in browser
- Example
@Browser
| Mention | What it attaches | Example |
|---|---|---|
| Files & Folders | The file or folder contents | @auth.ts or @src/components/ |
| Docs | Indexed documentation, including your own | @Docs, adding new ones via @Docs > Add new doc |
| Terminals | Terminal output as context | @Terminals |
| Past Chats | Context from a previous conversation | @Past Chats |
| Git diffs | Uncommitted changes, or your full branch diff | @Commit (Diff of Working State), @Branch (Diff with Main) |
| Browser | Context from the built-in browser | @Browser |
The @ menu as documented at cursor.com/help/customization/context.
One navigation detail that is easy to miss: after selecting a folder, type / to navigate deeper rather than backing out and starting the mention again.
When should I use @ mentions?
Cursor's guidance is narrower than "always attach everything". Use them when you already know which files are relevant. The example given is updating a component and its tests: mention both files, because you know both need to change.
And the honest other half, which Cursor states plainly: if you are not sure which files matter, skip it. Agent finds relevant files through its own search. Guessing at attachments when you do not know the codebase adds noise rather than direction.
The mention is a claim that this file is relevant. If you cannot make that claim, let the agent search instead.
Can I attach multiple items to one chat?
Yes. Type @ multiple times to attach several files, folders or other context items; each one gets added to the conversation. There is no separate multi-select step, and no need to finish one mention before starting the next. If you notice yourself attaching the same guidance in every chat, that is a rule rather than a mention - Cursor documents them at cursor.com/docs/rules.
Frequently asked questions
How do I attach a file to a Cursor chat?
Type @ in the chat input and pick the file, for example @auth.ts. For a folder, mention it the same way and type / after selecting it to navigate deeper.
Can I attach terminal output or a git diff?
Yes. @Terminals attaches terminal output, @Commit (Diff of Working State) attaches your uncommitted changes, and @Branch (Diff with Main) attaches the full branch diff.
Should I always use @ mentions?
No. Use them when you know which files are relevant. If you are not sure, Cursor's guidance is to skip the mention and let Agent find the relevant files through its own search.
Can I reference a previous conversation?
Yes, with @Past Chats, which brings context from an earlier conversation into the current one.
Sources & last verified
Cursor ships frequently. Facts verified against primary sources on July 27, 2026.
Keep reading
Rather do it than read about it? Run 11 interactive Cursor walkthroughs in a simulated editor. Free, no account needed.