loop-guard
by The Agency · ★ 10 · updated 21 days ago
Stall detector per agent loop: 5 identical tool calls in a row warn that loop and leave the session-state.json stall marker for the next SessionStart
Install
git clone https://github.com/Tekkiiiii/the-agencyclaude --plugin-dir ./the-agency/mods/loop-guardThen run /reload-plugins or start a new session. Requires Claude Code 2.1.287+.
What it hooks into
From an automated scan with claude plugin validate, not a security review. Mods run with your permissions; read the code before installing.
- Events
tool.call- API calls
$.clock.now$.env.get$.fs.read$.fs.write$.state.get$.state.set- Can see
every tool call- Reach
- level 2 of 3 writes filesreads filesreads env varsreads mod state
Origin
- How it got here
- Automated scan of public GitHub repos, via the CC0 dataset awesome-claude-code-mods (scan of ).
- Repository
- github.com/Tekkiiiii/the-agency
- Path in repo
mods/loop-guard- Source commit
36b8ed3the exact code the scan read- Author
- The Agency @Tekkiiiii
- License
- MIT
- First published
- Last pushed
- First listed here
Name and description come from the mod's own manifest. We link to the code; we don't host it, and it stays under its author's license.
More from Tekkiiiii/the-agency
spawn-ledger
Tekkiiiii/the-agency
Spawn log (spawn_start/launched/end + cost, native agentId lineage), artifact check and in-session RESPAWN_REQUEST pickup for every subagent, background included
voice-compact
Tekkiiiii/the-agency
Startup token diet: rewrites the long CAVEMAN / PONYTAIL MODE ACTIVE hook-context injections into ~150-token compact rules (level kept, pointer to /caveman or /ponytail)
agent-ctx
Tekkiiiii/the-agency
Each agent loop's own context fill, measured per request; a one-line CONTEXT_PCT_ALERT rides that agent's next tool result. Subagents: absolute 200k warn / 250k finish / 300k stop (stop line on every result); main: 70/75/80% of its window. Controllers get CHILD_CTX on Agent and SendMessage results and CHILD_CTX_ALERT when a live child passes 250k/300k
context-band
Tekkiiiii/the-agency
Band above the prompt: context %, tokens, model, cost, prompt-cache size/share/TTL countdown, 5h and weekly usage-window reset timers and next-request estimate; /ctx opens a detail pane; toast when a background subagent finishes; Jev router line (today's calls, tokens, USD, Haiku fallback) and outage warning, hidden unless the router usage log exists
Related mods
Other mods in Guards, close to this one by stars.