Run it and fix errors with the AI
Goal. Run the code, and when it breaks, let the agent diagnose and fix it instead of you debugging by hand.
I ran the script and got this error: `ModuleNotFoundError: No module named 'seaborn'`. Fix it and make the script run end to end.
Paste an error message straight into the chat. In Agent mode Cursor can run the code itself and iterate until it works — installing what's missing and re-running.
- 1Run your script. If it errors, copy the traceback and paste it into the chat — Cursor diagnoses the cause from your actual code, not a generic guess.
- 2In Agent mode the agent can run the code, see the failure, and iterate — fixing imports, paths, or logic and re-running until it succeeds.
- 3Review each fix it proposes before accepting. This run-and-fix loop is the core of working with Cursor: describe, run, paste the error, repeat.
You'll see. The error explained in plain English and resolved automatically, with the script running cleanly to produce its output.
Cost. Each fix-and-rerun is an Agent request against your included usage — batching the error and the goal into one message (as above) spends fewer of them.
Takeaway. Paste the error and let the agent run, diagnose, and fix — the iterate-to-green loop replaces manual debugging.