Context
Cursor
Foundations
Cursor @ References
Use @file, @folder, @web, and @docs to give the AI precise context
11 of 66
What are @ references?
In Cursor chat or Composer, type @ to attach specific context to your message. This tells the AI exactly what to look at instead of guessing.
Reference types
| Reference | What it does |
|---|---|
@file | Attach a specific file to the conversation |
@folder | Include all files in a directory |
@code | Reference a specific symbol (function, class) |
@web | Search the web for current information |
@docs | Search indexed documentation |
@git | Reference git history (diffs, commits) |
@codebase | Search across the entire codebase |
@notepads | Include a saved notepad |
Usage examples
@auth.ts fix the login validation bug @src/components/ create a new Button component matching the existing style @web what is the latest React 19 API for use() @git review the last 3 commits for issues
Tips
- Use
@filefor targeted questions about specific code - Use
@folderwhen the AI needs to understand a module - Use
@codebasesparingly: it uses more tokens - Combine references:
@auth.ts @types.ts fix the type mismatch