Skip to content
Agentguiden

ProgrammingCursorModerate

Ask Cursor to explain an error and propose a small fix

Give Cursor the error message and ask for an explanation before it changes code. You read the diff, and you run the test yourself.

Tool
Cursor
Category
Programming
Difficulty
Moderate
Published

Have the documents ready, and read the answer critically before you use it.

How to do it

  1. 1

    Copy the error as it appears in the terminal, including the file and line if they are there.

  2. 2

    Open the project in Cursor. Point at the file the error names, instead of asking the agent to search the whole repo at once.

  3. 3

    Ask it to explain what the error means, and to propose the smallest change that could fix this one thing. Ask it not to tidy other code along the way, and not to read secrets in environment files.

  4. 4

    Read the diff. If the suggestion changes more than the error calls for, reject it and ask again with a narrower task.

  5. 5

    Run the test or the command that failed. If it still fails, paste the new message.

Example prompt

Example prompt

Here is the error I get when I run the tests:

[Paste the error]

Look at the file it points to. Explain in plain words what is going wrong. Then propose the smallest code change that addresses this error. Do not refactor files that are not needed to make the test pass, and do not read .env files. I will read the diff before I accept anything.

Source

Agentguiden editors

The editors wrote this example. It is not based on an external article, and we have not invented quotes or figures.