Cursor Chat (Cmd+L) is where you have conversations with your code. Ask questions about how things work, request explanations, and get help debugging — all with your codebase as context.
A productive debugging session using Cursor Chat: you'll diagnose a real bug, understand an unfamiliar function, and get a refactoring suggestion — all through chat without leaving the editor.
Open Chat with Cmd+L (Ctrl+L on Windows). A panel opens on the right. The difference from talking to ChatGPT in a browser: Cursor automatically includes context from your open files, selected code, and your project structure.
You can control what context is included using @mentions:
@filename.py → includes a specific file in context @Folders → includes an entire folder @Codebase → searches across your whole project @Docs → include a library's documentation @Web → search the web and include results @git → include recent git changes
The @Codebase mention is particularly powerful — Cursor does a semantic search across your project to find relevant code, then includes it in the context window before answering your question.
Cursor Chat is most valuable for understanding code you didn't write — inherited codebases, open source libraries you're integrating, or your own code from 6 months ago.
High-value question patterns:
# Understanding "Explain what this function does and why it was written this way" "What are all the places where user_id is used?" "Walk me through what happens when a user logs in" # Debugging "I'm getting this error: [paste error]. What's wrong?" "Why would this return None sometimes?" "What edge cases am I not handling?" # Planning "I want to add rate limiting to the API. Where should I add it?" "What would break if I changed this function signature?"
The best way to learn Cursor Chat is with a real debugging session. Find a bug in something you're working on, or create one intentionally for practice.
Debugging workflow with Cursor Chat:
Select the code that's misbehaving. Right-click → "Add to Chat" or press Cmd+L with selection active. This adds the code directly into the chat context.
Paste the error message if there is one: "I'm getting this error when calling this function: [error]. What's wrong?"
If Chat suggests a fix, it'll often include a code block you can apply directly using the Apply button — no copy-paste needed.
Use @git to debug recent regressions. If something broke after a recent commit: "@git What changed recently? Could any of those changes cause [problem]?" Cursor reads your recent diffs and reasons about them.
Before moving on, make sure you can answer these without looking: