A coding agent's mating ritual: npx vitest run, 5 times

When a coding agent repeats the same tool call five times within three minutes, Caprock raises a loop alert. It stops nothing: it tells you. Free.

Demo data: the session, the command, "5 times in 36 seconds" and the costs come from Caprock's demo screenshot. Voice-over and the two nature shots are AI-generated.

Watch on: YouTube Shorts

More explainers on YouTube Follow the build: YouTube Instagram Threads X

Transcript

The ritual

Here we observe a coding agent's mating ritual. npx vitest run. npx vitest run. npx vitest run.

Five times in thirty-six seconds.

In the wild, this is called a loop. Each attempt still costs tokens.

Its keeper is in another tab.

The loop alert

Caprock watches every session on your machine. Five of the same tool call within three minutes, and a loop alert appears.

Reading files doesn't count. Re-reading is normal for the species.

The alert stops nothing. It tells you.

Tell the agent, and your message waits in its queue until its turn ends, on sessions Caprock started. Or dismiss it.

Not with a stop

And so the ritual ends. Not with a stop, but with a message.

Loop alerts are free. Caprock: free and open source. caprock.dev.

How it works

  • Five of the same tool call in three minutes.

    Then Caprock raises one loop alert: a sentence that names the command and how often it ran. Loop alerts →

  • Reading files does not count.

    Read, Grep and Glob are left out, because re-reading after an edit is normal work.

  • It stops nothing.

    Tell the agent puts your message in that session's queue, and the agent reads it when its turn ends. Or dismiss it, or mute that command for the session.

  • It types only into sessions Caprock started.

    Tell the agent is offered only there. For a session you started in your own terminal, Caprock never types into it and offers Open session instead.

  • Free.

    Loop alerts are in the free, open-source app, for Claude Code, Codex and Cursor sessions alike.

See every coding agent you run.

Who is waiting on you, who is stuck, how close the limit is. Free and open source; nothing leaves your machine.

Caprock is a desktop app: it installs on your computer, not your phone.

Or email yourself the link:

macOS, Windows and Linux. Your phone pairs with it by QR code. Install options →

Download on the App StoreDownload on the App Store

On an iPhone, pair it with the app.

Download for Mac

Notarized by Apple. One file for Apple silicon and Intel, macOS 13 or later.

Download for Windows

Windows 10 22H2 or later, x64. Windows may ask once whether to run it: click More info, then Run anyway.

Paste it into Claude Code, Codex or any coding agent.

See what it says ▾
Install the Caprock desktop app for me. It is open source (Apache-2.0), a local
app for my coding agents: https://github.com/dspv/caprock

What the install does and how to remove it:
https://github.com/dspv/caprock/blob/master/docs/install-agent.md

Run the install script for my system: https://caprock.dev/mac.sh, /win.ps1 or
/linux.sh. Read it before you run it if you like. Leave my Claude Code settings
alone; the app asks me itself. Tell me when it's open.

Or run it yourself:

curl -fsSL https://caprock.dev/mac.sh | sh

Paste in Terminal: it installs Caprock and opens it.Or with Homebrew: brew install --cask dspv/tap/caprock-app

Or run it yourself:

irm https://caprock.dev/win.ps1 | iex

Paste in PowerShell: it installs Caprock for you and opens it.

Or run it yourself:

curl -fsSL https://caprock.dev/linux.sh | sh

Paste in a terminal: it installs Caprock for you, no sudo. Or download the AppImage