Adding Context to Chat in AI

From the Cursor cheat sheet ยท Context Management ยท verified Nov 2026

Adding Context to Chat

Include relevant code and files

bash
# Selection
Cmd/Ctrl+Shift+L   # Add selected code to the current chat
Cmd/Ctrl+L         # Add selection to a new chat

# Clipboard (code or logs)
Cmd/Ctrl+V         # Paste copied code as a reference
Cmd/Ctrl+Shift+V   # Paste copied code as plain text

# In the chat input
@                  # Mention files, folders and other context
/                  # Commands and skills
Cmd/Ctrl+Enter     # Search codebase in chat

# @ mention types
@auth.ts                          # A file
@src/components/                  # A folder
@Terminals                        # Terminal output
@Chats                            # An earlier conversation
@Browser                          # The built-in browser
@Commit (Diff of Working State)   # Uncommitted changes
@Branch (Diff with Main)          # Your whole branch diff
bash
# Example: several files
@user.model.ts @auth.service.ts How do these interact?

# Example: review what you changed
@Commit (Diff of Working State) Any bugs in this diff?

# Example: terminal output
@Terminals Why did the build fail?
๐Ÿ’ก Type @ and start typing; Cursor suggests matches
โšก Not sure which files matter? Skip the mention and let Agent search
๐Ÿ” Paste or drag images into the input for UI work and error screenshots
๐Ÿ“Œ Type @ again to attach as many items as you need
contextreferencesearch

Continue with Cursor

Save the full cheat sheet or work through every related task.

More AI tasks

Back to the full Cursor cheat sheet