Cursor @ Symbol
In Cursor, the @ symbol is a powerful tool for quickly accessing and referencing various context information, helping users interact with AI more efficiently.
Typing @ in any AI interaction scenario (such as the ⌘K command palette, chat window, or terminal) triggers a context menu that automatically filters and recommends the most relevant resources in the current project (such as files, code snippets, documents, etc.).

-
Keyboard operation: use the ↑/↓ arrow keys to navigate and Enter to confirm. If a category is selected (such as @Files), the list further filters the specific resources under that category.
-
File reading strategy: file references can be toggled Ctrl/⌘ M between "full read" or "summary read" modes (for example, full-text reference or only key parts).
@ Symbol
The @ symbol supports the following main commands:
| Function | Description | Use Cases |
|---|---|---|
| @Files | Reference an entire file as context. Supports file path preview and chunked processing. | When you need to reference specific file content, such as code files, documents, etc. |
| @Folders | Reference an entire folder as context. | When you need to provide a large number of files as context, such as a project directory. |
| @Code | Reference a specific code snippet as context. | When you need to query or operate on a specific code snippet. |
| @Codebase | Search the codebase for important files or code blocks and reorder them by relevance. | When you need to find related code or files across the entire codebase. |
| @Git | Scan Git commits, diffs, or pull requests to help find issues. | When you need to analyze Git-related information, such as commit history, code diffs, etc. |
| @Web | Search web information as additional context. | When you need to obtain the latest web information or external resources. |
| @Docs | Reference preset third-party or custom documents. Supports adding custom documents. | When you need to reference external documents or a custom knowledge base. |
| @Definitions | Reference all definitions in the vicinity as context. | When you need to reference definitions such as variables and functions in the current code. |
| @Chat | Add the current chat message as context. | When you need to reference previous conversation content in the chat. |
Advanced Tips
**Combine commands:** Type @Files src/utils/helper.js @Codebase to reference a specific file and associate the global codebase context at the same time, generating highly customized code.
**Dynamic resource integration:** Paste a link starting with @ (such as @https://api.example.com/docs), and Cursor will automatically parse the content and include it in the context.
**Privacy and configuration management:** Through the .cursorignore file (similar to .gitignore) to exclude sensitive files or directories from indexing. Add custom document links in Settings > Features > Docs to enhance the coverage of @Docs.
Typical Application Scenario Examples
1. Code Generation
- Command: Generate user login feature @Files src/models/user.js @Docs https://jwt.io/introduction
- Result: Generate secure authentication logic based on the existing user model and the official JWT documentation.
**2. Error Troubleshooting**
- Command: Explain the cause of this error @Code lines 12-25 @Git HEAD~1
- Result: Analyze potential issues by combining the code segment and the recent commit history.
3. Cross-file Refactoring
- Command: Convert class components to functional components @Folders src/components @Codebase
- Result: Batch convert and ensure global styles and state management are compatible.