loop

A setup pack for autonomous coding loops, where an agent keeps working until it chooses to stop.

In plain words
What is it for?
Use it to register a stop gate, rerun the guardrail after each loop, and choose a security-only or full-debt preset.
Why use it?
It checks for newly introduced findings whenever the agent tries to stop and sends them back for repair, reducing the chance of declaring unfinished work complete.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/vyuh-labs/dxkit/loop
Clone the repo
git clone --depth 1 https://github.com/vyuh-labs/dxkit
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,917 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01917
Opus 5 $0.00000 $0.00958
Sonnet 5 $0.00000 $0.00383
Haiku 4.5 $0.00000 $0.00192

Measured yesterday against content hash 920bd29f59b7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

loop scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/commands/loop.md · 176 lines

How it starts

The opening of the file, as written. The whole thing — 176 lines — stays where its author put it; the contents beside it link to each section on GitHub.

vyuh-dxkit loop + vyuh-dxkit hook stop-gate

Run as: vyuh-dxkit <cmd> after npm install -g @vyuhlabs/dxkit, or npx @vyuhlabs/dxkit <cmd> for one-shot use.

The loop pack is dxkit's deterministic preflight/postflight layer for autonomous coding loops — a Claude Code session that keeps working until it decides to stop. It stops a loop from declaring "done" while it has introduced net-new findings, by re-running the guardrail on every Stop and feeding any net-new findings back to the model for repair.

The value is predictability, not new detection: the gate bounds the "loop shipped debt and never fixed it" failure mode to zero using the findings, baseline, and identity contract dxkit already computes. It is not a new scanner.

Setup

# Register the Stop hook + CLAUDE.md loop norm + default preset.
# Additive: merges into an existing .claude/settings.json + CLAUDE.md
# without clobbering your hooks or prose. Implies the dxkit skills.
vyuh-dxkit init --claude-loop [--loop-preset security-only|full-debt]

This is opt-in even under init --full, because it registers a hook that blocks the agent from stopping. See init.

vyuh-dxkit hook stop-gate

The body of the Claude Code Stop hook. Not run by hand — init --claude-loop registers it in .claude/settings.json:

{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "cd \"${CLAUDE_PROJECT_DIR:-.}\" && npx vyuh-dxkit hook stop-gate"
          }
        ]
      }
    ]
  }
}

It reads the hook payload from stdin, runs the guardrail against the baseline, and decides:

Outcome Condition Mechanism
Allow stop No net-new findings (and the optional test command passed) exit 0, no decision
Block → model Net-new findings the model can fix exit 0 + {"decision":"block","reason":"…"} on stdout — the reason reaches the model so it repairs, then tries to stop again
Block → operator Guardrail couldn't run (no baseline / config error) exit 2 + stderr to the operator (the model can't fix a preflight problem); allows on the next attempt to avoid thrashing

Read the full file on GitHub · 176 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 176 lines · 0 tokens per session scan A 920bd29f59b7

Subscribe to this mod's changes

loop is a command published in the GitHub repository vyuh-labs/dxkit (10 stars, last pushed 4d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,917 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.