Bugs that fix themselves overnight
AI bug fixing with a human merge: every morning, AI sorts our store’s overnight errors, fixes the real bugs and leaves each fix for my review.
Almost. They fix themselves overnight, and then they wait for me.
Every morning, before I open my laptop, Claude has read the night’s error reports from our store. It has closed the ones that aren’t ours and written down why. For the ones that are, it has written a fix and left it as a pull request with a note on what to check. Most mornings my part is to read and press merge. Some mornings there is nothing to do at all.
Errors nobody reports
An e-commerce store throws errors all day. Most are harmless: a bot fetching pages it doesn’t understand, a browser extension injecting its own script, an app’s built-in browser tripping over itself. A few are real, and the real ones rarely get reported. A shopper whose checkout button does nothing doesn’t write in. They leave.
We use an error tracker, Sentry, that catches errors on the server and in shoppers’ browsers. The tracker was never the problem. Reading it was. Sorting a hundred harmless reports to find the one that matters is exactly the kind of work that slides to “later”.
How we built it
Claude and I built this in pieces, the way we build everything: a Linear issue for each piece, and every change a reviewed pull request.
Every few hours, an automation files each new error from the tracker as an issue in Linear, our project planner.
Every morning, a routine starts a fresh Claude Code session in the cloud. It reads its instructions from our code repository, takes up to ten new issues and asks of each one: is this a real visitor, and is the cause our code?
Noise is closed with the evidence written on the issue. A real bug gets a fix on its own branch, tested on the cloud copy of the store, and a pull request that says what was wrong, what changed and what I should check.
When I merge, a line in the change closes the error and its Linear issue together. If a closed error ever comes back, its issue reopens by itself and the next morning’s run takes another look.
The routine sends my phone a notification only when a run needs me. Even that took a lesson: the first version sent it after the run had already counted as finished, so it never arrived. Now the notification is the last thing a run does. A quiet run, with nothing new, takes under a minute; how we got it that light is in Optimizing AI cost.
One of the first catches was a checkout bug no customer had reported. Two scripts set a shared value to the wrong kind of data, which stopped the checkout page’s script for some visitors. It took one small fix.
The guardrail: Claude proposes, I merge
The routine never merges. Merging deploys straight to the live store, so that stays with me. It takes at most ten issues and opens at most three fixes a run, so a morning’s review stays small enough to do properly. What counts as known noise is written into its instructions, because every run starts fresh, with no memory of the last.
And when it isn’t sure, it says so and stops. On 19 November the routine woke up to 18 error reports at once. One paid order had arrived with no delivery address, and every page and job that tried to read the address raised its own error. Our order approval job had already held the order, so nothing could ship to the wrong place. The routine traced all 18 reports to that one order, wrote down its best guess at the cause, marked it “not confirmed”, and left the decision to me because the fix would touch checkout.
Its guess was wrong, and that was fine. I took the issue into a working session with Claude, and we found the real cause: the shopper’s payment wallet gave their country in a form our country list didn’t expect, so the store quietly dropped the address. The same change fixed that, made the store keep an address it can’t place instead of dropping it, and gave shoppers something new: for up to an hour after paying, they can add or correct their delivery address on the thank-you page. Eighteen error reports, one cause, one reviewed change, merged the same day.
What it changed
Since mid-October, more than 80 error reports have gone through this loop. This morning, none is open.
Fixes don’t only come from the morning run now. Every working session follows the same rule: when Claude tests a change on the cloud copy of the store, any error its testing raises lands in a separate development project, and the session clears its own before calling the work done. When we retired some old admin pages while building gift cards, the eleven warnings they had been raising closed with the same merge.
The tracker also had to earn our trust. In late October it went quiet for days, which felt like good news. I asked Claude to check that it was still working. It was, but two very short filter patterns, each meant to ignore one specific error, matched inside almost every message, so most real browser errors were being dropped before they were sent. Automation can hide problems too. A quiet dashboard deserves as much suspicion as a noisy one.
Some errors came from scrapers dressed up as ordinary browsers. Rather than chase them every morning, we taught the tracker to drop reports that carry their telltale signs and never touch our own code.
For me, the biggest change is that errors are no longer a backlog I feel guilty about. The morning starts with a short review instead of a hunt.
One thing to copy
You don’t need our setup to start. Export last week’s errors from whatever you use (an error tracker, server logs, your hosting dashboard) and let your AI do the first pass: sort noise from real bugs, find the cause of the worst real one, and propose a fix you review. Claude Code, Codex and Cursor can open your code themselves; in a ChatGPT, Claude or Gemini chat, paste the export and the file it points to. Remove customer names, emails and addresses from the log first. You get back a short, ranked list and one fix to review.
Act as the night-shift engineer for my [website / app]. Below is an export of our recent errors [or: read them from (your error tracker)].
1. Group errors that share a cause. For each group, say how often it happens and how many people it seems to affect.
2. Sort the groups into noise (bots, browser extensions, in-app or very old browsers, outages at other services) and real bugs in our own code. Give your evidence for each, and say when you're unsure.
3. For the real bug that hurts the most people, find the root cause, not just the line where it fails. If you can't confirm it, say so and tell me what would.
4. Propose a fix as a small change I can review, with steps to test it and what could go wrong.
Don't change, deploy or merge anything until I say yes. If a fix touches payments or customer data, stop and ask me first.Once it works, most of these tools can run it on a schedule, as a scheduled task or a nightly job. Keep the merge for yourself.
The bugs still need a person. They just don’t need one at seven in the morning with a coffee and a hundred reports.
Michael Kuan runs iStyles.com, which makes Skins for phones, laptops, consoles and drones in over a thousand designs.


Discussion about this post