testloop

testloop is a command for Claude Code from samibs/skillfoundry. It costs 0 tokens per session (3,304 once invoked), scanned A, original, MIT.

An automated test loop that runs tests, reads the failures, sends targeted fixes back to the implementation process, and repeats until the tests pass or the limit is reached.

In plain words
What is it for?
Use it for unit, integration, or end-to-end tests, all test layers, a specific test file, or tests linked to a user story.
Why use it?
It replaces guesswork about whether code works with repeated checks based on actual test results.

Command for Claude Code

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/samibs/skillfoundry/testloop
Clone the repo
git clone --depth 1 https://github.com/samibs/skillfoundry

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for testloop

README.md
[![agentmods](https://agentmods.dev/badge/commands/samibs/skillfoundry/testloop.svg)](https://agentmods.dev/commands/samibs/skillfoundry/testloop)
Your own site
<a href="https://agentmods.dev/commands/samibs/skillfoundry/testloop"><img src="https://agentmods.dev/badge/commands/samibs/skillfoundry/testloop.svg" alt="Measured on agentmods" height="20"></a>
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 3,304 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.03304
Opus 5 $0.00000 $0.01652
Sonnet 5 $0.00000 $0.00661
Haiku 4.5 $0.00000 $0.00330

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

Security

Grade A, and why

testloop 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.

.claude/commands/testloop.md · 389 lines

How it starts

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

TestLoop — Closed-Loop Implementation Validator

Role: Autonomous quality enforcement engine. You run tests, parse results, route failures to the coder for targeted fixes, and loop until the implementation is clean or the iteration budget is exhausted. You never accept "it should work" — only green tests.

Persona: See agents/testloop.md for full persona definition.

Activation Syntax

/testloop                          Auto-detect scope and run all tests
/testloop unit                     Unit tests only
/testloop e2e                      Playwright E2E tests only
/testloop all                      All layers: unit + integration + E2E
/testloop --max 3                  Override max iterations (default: 5)
/testloop --file path/to/test.ts   Run a specific test file only
/testloop --story STORY-001        Run tests tagged to a story
/testloop --exec-mode advisory     Force advisory mode (planning, no shell)

Hard Rules

  • NEVER skip oscillation detection — same failure 3× = architectural problem, not a patch problem
  • NEVER mark the loop complete unless ALL tests pass and coverage meets threshold
  • NEVER guess at what a failure means — parse the actual error message, line number, and stack trace
  • ALWAYS prefer Playwright for UI/browser scenarios; fall back to Jest/Vitest/pytest/xUnit for unit
  • ALWAYS feed the actual failure text (not a summary) to the coder — context precision = faster fixes
  • STOP and escalate after max iterations with a full iteration log — never silently give up

Phase 0: Pre-Flight

Before running any test:

  1. Execution context check (per agents/_execution-context.md): Read .claude/local/execution-context.json if it exists. If not, run detection now.

    • REAL → proceed normally
    • ADVISORY → run in advisory mode (static analysis only — no test claims)
    • DEGRADED → attempt one dependency fix then re-probe; if still degraded → advisory for this run

    Display mode prominently at the start of every run:

    EXECUTION MODE: REAL | ADVISORY | DEGRADED
    

Read the full file on GitHub · 389 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 · 389 lines · 0 tokens per session scan A 0cee3cfac17a

Subscribe to this mod's changes

testloop is a command published in the GitHub repository samibs/skillfoundry (12 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,304 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-09-03.