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.
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.
- Auto-detects the runtime — Node, Python, Go, Rust, Java, TypeScript, Make, and more
- Runs and captures everything — stdout, stderr, exit code, timing
- Classifies the failure — build error, runtime crash, test failure, missing dependency, environment issue, timeout
- Diagnoses root cause — traces errors back to their origin, reads relevant source files before touching anything
- Applies a targeted fix — minimum change needed, no opportunistic refactoring
- Re-runs and verifies — confirms the fix actually worked
- Repeats up to 5 iterations — then surfaces whatever remains with a clear diagnosis
mkdir -p ~/.claude/skills/run-loop
cp SKILL.md ~/.claude/skills/run-loop/SKILL.mdOr clone directly:
git clone https://github.com/thisidnotfound/run-loop-skill ~/.claude/skills/run-loopTriggers automatically after Claude writes or modifies code.
/run-loop
/run-loop npm test
/run-loop pytest tests/
/run-loop go test ./...
| 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 |
| 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 |
[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
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.
- Claude Code CLI
MIT