Back to Features

Cmd+L AI Chat - Your AI Programming Partner

Master the AI Chat interface for questions, debugging, and deep code understanding

💡 What You'll Learn

  • Use Cmd+L (Ctrl+L) to open the AI Chat sidebar
  • Master @ symbols for providing context
  • Ask effective questions for debugging and understanding
  • When to use Chat vs. Cmd+K vs. Composer

💬 What is AI Chat?

AI Chat (Cmd+L) is your conversational AI assistant powered by Claude 4.5 Sonnet. Unlike Cmd+K which edits code directly, Chat is perfect for:

  • 🤔 Understanding complex code
  • 🐛 Debugging errors
  • 💡 Getting implementation suggestions
  • 📚 Learning new concepts
  • 🔍 Exploring your codebase

🔑 Quick Start:

  1. Press Cmd+L to open Chat
  2. Type your question in natural language
  3. Use @ symbols to add context (files, folders, docs)
  4. Get instant answers with code examples

⌨️ Essential Shortcuts

ActionMacWindows/Linux
Open AI ChatCmd+LCtrl+L
Send messageEnterEnter
New line in messageShift+EnterShift+Enter
New chatCmd+Shift+LCtrl+Shift+L

🎯 The Power of @ Symbols

@ symbols are the secret to getting great answers. They give the AI context about your codebase.

@Files

Reference specific files

How does @src/utils/auth.ts handle authentication?

@Folders

Reference entire directories

Explain the structure of @src/components/

@Codebase

Search across your entire project

@Codebase where do we handle user login?

@Docs

Query official documentation

@Docs React how do I use useEffect?

@Web

Search the internet for current info

@Web what's new in Next.js 15?

🎯 Real-World Examples

Example 1: Debugging an Error

// Bad question (no context):
Why is my code broken?
// Good question (with context):
I'm getting "Cannot read property 'map' of undefined" in @src/components/UserList.tsx
What's causing this error?

Example 2: Understanding Code

Explain how @src/lib/api.ts handles API retries and error handling
// AI will analyze the file and explain the retry logic, error handling patterns, and best practices

Example 3: Implementation Guidance

@Codebase we need to add rate limiting to our API.
Show me how other endpoints handle rate limiting and suggest where to add it

Example 4: Learning Best Practices

@Docs Next.js what's the best way to implement server-side authentication in App Router?

✍️ Writing Effective Chat Prompts

✅ Good Prompts

  • "Explain how @file.ts works"
  • "Why is this error happening?"
  • "What's the best way to..."
  • "@Codebase where do we handle..."
  • "Show me examples of..."
  • "How can I optimize..."

❌ Bad Prompts

  • "Fix my code" (use Cmd+K)
  • "Help" (too vague)
  • No @ symbols for context
  • Asking for file creation (use Composer)
  • Multiple unrelated questions

🔄 When to Use What?

I want to...Use
Understand how code worksChat (Cmd+L) ⭐
Debug an errorChat (Cmd+L) ⭐
Edit existing codeCmd+K
Write new codeTab or Composer
Get implementation suggestionsChat (Cmd+L) ⭐
Explore the codebaseChat + @Codebase ⭐

⚡ Pro Tips

💡 Tip 1: Always use @ symbols - they 10x the quality of answers

💡 Tip 2: Chat remembers conversation history - follow up with clarifying questions

💡 Tip 3: Use "Apply" button in chat responses to insert code directly

💡 Tip 4: Start new chats (Cmd+Shift+L) for unrelated topics to keep context clean

💡 Tip 5: Reference errors directly - copy-paste error messages for faster debugging

🎓 Practice Exercise

Try These Now:

  1. Press Cmd+L and ask: "@Codebase what are the main features of this project?"
  2. Pick a complex file and ask: "Explain @path/to/file.ts in simple terms"
  3. Find an error in your code and ask Chat to debug it
  4. Use @Docs to learn about a framework feature you're unfamiliar with
  5. Try @Web to search for the latest best practices

📊 Chat vs. Other Tools - Quick Reference

💬
Chat (Cmd+L)
Questions, understanding, debugging
✏️
Inline (Cmd+K)
Quick edits, refactoring
Tab
Writing new code

🐛 Common Issues & Solutions

AI gives generic answers

Use @ symbols to provide file/folder context. Be specific about what you're asking.

Chat is slow

Check your internet connection. Large codebases need indexing time. Try referencing specific files instead of @Codebase.

@Codebase doesn't work

Wait for indexing to complete (check bottom status bar). Make sure your project isn't too large (>100MB).

🔗 Next Steps

Now learn how to make multi-file changes with Composer: Composer Tutorial →