In December, I participated in the Build With Cursor London hackathon, where the new Cursor SDK was released. I built Agentfix, which lets AI fix live systems without you ever needing to submit a PR.
- It wraps a child process running your application.
- It actively monitors the stream for errors as they occur.
- The instant an error is detected, the AI (via the Cursor or Claude SDK) is fed the error context and immediately attempts to patch the code on the file system.
- The watcher then automatically reloads the web server/application with the fix applied.
This project is a deliberate attempt to put a high degree of trust in AI for real-time system maintenance. The goal is to maximise our precious deep flow state by eliminating annoying bugs, allowing you to focus entirely on vision.
```
│ Terminal │
│ │
│ $ agentfix npm run dev │
│ │
│ AgentFix │
│ Starting: npm run dev │
│ Using provider: Cursor │
│ Monitoring for errors... │
│ │
│ Demo server running at http://localhost:3000 │
│ │
│ TypeError: Cannot read properties of undefined │
│ (reading 'toUpperCase') │
│ at server.js:35:43 │
│ │
│ [agentfix] Error detected! │
│ Type: TypeError │
│ Message: Cannot read properties of undefined │
│ (reading 'toUpperCase') │
│ File: server.js:35 │
│ │
│ [agentfix] Fixing... │
│ I'll help you fix this TypeError. Let me first examine │
│ the server.js file to understand the context around │
│ line 35. │
│ │
│ [agentfix] read: Reading server.js │
│ │
│ I can see the issue clearly. On line 35, there's a typo: │
│ `u.nmee` should be `u.name`. The property `nmee` doesn't │
│ exist on the user objects, so it returns `undefined`, and │
│ calling `toUpperCase()` on `undefined` causes the │
│ TypeError. │
│ │
│ [agentfix] edit: Editing server.js │
│ [agentfix] Modified: server.js │
│ │
│ Restarting 'server.js' │
│ Demo server running at http://localhost:3000 │
│ │
│ The error has been fixed. The issue was a simple typo on │
│ line 35 where `u.nmee` should have been `u.name`. │
│ │
│ [agentfix] Fixed server.js │
│ Hot reload should kick in shortly... │
Completely agree with the points in this piece. Regret minimisation for the perceived future regrets in a teenager's mind is going to be very different to that of someone in their mid twenties.
It needs to be calibrated with the best estimates of one's future regrets. E.g. when I am 40, I will regret not having children. Therefore I should get my life in order during my late twenties and early thirties to avoid this future regret.