Courses Curriculum Cities Blog Enroll Now
Cursor IDE Mastery · Day 2 of 5 ~35 minutes

Day 2: The Chat Interface: Asking Questions About Your Codebase

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.

1
Day 1
2
Day 2
3
Day 3
4
Day 4
5
Day 5
What You'll Build

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.

1
Section 1 · 8 min

How Cursor Chat Works

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:

text@mention Types
@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.

2
Section 2 · 12 min

Effective Questions for Code Understanding

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:

textGood Chat Questions
# 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?"
3
Section 3 · 15 min

Debug a Real Bug with Chat

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:

1

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.

2

Paste the error message if there is one: "I'm getting this error when calling this function: [error]. What's wrong?"

3

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.

What You Learned Today

  • How Cursor Chat differs from browser-based AI: automatic file context and @mentions
  • The @mention system: specific files, whole codebase, docs, web, git history
  • High-value question patterns for code understanding, debugging, and planning
  • The debugging workflow: add code to chat → paste error → apply fix directly
Your Challenge

Go Further on Your Own

  • Open an unfamiliar codebase (or an old project you haven't touched in a while). Use @Codebase to ask 5 questions to understand how it works — without reading the code directly first
  • Pick a function with a subtle bug or edge case. Walk through it with Chat: what does it do, what could go wrong, fix it.
  • Ask Chat to review a recent function you wrote for: security issues, performance problems, and edge cases. What does it find?
Day 2 Complete

Nice work. Keep going.

Day 3 is ready when you are.

Continue to Day 3
Course Progress
40%

Want live instruction and hands-on projects? Join the AI bootcamp — 3 days, 5 cities.

Finished this lesson?