November 29, 2026
The simple workflow that helped me fix a payment bug in one hour.
For 3 to 4 months, some of our customers couldn’t pay.

By Mohsinrazaa
3 min read
The simple workflow that helped me fix a payment bug in one hour. My team had been stuck on it for 3 months.
Not all of them. Just a few. That made it harder, because the bug didn't show up every time.
Our team looked at it many times. We watched Sentry, pushed a few fixes, and nothing solved it for good.
Then I tried a different way of working with Claude. I found the root cause and fixed it in about an hour.
I've been a software engineer for over 3.5 years. This is the workflow I use now for almost every bug.
Step 1: Find the root cause, with evidence
I don't ask Claude "fix this bug."
I ask it to find the root cause first, and to show me proof. Logs, code lines, the exact flow where things break.
Something like this:
"Find the root cause of this bug. Don't fix anything yet. Show me evidence for every claim: file names, line numbers, and logs."
This one change made a big difference. If Claude can't show evidence, I know it's guessing.
Step 2: Make a plan before writing code
Once the root cause is clear, I ask for a plan. What will change, which files, and what could break?
I read the plan myself before any code is written. It's much easier to catch a bad idea in a plan than in 200 lines of code.
Step 3: Write the code
Now Claude writes the fix, following the plan.
Step 4: QA and code review with sub-agents
This is the part I like most.
I ask Claude to use separate sub-agents:
- One sub-agent tests the fix (QA).
- Another sub-agent reviews the code.
If they find problems, the fix goes back, gets updated, and gets checked again. It runs as a loop until it's clean.
Why sub-agents? Two reasons:
- Speed. Tasks run in parallel instead of one by one.
- Cleaner context. Each sub-agent only focuses on its own job. One long chat with everything in it gets messy fast.
The payment bug
Back to that bug.
For months, I was only looking at the backend. That's where payments happen, so that's where the bug should be. Right?
This time, I gave Claude access to all our repos, not just the backend.
Claude found the problem on the frontend. Next.js was automatically retrying the GraphQL call 3 times when the backend didn't respond in time. Those extra retries were what broke the payment for some customers.
The fix was 2 lines.
Three months of trouble. Two lines of code. About an hour of work.
The lesson for me: give Claude the full picture. If I had kept it inside the backend repo, it would have searched in the wrong place, just like we did.
Claude also teaches me
This part surprised me.
While fixing bugs, I learned things I didn't fully understand before. For example, how retry mechanisms for third-party API calls should work, and how they can fail.
So it's not only fixing. I'm actually getting better as an engineer.
Where Claude gets it wrong
It's not perfect.
Sometimes Claude gives a solution that looks right but causes a ripple effect somewhere else in the system.
That's exactly why I use the plan step and the review loop. And I still read the final code myself. Claude is fast, but I'm responsible for what goes to production.
My tips if you want to try this
- Ask Claude how to use it best. I literally asked Claude how to work with it in an optimised way. That's how I started using sub-agents.
- Give Claude the full context. Share all related repos, not just the one you think has the bug.
- Always ask for evidence. No evidence, no fix.
- Plan before code. Read the plan yourself.
- Use sub-agents to speed up work and keep context small.
- Review everything yourself. Don't merge blindly.
That's it
This workflow didn't make me a different engineer. It just made me faster and more careful at the same time.
How do you use AI for debugging? I'd love to hear your workflow in the comments.