# Debug mode Debug mode helps Agent investigate bugs using error messages, stack traces, and runtime context before making targeted fixes. ## Can Cursor debug my code? Yes. Debug mode lets Agent diagnose issues by analyzing error messages, tracing call stacks, and reading runtime context. It identifies root causes first, then applies targeted fixes rather than guessing. ## How do I use Debug mode? 1. Open the Agent panel (Cmd + I on Mac, Ctrl + I on Windows/Linux) 2. Switch to Debug mode by pressing Shift + Tab to cycle modes, or use the mode picker dropdown 3. Describe the bug or paste the error message 4. Press Return. Agent investigates the issue and proposes a fix. ## How is Debug mode different from Agent mode? Instead of writing code right away, Debug mode generates hypotheses, adds log statements, and uses runtime information to pinpoint the root cause before making a targeted fix. Use Agent mode when you know what to build. Use Debug mode when something isn't working and you need to find out why. ## Related - [Agent mode](https://cursor.com/help/ai-features/agent.md) - [Agent reference](https://cursor.com/docs/agent/overview.md) --- ## Sitemap [Overview of all docs pages](/llms.txt)