
Cursor + Claude: stop shipping flaky Next.js APIs
I use Cursor + Claude to turn “random 500s” into a reproducible test. I add one wrapper: request ID + timing + safe error output. I write a tiny Node script to hammer endpoints and catch regressions. No new infra. Just code you can paste today. Context I build small SaaS projects. Usually solo. Usually fast. And the fastest way to lose a weekend is an API route that fails “sometimes”. You see a 500 in the browser. Then it works on refresh. Then it dies again. Brutal. I used to chase logs by vibe. Console spam. Random try/catch . Half fixes. Spent 4 hours on this last month. Most of it was wrong. The only thing that consistently helps: make failures reproducible, make errors visible (but not leaky), and lock it in with a script I can run before I push. This is that workflow. Cursor to refactor fast. Claude to keep me honest on edge cases. Me to write the final code and own the mess. 1) I start with a failing script. Not vibes. If I can’t reproduce it locally, I’m just guessing. So I wri
Continue reading on Dev.to Tutorial
Opens in a new tab


