LoopLens

See why your agent loop went round again.

A local tool for Claude Code users who script loops

LoopLens runs a Claude Code loop on your own machine under hard limits and records every pass: the prompt it sent, the model that answered, each tool call, the quota Claude Code reported, and the stop check that decided whether to go again. Afterwards you can replay the run, and re-check it with a different stop condition, without spending quota.

Not public yet. Built and tested on Windows 11 with Node 24; macOS and Linux have not been tested.

The same six-pass example run, scored twice: as recorded, and re-checked with a different stop condition.
Stop condition Pass1 Pass2 Pass3 Pass4 Pass5 Pass6 Passes run
As recordedoutput matches DONE$ Stop check not met, looping again Stop check not met, looping again Stop check not met, looping again Stop check not met, looping again Stop check not met, looping again Stop check not met, run ended at the iteration limit 6
Re-checkedoutput contains DONE Stop check not met, looping again Stop check met, the loop stops here Skipped Skipped Skipped Skipped 2
  • Stop check not met: looping again
  • Stop check met: the loop stops
  • Skipped: the pass never runs

As recorded: output matches DONE$Re-checked: output contains DONE

The example run from the screenshots below, scored twice. Checking for DONE anywhere in the output would have stopped it at pass 2: four passes, 489 output tokens, US$0.0191 and 29.1 seconds sooner. No model is called.
LoopLens after replaying a six-pass run. The what-if panel says the run would have stopped at iteration 2, saving 4 iterations, 489 output tokens, US$0.0191 and 29.1 seconds. Below it, iteration 2 is marked 'what-if stops here'.
A recorded six-pass run from a made-up invoicing app, re-checked with the what-if. Every run, file and figure on this page is fictional example data.

One iteration, laid out

Iteration 1 of 6. The prompt sent, model haiku requested and claude-haiku-4-5-20251001 served, seven-day usage 12%, a Read of src/gst.ts, a failing npm test, and the stop check: not met, looping again.
  1. Prompt sent. Your goal on the first pass, your continue prompt on every pass after it.
  2. Model requested and model served. You ask for haiku; the card shows claude-haiku-4-5-20251001 answered, so a quiet fallback cannot hide.
  3. Quota. Each usage report Claude Code sends, shown as it arrives.
  4. Tool calls and results. Claude Code's own Read, Edit and Bash calls, with failures in red.
  5. Stop check. The condition, its verdict, and what the loop did next: stop, or go round again.

What if it had stopped sooner?

A loop told to stop when the output ends in DONE keeps going when the model writes DONE. with a full stop. You only find out when the quota is gone.

Pick any recorded run and try a different stop condition, quota ceiling or cost cap. LoopLens re-checks every pass it recorded and tells you the pass it would have stopped at, and what the later passes used in tokens, estimated cost and time. No model is called.

In the example, the regex DONE$ ran all six passes. Checking for DONE anywhere shows the loop would have stopped at pass 2, four passes and just under US$0.02 sooner.

The what-if panel: stop when output contains DONE. Would have stopped at iteration 2, saving 4 iterations. Iteration 1 not met, 2 stops, 3 to 6 skipped.

It only re-checks what was recorded. If a condition never matches, it says so rather than guessing how much longer the loop would have run.

Ceilings that stop a live loop

Set a quota ceiling and LoopLens stops the loop, including the request in flight, as soon as Claude Code reports usage at or above it. Set a cost cap and it stops after the pass that reaches it.

Every run also has an iteration limit, a time limit, a cap on the agent's own tool-use turns per pass, and a Stop button that ends the request in flight.

Iteration 3 reports seven-day usage of 39 percent. A note reads: ceiling reached, at or above the 38 percent ceiling, stopping. The run ends with reason quota ceiling.
A Mock-backend run. Its usage figures are simulated and labelled that way.

Cost is Claude Code's own estimate in US dollars. On a Pro or Max subscription it is not a bill.

Runs on your machine

Where it runs
One Node process bound to 127.0.0.1, with nothing to install beyond Node. Transcripts are plain JSONL files in a folder you choose.
Whose login
The Claude backend runs the claude CLI you already use, signed in the way it already is. No API key and no gateway.
Who it answers
Only its own page. Requests from other websites are refused, prompts reach the CLI on standard input so text in a goal can never become a command-line option, and permission settings come only from your own environment.
What it is not
It is not made by or connected with Anthropic, and it is not a way around your plan's limits. You are responsible for using your subscription within Anthropic's terms.

Free early access

LoopLens is a free early access build. There's no billing set up, so there's nothing to pay and no card to enter.

Every feature is included while it's in early access:

  • Claude Code and Mock backends, plus an unverified OmniRoute backend, off by default because it can send prompts to third-party relays
  • Live iteration view with the stop check on every pass
  • Iteration, time and inner-turn limits, and Stop
  • Quota and cost ceilings that stop a live loop
  • Recording and replay at 1x to 20x
  • What-if checks on recorded runs, with no cap
  • Two recorded runs side by side: settings, outcome and every iteration
  • Export a recorded run as one HTML file, with paths, emails and keys redacted

It's still being worked on, so things may change. Feedback is welcome at [email protected].