Debug
Find root causes, reproduce failures, and fix bugs without guesswork.
Describe the symptom Hand Claude a well-scoped bug it can act on immediately. Debug Give specific context Best practices
Bug: <what users actually see>. It most likely lives in <area or files>. A correct fix means <observable success>. Write a failing test that reproduces it first, then fix the root cause. Investigate with a subagent Explore a subsystem without bloating your main context. Debug Use subagents Best practices
Use a subagent to investigate how <system or flow> works across the codebase and report back a concise summary. Don't change anything yet — just map it out. Pipe logs to Claude Triage a log file without leaving the terminal. Debug Headless & pipes Best practices
tail -n 200 <logfile> | claude -p "Flag any anomalies or errors in these logs and name the most likely root cause." Print-debug plan Instrument a hard-to-see bug, then clean up after. Debug Verify your work Best practices
Add targeted logging to narrow down <issue>. Tell me exactly what output to look for and what each value would mean. Once we've found the cause, remove the logs. Read before you claim Stop confident-but-wrong answers about unread code. Debug Read before claiming Prompting
Read <file> in full before you answer. Never speculate about code you haven't opened — if you need another file to be sure, open it first, then explain what's wrong. Regression bisect Pin a regression to the exact change that introduced it. Debug Point to sources Best practices
This worked before my recent changes. Review the diff in @<files> and identify which specific change most likely caused <symptom>. Explain the mechanism. Reproduce then fix Turn a bug into a permanent regression test. Debug Verify your work Common workflows
Write a minimal failing test that reproduces this bug and confirm it fails. Then fix the underlying cause and show the same test passing. Root-cause first Understand a bug before touching any code. Debug Fix root causes Best practices
Here's the error: <paste>. Don't fix anything yet — trace the root cause, list the top 2 hypotheses ranked by likelihood, and tell me which files to look at. Screenshot diagnosis Diagnose a visual or UI bug straight from an image. Debug Use images Common workflows
[paste screenshot of the error or broken UI] What's causing this? Trace it to the responsible code and explain the mechanism before proposing a fix. Stack-trace triage Get a fast, precise read on where a crash originates. Debug Give specific context Common workflows
Given this stack trace <paste>, point to the exact line responsible and explain in 2 sentences what is null/undefined/throwing and why. No prompts match your filters.