Skip to content

thisidnotfound/run-loop-skill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

run-loop — Claude Code Skill

A Claude Code skill that closes the write→observe→fix loop. After writing or editing code, Claude automatically runs it, reads the full output, diagnoses failures, fixes them, and re-runs — without waiting for you to copy-paste errors back.

The Problem It Solves

Without this skill, the cycle looks like:

Claude writes code → you run it → it breaks → you paste the error back → Claude fixes it → repeat

That's slow, manual, and puts the burden of error relay on you. With run-loop:

Claude writes code → runs it → observes the error → diagnoses root cause → fixes it → re-runs → delivers working code

Claude becomes accountable to what the code actually does at runtime, not just what it looks like on paper.

What It Does

  1. Auto-detects the runtime — Node, Python, Go, Rust, Java, TypeScript, Make, and more
  2. Runs and captures everything — stdout, stderr, exit code, timing
  3. Classifies the failure — build error, runtime crash, test failure, missing dependency, environment issue, timeout
  4. Diagnoses root cause — traces errors back to their origin, reads relevant source files before touching anything
  5. Applies a targeted fix — minimum change needed, no opportunistic refactoring
  6. Re-runs and verifies — confirms the fix actually worked
  7. Repeats up to 5 iterations — then surfaces whatever remains with a clear diagnosis

Installation

mkdir -p ~/.claude/skills/run-loop
cp SKILL.md ~/.claude/skills/run-loop/SKILL.md

Or clone directly:

git clone https://github.com/thisidnotfound/run-loop-skill ~/.claude/skills/run-loop

Usage

Automatic

Triggers automatically after Claude writes or modifies code.

Manual

/run-loop
/run-loop npm test
/run-loop pytest tests/
/run-loop go test ./...

Supported Runtimes

Runtime Auto-detected via Default command
Node.js package.json npm test
Python requirements.txt, pyproject.toml pytest
Go go.mod go test ./...
Rust Cargo.toml cargo test
Java pom.xml, build.gradle mvn test / ./gradlew test
TypeScript *.test.ts, tsconfig.json npx tsc --noEmit + test runner
Any Makefile make test

Error Classification

Class Meaning Example
BUILD_ERROR Compile/type error before execution TypeScript type mismatch
RUNTIME_ERROR Crash during execution Unhandled exception, bad import
TEST_FAILURE Tests ran but assertions failed Wrong return value
MISSING_DEPENDENCY Module not found npm install needed
ENVIRONMENT_ERROR Missing env vars, config, permissions .env not set
TIMEOUT Did not complete in 30s Infinite loop, deadlock

Output Example

[Run 1] EXIT:1 — BUILD_ERROR
  → Error: Cannot find module './utils' at src/index.ts:3
  → Fix: Created missing utils.ts with expected exports

[Run 2] EXIT:1 — TEST_FAILURE
  → 2 tests failed: expected 42, got undefined
  → Fix: calculateTotal() was not returning the value

[Run 3] EXIT:0 — PASS ✓
  → All 14 tests passed in 1.2s

Why This Matters

Most AI coding tools generate code and stop there. run-loop makes Claude responsible for the output — not just the syntax. Combined with the browser-api skill (which grounds API knowledge before writing), this covers both ends: accurate knowledge going in, verified behavior coming out.

Requirements

License

MIT

About

Claude Code skill that closes the write→observe→fix loop — runs code, reads errors, self-corrects, and re-runs until it passes

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors