improve-loop — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited improve-loop (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Every experiment runs in an isolated git worktree. The main codebase is never modified during experiments. Only winning changes get squash-merged back.
Main branch ──────────────────────────────────── (never touched mid-session)
│ │
experiment-001 experiment-002
(kept ✅ → merge) (discarded ❌ → deleted)Before the first iteration, print each check as you run it:
━━━ Pre-flight ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✓ Config found
✓ Git working tree clean
✓ Base commit: abc1234
✓ Worktree directory ready
✓ Baseline score: XX/100
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.claude/autoimprove/config.md exists. If not, stop: "Run /autoimprove:setup first."git statusgit rev-parse HEAD — all experiments branch from here..claude/autoimprove/worktrees/ and update .gitignore.After pre-flight passes, write a session header to .claude/autoimprove/log.md:
## Session — [ISO 8601 timestamp]
**Planned:** N iterations
**Focus:** "focus string" (or "all improvement areas" if none)
**Baseline:** XX/100
**Base commit:** [full SHA]
**Status:** IN_PROGRESS (0/N completed)If the log file doesn't exist, create it with the project header first:
# .claude/autoimprove/log.md
> Generated by [autoimprove](https://github.com/benmarte/autoimprove) — Claude Code Plugin
> Project: **[project name]** · Stack: [detected stack] · Started: [date]
---Then append the session header.
When invoked with continue-mode parameters (from the /autoimprove:continue command), the loop behavior changes:
continue, skip creating a new session header; instead update the existing one:**Planned:** to the new total if it changed**Status:** to IN_PROGRESSIn continue mode, the pre-flight still runs (clean tree, config check, worktree setup) but skips creating a new session header and optionally skips baseline measurement.
CRITICAL: At the start of every step, you MUST output a visible progress line to the user. Do not silently run tools — always print status first. Use this format:
━━━ Iteration N/TOTAL ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔬 STEP_NAME: brief description of what's happeningExample progress lines:
━━━ Iteration 1/5 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔬 PROPOSE: Targeting error handling in src/api/client.ts
🔬 SNAPSHOT: Measuring BEFORE score...
🔬 IMPLEMENT: Adding try/catch to unhandled async calls
🔬 MEASURE: Measuring AFTER score...
🔬 DECIDE: 85 → 89 (+4 pts) — KEPT ✅
🔬 LOG: Recorded to .claude/autoimprove/log.mdNever run more than one step without printing a progress line. The user must always know what iteration you're on and what phase you're in.
Use the worktree skill to create a new isolated branch and directory:
EXPERIMENT_ID=$(printf "%03d" $N)
git worktree add -b "autoimprove/experiment-$EXPERIMENT_ID" \
".claude/autoimprove/worktrees/experiment-$EXPERIMENT_ID"All work for this iteration happens inside .claude/autoimprove/worktrees/experiment-$EXPERIMENT_ID/. The main directory is not touched.
If a FOCUS string was provided: Every iteration targets that specific focus. Break the focus into file-by-file or function-by-function sub-tasks and tackle one per iteration. Do not rotate to other areas — stay on the focus until all iterations are used or the focus is fully addressed.
If no FOCUS was provided: Choose one focused improvement from the Improvement Areas in .claude/autoimprove/config.md. Rotate areas — don't repeat an area that failed last time.
State the hypothesis explicitly:
"I will [specific change] in [file(s)] because I expect [metric] to improve by ~[X] points."
Measure from inside the worktree directory (same commands, different cwd):
cd .claude/autoimprove/worktrees/experiment-$EXPERIMENT_ID
# run measurement suite from .claude/autoimprove/config.mdRecord as BEFORE.
Make the change inside the worktree. The main directory is untouched. Commit the change to the experiment branch:
cd .claude/autoimprove/worktrees/experiment-$EXPERIMENT_ID
git add -A
git commit -m "experiment($EXPERIMENT_ID): $HYPOTHESIS_ONE_LINE"Run the full measurement suite again from inside the worktree. Record as AFTER.
If AFTER > BEFORE — KEEP ✅
Squash-merge the experiment back to main:
cd [main project root]
git merge --squash "autoimprove/experiment-$EXPERIMENT_ID"
git commit -m "autoimprove($EXPERIMENT_ID): $HYPOTHESIS_ONE_LINE
Score: $BEFORE → $AFTER (+$DELTA pts)
Files changed: $FILES"
# Clean up
git worktree remove ".claude/autoimprove/worktrees/experiment-$EXPERIMENT_ID"
git branch -D "autoimprove/experiment-$EXPERIMENT_ID"If AFTER == BEFORE — KEEP ✅ only for clear readability wins, DISCARD otherwise
Same merge process as above if keeping, discard process if not.
If AFTER < BEFORE — DISCARD ❌
Main branch is already untouched. Just delete the worktree:
git worktree remove ".claude/autoimprove/worktrees/experiment-$EXPERIMENT_ID" --force
git branch -D "autoimprove/experiment-$EXPERIMENT_ID"No rollback needed — there was nothing to roll back.
Append to .claude/autoimprove/log.md in the main directory:
## Iteration N — [timestamp]
**Hypothesis:** [what you tried and why]
**Branch:** autoimprove/experiment-NNN
**Files changed:** [list]
**Before:** [X/100] — type: X, build: X, tests: X, lint: X
**After:** [X/100] — type: X, build: X, tests: X, lint: X
**Decision:** KEPT ✅ (merged to main) / DISCARDED ❌ (worktree deleted)
**Reason:** [one sentence]After logging the iteration, update the session header's **Status:** line:
.claude/autoimprove/log.md**Status:** IN_PROGRESS**Status:** IN_PROGRESS (N/M completed) where N is the current iteration number and M is the total plannedIf the status line cannot be found, append a warning to the log and continue — the iteration records are the source of truth.
After all iterations (or if the user stops early):
Update the session header status to completed:
.claude/autoimprove/log.md**Status:** IN_PROGRESS line**Status:** COMPLETED (N/N)# Remove any remaining experiment worktrees
for wt in .claude/autoimprove/worktrees/experiment-*; do
git worktree remove "$wt" --force 2>/dev/null
done
git branch | grep "autoimprove/experiment" | xargs git branch -D 2>/dev/null
rm -rf .claude/autoimprove/worktreesPrint a final summary table:
━━━ Session Complete ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Score: BASELINE → FINAL (+/- DELTA)
🔁 Iterations: N total — X kept ✅, Y discarded ❌
📝 Merged commits:
• abc1234 autoimprove(001): description
• def5678 autoimprove(003): description
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━Rotate through these (add language-specific ones from .claude/autoimprove/config.md):
any/interface{}/untyped constructscatch {}, swallowed errors.env — in any worktree~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.