Back to guide/Developer Tools

Debug with Copilot Chat

Giving Copilot the exact error, file reference, caller context, and what changed recently narrows the search space dramatically. Asking for ranked causes prevents the model from fixating on the first plausible explanation.

copilot-promptsfilePathlineNumbererrorMessage
Edit View
Prompt
I'm getting this error in #file:{{filePath}} at line {{lineNumber}}:

\`\`\`
{{errorMessage}}
\`\`\`

Context:
- This function is called by {{callerDescription}}
- The input data comes from {{dataSource}}
- It worked before {{whatChanged}}

Diagnose the root cause. Explain why it's happening, then provide a fix. If there are multiple possible causes, list them ranked by likelihood.

Variables to customize

{{filePath}}{{lineNumber}}{{errorMessage}}{{callerDescription}}{{dataSource}}{{whatChanged}}

Why this prompt works

Giving Copilot the exact error, file reference, caller context, and what changed recently narrows the search space dramatically. Asking for ranked causes prevents the model from fixating on the first plausible explanation.

Save this prompt to your library

Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.