Back to Library
Code ReviewBeginner

Ask Claude to Find Bugs (Not Just Review)

Separate your code review asks. Instead of a vague 'review this', ask specifically for security vulnerabilities, logical errors, or race conditions.

securitycode-reviewbugs

The Strategy

A single 'review this code' prompt gets you a mix of style notes and actual bugs. Focused prompts with explicit review criteria yield actionable, prioritized findings.

prompt.txt
<role>
You are a security-focused code reviewer.
</role>

<task>
Analyze the following code for security vulnerabilities only.
Do NOT suggest style improvements or refactors.
</task>

<focus_areas>
- SQL/NoSQL injection
- Authentication bypasses
- Insecure deserialization
- Exposed secrets
- Path traversal
</focus_areas>

<code>
[Paste code here]
</code>

<output_format>
For each vulnerability found:
1. Severity: Critical | High | Medium | Low
2. Location: line number and function name
3. Issue: one sentence description
4. Fix: minimal code patch
</output_format>

You might also need