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.
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
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.
Related prompts
Get thorough code reviews with actionable feedback tailored to your language, framework, and standards.
Context-Aware Code CompletionProviding the surrounding code and project context lets the model match existing patterns exactly. The constraint against modifying existing code prevents unwanted side effects.
Inline Code SuggestionConstraining suggestions to match existing style and scope produces insertions that feel native to the codebase. The 'no explanation' rule mimics real inline completion behavior.
Code ExplanationThe audience level parameter adjusts complexity automatically. Requiring a usage example ensures the explanation is practical, not just theoretical.