How Do You Ask Claude What Would Break Your Code?
Ask for failing inputs, not an opinion. Hand over the change and its callers, and ask for concrete inputs or sequences that give a wrong result, ranked by damage. In Claude Code, use a subagent or a second session, so the reviewer hasn't seen the reasoning behind the code.
Use a subagent that hasn't seen this conversation. Have it read [path or diff] and the code that calls it, then try to break it. Report at most [5] failures. For each one give: - the exact input, or the sequence of calls and timings - what happens now, with file and line - what should happen - a short test that would show it Only report a failure it can trace through the code. Callers here already guarantee: [list, such as "amount is validated by the API schema"]. Rank by how much damage each would do in production. Skip style. Then run the test for the top failure and show me whether it really fails.
- 1Fresh reviewerhasn't seen your reasoning
- 2Concrete failing inputsranked by damage
- 3You verifydrop what callers already prevent
- 4Failing tests, then fixesfix only what fails
- 5 to 15 minTypical review
- 3Free runs per accountPro, Max and Ultra, one time only
- $5 to $25Typical cost after thatin usage credits
- 500 / 8,000Changed files / linesdefault branch review limit
Try it now
- 1After finishing a change in Claude Code, paste the prompt and fill in what your callers guarantee.
- 2Read the top failure and follow its path through the code yourself.
- 3Ask
add the tests that fail, then fix those. Each one stays behind as permanent coverage. - 4You'll know it worked when a reported failure comes with a test that goes red. A list with no failing test is a list of guesses.
Use it when
Before you merge anything that touches money, auth, data integrity or untrusted input, once the ordinary tests pass. It also fits a new function that other code will depend on.
Skip it when
Cosmetic changes, or a prototype you'll throw away. For a general bug hunt on your branch, start with /code-review, which needs no prompt at all. For security specifically, /security-review checks your branch's diff for risks such as injection, auth issues and data exposure. It needs an origin remote.
Why it works
A reviewer that watched the code being written shares its assumptions. Anthropic's docs say a fresh reviewer helps because it hasn't seen your reasoning, while handing the same task to a subagent doesn't make the answer any better by itself. A request for specific failing inputs also gives you something you can run. Anthropic's Code Review service uses the same idea at a larger scale: several agents search in parallel, then a verification step checks the findings against the code and filters out false positives. In your own prompt, that verification step is you. The docs also warn that a reviewer asked to find problems will always find something, so rank and verify instead of fixing the whole list.
Example
Say you give it a date-range filter and its two callers. It might report that a start after the end returns every row, that a null end throws, and that a time-zone-naive comparison drops the last day for users east of UTC. If you've told it the API schema already rejects a null end, that one shouldn't appear. You then ask for the other two as tests, and only fix what fails.
Going further
For a big change before you merge, /code-review ultra launches a fleet of reviewer agents in a cloud sandbox, and the docs say every reported finding is independently reproduced and verified. It typically takes 5 to 15 minutes. It needs a claude.ai sign-in. Pro, Max and Ultra get three free runs, once per account, then a review typically costs $5 to $25 in usage credits, and the launch dialog shows an estimate before you confirm. A branch review covers up to 500 changed files and 8,000 changed lines by default. It's a research preview, so these details may change.
Common mistakes
- Fixing every item. Anthropic warns this leaves you with extra abstraction layers and tests for cases that can't happen.
- Asking in the session that wrote the code, where all the reasoning is already in the conversation.
- Leaving out what callers guarantee, so it reports failures they already prevent.
- Stopping at the list. Without a failing test, a finding is only a claim, and it leaves nothing behind.
Sources
- Best practices, Claude Code docs
- Code Review, Claude Code docs
- Find bugs with ultrareview, Claude Code docs
- Commands, Claude Code docs
Checked 6 November 2026. Products change often, so confirm details with the vendor.