The agent can only use what it sees; precise context beats long explanations.
Agent can search your project by itself, but when you already know where the relevant code is, telling it saves time and avoids wrong guesses. Type @ in the chat input to attach context:
- Files and folders:
@auth.ts,@src/components/. - Terminals: the output of a terminal, for example a failing build.
- Chats: context from a previous conversation, useful when continuing work in a fresh chat.
- Git diffs:
@Commit (Diff of Working State)for your uncommitted changes, or@Branch (Diff with Main)for everything on your branch. Great for "review my changes". - Browser: context from Cursor's built-in browser.
You can also drag in or paste images (Cmd/Ctrl+V), such as a screenshot of a broken layout, a design mockup or an error dialog. For outside documentation, paste the URL or ask the agent to search the web; it has web search and fetch tools.
When to use what:
- You know the files: mention them. "In @src/api/users.ts, add pagination like @src/api/orders.ts does."
- You don't: describe the behavior and let Agent search. Over-mentioning many large files fills the context window with noise.
- Point to an example in your codebase whenever one exists. "Follow the pattern in..." is one of the most effective prompts.
A good prompt has the goal, the relevant context, constraints ("no new dependencies") and how to check success ("run the users API tests"). Voice input is available from the microphone icon; include file and function names and review the transcript.
Example
> In @src/api/users.ts add cursor-based pagination to listUsers,
> following the same approach as @src/api/orders.ts.
> Don't change the response field names. Run the users API tests.
> @Branch (Diff with Main) review my changes for missing error handling
> [pasted screenshot] The settings page looks like this on mobile.
> Fix the overflow in @src/pages/Settings.tsx and compare with the screenshot.Remember
- @ attaches files, folders, terminals, chats, git diffs and browser context
- Paste screenshots for UI and error problems
- Mention files when you know them; let Agent search when you don't
Watch out for
- @-mentioning half the repository "just in case", which crowds out what matters.