# Track down a bug that only happens sometimes

> It fails one time in ten, and every fix seems to work until it doesn’t.

Web page: https://buildladder.com/resources/prompts/intermittent

What you get: The conditions that make it fail, a way to trigger it on demand, then a fix.

Paste it into: Your AI tool, in your project

## Prompt to copy

```text
This bug only happens sometimes: [describe it].

Don't propose a fix yet. First work out what could vary between a good run and a bad one: timing and the order two requests finish in, double clicks, a slow or failed network call, leftover state from a previous action, time of day, or data that only some records have.

For the most likely causes, find a way to force the failure every time, for example by adding a delay or sending the same request twice. Once you can trigger it reliably, show me. Then fix the cause and run the same trigger again to prove it's gone.
```
