DEV Community

Sumit Patel
Sumit Patel

Posted on

When my app breaks, the answer is in the code. So I let my coding agent start there.

Every time one of my apps went down, the same thing happened. I'd glance at the dashboards, see that something was wrong, and then spend the next hour in the code working out why.

At some point I noticed I was doing that last part with Claude Code open anyway. So I started wondering: what if the agent started there, before I even sat down?

That side project became PrismaLens. I built it for fun, mostly to see how far a coding agent can get on its own when something breaks. This week I shipped version 0.5.1, so here's what it does and what I learned.

What it does

When your monitoring says something is wrong (or you describe the problem yourself), PrismaLens:

  1. Makes a fresh, throwaway copy of your app's code. Your real folder is never touched.
  2. Hands the problem to the coding agent you already use: Claude Code, Codex or OpenCode.
  3. Lets the agent read the code and check your app's metrics.
  4. Gets back a short report: the likely causes, most likely first, each with the evidence the agent found.

Everything the agent did, and why it thinks what it thinks, stays saved next to the problem, so you can check its work.

A few choices I made on purpose

It starts from the code. Most AI tools for outages start from logs and dashboards. Those tell you what broke. The code usually tells you why.

It never calls an AI model itself. It drives the agent you already have, with that agent's own login. So there's no account, no subscription and no AI bill from me.

No confidence percentages. "87% likely" sounds precise but means nothing. The report just ranks the causes and shows the evidence for each, so you can judge.

It only looks unless you say otherwise. When it starts by itself, the agent can read but can't change anything. When you start it, you pick how much it's allowed to do, and anything risky waits for you to approve or deny it.

One command, no setup. It runs on your own machine:

npm install -g prismalens
pl up
Enter fullscreen mode Exit fullscreen mode

No Docker, no database to set up. It opens in your browser at localhost:6473.

What I learned building it

  • Agents are good at reading code under pressure; they're bad at knowing when they don't know. A report that says "I couldn't find the cause, here's what I checked" turned out to be more useful than a confident wrong answer, so I made that an allowed outcome.
  • Permissions are the hard part. My first versions stacked so many safety layers on top of the agent that it could barely do anything. In 0.5.1 I went back to using the agent's own permission modes and showing you its requests, which is simpler and easier to trust.
  • Most of the code was written with AI coding agents. I reviewed and tested every release by hand, walking through it like a new user would. That walk-through caught far more than the tests did.

Try it

If you don't want to point it at your own app yet, there's a small demo app in the repo that you can break on purpose and watch PrismaLens investigate.

It's early (0.x, things will change), the desktop app is an unsigned preview, and right now it connects to Prometheus-style monitoring. It's only as good as your agent and what it can access.

👉 github.com/prismalens/prismalens

If you try it the next time something breaks, I'd genuinely love to hear what it got right and what it missed.

Top comments (0)