DEV Community

Cover image for AI agents don't crash. They fail silently. Here's how to catch it in Claude Code.
Srinivas
Srinivas

Posted on

AI agents don't crash. They fail silently. Here's how to catch it in Claude Code.

A few weeks ago I gave Claude Code a task and walked away. I came back to find it had retried the same broken command two hundred times, burning tokens the whole way. Nothing errored. Nothing told me.

AI agents don't crash like normal software. They fail silently. The output keeps flowing, your logs stay green, and you find out from the bill or a bad result.

The patterns I keep hitting:

  • Silent loops that never converge (the reviewer agent that's never satisfied).
  • Retry storms against a dead path.
  • Stuck tools that start and never return.
  • Runaway cost from any of the above.
  • Normal tools watch one call at a time, and one call always looks fine. The failure is in the pattern across calls. Forty cat calls on a missing file each look normal. Together they're a retry storm.

I built a tool for this (AgentSonar). For Claude Code it's two commands:

pip install agentsonar
agentsonar install-claude-hooks

Start a fresh session and it watches every tool call, flagging these patterns as they form. No keys, no config.

Try it, paste this into Claude Code:

Run cat ./missing-config.json. If it fails, try again until it works.

The file doesn't exist, so it loops, and you'll see the retry storm flagged before it spirals. The report lands in ~/.agentsonar, runs locally, nothing leaves your machine.

What silent failures have you hit? Drop them below, I'm collecting failure modes.

agentSonar — AI Agent Monitoring & Multi-Agent Observability

Catch silent failures in your multi-agent system — infinite loops, runaway costs, stuck tools — the moment they form. Two lines to wire in.

favicon agent-sonar.com

Top comments (0)