Bug Triage Prompt: Classify, Prioritize and Find Root Cause
A bug triage prompt for Claude that classifies a report, rates severity, ranks root-cause hypotheses with evidence and lists the next diagnostic steps to run.
By Claudekit Team Published 2 min read
- Category
- Coding
- Use case
- Triage a bug report or error log and decide what to investigate first
- Tested with
- Claude Fable 5.1, Claude Opus 5.5, Claude Sonnet 5.5, Claude Haiku 5.5
Use this prompt when a bug report, failing test or production error lands on your desk and you need to decide how urgent it is and where to look first. It separates evidence from hypotheses so you do not chase the first plausible guess.
The prompt
You are a senior engineer on call. Triage the bug below. Your output will decide who works on it and what they check first, so be precise and evidence-based.
<bug_report>
{{BUG_REPORT}}
</bug_report>
<evidence>
Logs / stack traces / screenshots description:
{{LOGS}}
Relevant code (optional):
{{CODE}}
</evidence>
<context>
System overview: {{SYSTEM_CONTEXT}}
Recent changes or deploys: {{RECENT_CHANGES}}
</context>
<instructions>
1. Restate the bug in one sentence: expected vs actual behavior.
2. Classify it (crash, data corruption, security, performance, UI, integration, other) and assign a provisional severity: S1 critical, S2 major, S3 minor, S4 cosmetic. Explain the severity in one line based on user impact.
3. List 2 to 4 root-cause hypotheses, ranked by likelihood. For each, cite the specific line of evidence that supports it and what would rule it out.
4. Give the smallest reproduction steps you can derive. If you cannot, say what is missing.
5. List the next diagnostic steps in order, each with the exact command, query or log search where possible.
6. Do not propose a code fix yet unless the evidence makes the cause certain.
7. If key information is missing, list the questions to send back to the reporter.
</instructions>
<output_format>
## Summary
## Classification and severity
## Hypotheses (ranked)
## Reproduction
## Next diagnostic steps
## Questions for the reporter
</output_format>
How to use it
- claude.ai: paste the ticket and logs. Trim logs to the window around the error.
- Claude Code: Claude can read the code and run commands itself, so give it the ticket and say “investigate, but do not edit files.” Save it as a skill at
.claude/skills/triage/SKILL.mdand pass the ticket with$ARGUMENTS; see the skills guide. To keep long log output out of your main context, ask it to use a subagent; see the subagents guide. - API: send logs before instructions; useful for automated first-pass triage on new tickets.
Variables
| Variable | What to put there |
|---|---|
{{BUG_REPORT}} | The ticket or user report as written |
{{LOGS}} | Error messages, stack traces, relevant log lines |
{{CODE}} | Suspected code, if known |
{{SYSTEM_CONTEXT}} | Services involved, stack, environment |
{{RECENT_CHANGES}} | Recent deploys, migrations, config changes |
Example output (illustrative)
## Hypotheses (ranked)
1. Null session after token refresh (likely)
Evidence: "TypeError: cannot read 'userId' of undefined" at auth.ts:88, started after Tuesday's deploy.
Rule out: reproduce with a fresh login; if it fails too, hypothesis 1 is wrong.
Tips and variations
- Batch mode: for a backlog, ask only for classification and severity in a table.
- After diagnosis: ask for a fix plus a regression test, then review it with the code review prompt.
Frequently asked questions
Does this prompt fix the bug?
No, on purpose. It produces a diagnosis plan. Proving the cause before changing code avoids fixes that only hide the symptom. Once the cause is confirmed, ask Claude to implement and test the fix.
What if I only have a vague user report?
The prompt asks Claude to list the missing information and the questions to send back to the reporter, and to keep severity provisional until reproduction succeeds.
Can I use it for many tickets at once?
Yes, for a quick severity pass. For root-cause hypotheses, send one bug at a time so each gets full attention and its own evidence.