# Cursor 推出 Debug Mode：让 AI 智能体通过运行时日志修复 Bug

- 来源：eric zakariasson (@ericzakariasson)
- 发布时间：2026-06-03 23:45
- AIHOT 分数：74
- AIHOT 链接：https://aihot.virxact.com/items/cmpy97nuq02x7slaxpujlnvdu
- 原文链接：https://x.com/ericzakariasson/status/2062199026544787576

## AI 摘要

Cursor 发布 Debug Mode，解决 AI 智能体靠猜测修 Bug 的问题。工作流程：Agent 先生成多个假设，为最可能的假设添加日志（不修改代码）；调试服务器在程序运行时收集输出到 `.cursor/debug.log`；用户重现 Bug 后，Agent 读取日志而非猜测；最后 Cursor 从日志找到根因并修复，自动移除添加的日志。内部案例：追踪 1/20 概率出现的 git 元数据竞争条件（1 小时内定位）；一次单趟追踪内存泄漏（修复仅一行）；定位 Electron 中 C++ 原生崩溃；修复此前无人敢碰的 SSR 闪烁问题。用户可通过 Shift+Tab 或在 CLI 中使用 `/debug` 触发。

## 正文

http://x.com/i/article/2061967596568875008

# Don't let your agent guess， give it runtime context

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

1. Agent comes up with multiple hypotheses， and starts to work on the most plausible first

1. Then， logging is added to test one hypothesis （without touching implementation）

1. A little debug server collects the runtime output to .cursor/debug.log while your program runs.

1. You reproduce the bug， and agent can now read the logs and understand what happened instead of having to guess

1. 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！
