A runaway agent loop that quietly runs overnight can burn $200 an hour on nothing. Detecting one takes three signals; stopping it takes one kill switch. Here's what to watch, what threshold to set, and how ClawMetry surfaces both.
First: message-repeat. The agent is submitting the same or near-identical message N times in a row (three is usually enough). Second: no-progress heuristic. Tokens per turn are climbing while output length stays flat (the model is being fed more context but producing the same length of response). Third: cost per hour crossing a per-session threshold you set. Any one is suggestive; two together is confirmation.
Pause first, kill second. Pausing (an approval queue) lets you inspect the state (last tool call, last message, sub-agent tree) and decide whether to resume with a fix or terminate. Killing outright is right when the loop is clearly stuck and there is no other operator available. Either way, the trigger point is BEFORE the next call, not after; the difference between $2 and $200 is whether the intervention happened at turn 8 or at turn 108.
Different runtimes need different kill mechanics. OpenClaw and Hermes have a gateway that ClawMetry Pro can signal via a container-kill hook. Claude Code and Codex are CLI processes ClawMetry can SIGTERM. n8n exposes an execution-stop API. QM runs on Postgres and can be paused by revoking the run's lease. Every runtime page (clawmetry.com/runtimes/<slug>) documents which mechanism applies.
Two per-session gates. Cost cap (dollars per hour, session-scoped) is the money-side guard. Turn cap (typically 50-100 for interactive sessions, higher for autonomous crons) is the loop-side guard. Both fire the approval queue; the operator decides whether to lift or terminate. Neither should be so tight that a legitimate long-running task trips constantly, so start loose and tighten over the first week of visibility.
Approvals tab: every session currently waiting on an approval, plus a history of pauses and their outcomes. Cost tab: per-session cost curves with the threshold overlay. Brain tab: the live message stream where a loop shows up as repeated identical entries. Sub-agents tab: nested trees so you can catch a runaway inside a Task-spawn or a LangGraph node.
Start the free trial →