Runtime context beats guessing
If you’ve ever watched an agent try to fix a bug, you’ve watched it guess. It reads the code, comes up with a theory, makes an edit, and hopes. Sometimes it’s right. A lot of the time you get a fix that looks confident and quietly hides the real bug.
Debug Mode is what we built for that. Instead of sitting there reasoning about the code, the agent goes and gets evidence about what the code does when it runs.
Here’s the loop
- Agent comes up with multiple hypotheses, and starts to work on the most plausible first
- Then, logging is added to test one hypothesis (without touching implementation)
- A little debug server collects the runtime output to .cursor/debug.log while your program runs.
- You reproduce the bug, and agent can now read the logs and understand what happened instead of having to guess
- Cursor finds the root cause in the logs, makes the fix, and pulls out the logging it added.
Here it is on a real bug, sped up to about a minute:
How the team uses it
Some interesting things that we’ve solved internally with debug mode:
- A race condition that hit 1 in 20 runs. It was corrupting git metadata in our best-of-N runs. Debug Mode pinned it down in under an hour
- A memory leak, traced in one pass. It came down to a misuse of our frontend framework. The fix was a single line.
- A native crash deep in C++. An Electron crash people would normally route around. The logs made it findable.
- An SSR flicker that had been given up on. A rendering bug nobody wanted to touch, fixed once the agent could see what the page was doing at runtime.
Try it with Shift+Tab (it’s in the CLI too, via /debug).
I’m sure people are using it in ways I haven’t thought of, so let me know!
Watch agent fix bug, you watch it guess. Read code, form theory, edit, hope. Sometimes right. Often confident fix that quietly hides real bug.
Debug Mode is our answer. Agent stops reasoning about code, collects evidence of what code does at runtime.
Loop:
- Agent forms multiple hypotheses, starts with most plausible
- Adds logging to test one hypothesis (implementation untouched)
- Small debug server collects runtime output to .cursor/debug.log while program runs
- You reproduce bug. Agent reads logs, sees what happened. No guessing
- Cursor finds root cause in logs, fixes, removes its logging
Real bug, sped up to about one minute:
How the team uses it
Solved internally with Debug Mode:
- Race condition, 1 in 20 runs, corrupting git metadata in our best-of-N runs. Pinned down in under an hour
- Memory leak, traced in one pass. Misused frontend framework. Fix: one line.
- Native crash deep in C++. Electron crash people normally route around. Logs made it findable.
- SSR flicker everyone gave up on. Nobody wanted to touch it. Fixed once agent saw page at runtime.
Try it: Shift+Tab (CLI too, via /debug).
People use it in ways I have not thought of. Tell me!