AI prompts for Developers
Prompt to analyse an error and find its cause
Reads the error, stack trace, and related code, then ranks likely causes with a way to check each one.
When to use it When an error makes no sense, or the obvious fixes did not work.
The prompt, ready to copy
Role: developer experienced in tracking down bugs. Task: help me find the cause of the error below. Context: - Environment: [language, framework, versions, OS] - What I was doing when it appeared: [steps] - When it started: [after an update / a change / always] - What I tried that did not work: [list] Error and stack trace: <log> [Paste it in full. Remove any tokens, keys, or user data in it] </log> Related code: <source> [The section the error points to] </source> Constraints: - Do not settle on one cause if the information is not enough; rank the possibilities - For each: how to check it before changing anything - If you need more information (version, file, log), ask for exactly that Output: Table: likely cause | why you suspect it | how to check | fix if confirmed
Example of filled brackets
Environment: Node 22, Next.js 15, on Ubuntu What happened: error only in production when uploading files over 5 MB Started: after updating the upload library Tried: raising the request timeout
Check these before you use it
- Confirm the cause before applying a fix; do not try fixes at random
- Recheck the pasted logs for sensitive data
How to use this prompt
- Copy the prompt: Press the copy button or select the whole text.
- Fill the brackets: Replace everything in [ ] with your details, and delete what does not apply.
- Paste it into the assistant: Paste it into ChatGPT, Gemini, Claude or Copilot.
- Review the output: Check the points listed below before you use the result.