feature-loop
A spec-first feature loop for Claude Code. It makes
the agent research before it designs, design before it builds, ask you for
approval exactly once, and then hand its work to an independent checker that
judges with cited evidence instead of grading itself.
/feature <request>
R Research (EVIDENCE-GATED) -> O Options -> S Spec dashboard [only human gate]
-> I Implement -> V Verify (independent checker) (loop, max 3)
-> Exit: verified-success | failure | budget-spent | no-progress
Why
Two failure modes dominate agentic feature work:
- Minimal-interpretation builds — the agent skims, picks the first design,
and ships the smallest thing that superficially matches the request.
- Self-graded "done" — the agent that wrote the code declares it works.
feature-loop attacks both. Research is gated by a runtime hook: source edits
are literally denied until a research ledger proves every declared search
modality ran its minimum waves and enough facts carry source URLs. Elapsed
time never opens the gate — evidence does. Verification is done by a
fresh-context checker subagent that never sees the build conversation and must
cite a command, result, or screenshot for every verdict.
What ships
| Piece | Path | Job |
|---|
| Skill | skills/feature/SKILL.md | the loop itself (/feature <request>, /feature resume <slug>) |
| Research-gate hook | hooks/feature-clock-gate.sh | PreToolUse hook denying source edits until the ledger proves the research |
| Checker rubric | skills/feature/references/verify-rubric.md | 10 evidence-gated boxes + anti-cheat rules for the independent checker |
| Deliverable lint | skills/feature/scripts/spec-lint.sh | rejects specs/reports containing authoring traces (self-corrections, placeholders, trailing ellipses) |
| Deterministic gates | skills/feature/scripts/verify.sh | analyze/test adapters (Flutter, npm) run before any model judges anything |
| Hook tests | skills/feature/scripts/test-gate.sh | throwaway-repo test suite for the gate hook |
| Loop hub | skills/feature/scripts/hub.sh + hooks/loop-hub-record.sh | cross-repo JSON index of every loop: stage, progress, session ids, resume commands |
| Installer | install.sh | global install: skill + hooks + ~/.claude/settings.json wiring + hub backfill |
Install
Option 1 — plugin (two commands)
/plugin marketplace add tumblecat44/feature-loop
/plugin install feature-loop@feature-loop
Note: claude plugin install clones over SSH
(anthropics/claude-code#47088).
If you have no SSH key on GitHub, use Option 2.
Known platform caveat: plugin-declared PreToolUse command hooks have been
reported silently dropped on some Claude Code versions
(anthropics/claude-code#34573).
The skill degrades gracefully — when no hook fires it instructs the model to
run the same three ledger checks itself before the first source edit — but for
hard enforcement, also run the installer's settings wiring (Option 2).
Option 2 — installer script (recommended for hard enforcement)
git clone https://github.com/tumblecat44/feature-loop.git
cd feature-loop
./install.sh
This copies the skill to ~/.claude/skills/feature, the hook to
~/.claude/hooks/feature-clock-gate.sh, and merges a PreToolUse entry into
~/.claude/settings.json (atomically, via jq; every failure path changes
nothing). Rerunning is idempotent. ./install.sh --uninstall removes exactly
what it installed and leaves your other hooks untouched.
Use
/feature add CSV export to the reports screen
/feature resume csv-export
The loop keeps its state on disk in the target repo under
.feature-loop/<slug>/ (contract, research ledger, approved spec, state), so
a dead session resumes where it stopped.
Loop hub
Loops live in many repos; the hub is the one place that sees them all. A
PostToolUse hook (hooks/loop-hub-record.sh) notices every write to a loop's
state.md/clock.json and upserts the loop — stage, verify count, next
action, and the session id that touched it — into
${XDG_STATE_HOME:-$HOME/.local/state}/feature-loop/hub.json. No model
discipline involved: recording is a side effect of the state-file writes the
loop already makes.
/feature hub # inside Claude Code: renders the hub
hub.sh list # ACTIVE and DONE loops across all repos
hub.sh show <slug> # full entry + ready-to-run resume commands
hub.sh show <repo>:<slug> # when the same slug exists in two repos
hub.sh record <state-dir> # manual add (deep repos the backfill missed)
hub.sh prune # drop entries whose state dir is gone