For Claude Code

Write the Spec. Go Make Tea. Come Back to Reviewed Commits.

specloop turns Claude Code into a spec-driven plan → implement → review loop. Claude cannot say “done” until your tests and linters pass and a reviewer approves the diff. You stop babysitting the chat.

Get it on GitHub → Install in 30 seconds

  • Uses your Claude subscription
  • No API keys
  • macOS · Linux · Windows
  • 0BSD licensed
> /sl-feature specs/password-reset.md
[specloop] spec loaded in feature mode. Run /sl-go.
> /sl-go
[specloop] branch specloop/password-reset created
[specloop] planning… 5 steps written to run/steps.json
> /sl-go   # plan looks good, approved

☕  you leave

  1  done     5d6e7f8  Add reset token model
  2  done     a41c09b  Send the reset email
  3  done     e02f7aa  Add the reset endpoint
     ↳ review: CHANGES_REQUESTED (token not single-use)
     ↳ implement → tests green → review: APPROVE
  4  done     9b3d112  Rate-limit reset requests
  5  done     c77e0f4  Document the flow

[specloop] done. 5 commits on specloop/password-reset

The Problem

Right Now, You Are the Loop

Coding agents are great at the first 80%. Then they stop, declare victory and wait for you. So you sit there, typing the same five messages, for an hour.

The agent is not the bottleneck. The person who has to keep saying “continue” is.

Claude: All done! The feature is implemented. ✅

You: did you run the tests?

Claude: You’re right, 3 tests fail. Fixing now.

Claude: Fixed! Everything should work.

You: it still fails. also you skipped step 4 of the spec

Claude: Apologies! Let me implement step 4…

You: continue

You: continue

How It Works

Every Phase Ends at a Gate. Claude Can’t Talk Its Way Past It.

Each time Claude tries to stop, specloop’s Stop hook runs the current phase’s check. Fail, and Claude gets the failure back and keeps working. Pass, and the next phase starts on its own.

  • 01 · plan

    Reads the spec and writes a plan. Can only edit the plan file, so no “let me just start coding”.

    Gate: The plan file exists

  • 02 · implement

    Implements test-first, free to edit the code.

    Gate: Your test command and quality gates pass

  • 03 · review

    A fresh reviewer reads the diff, read-only, and writes a verdict. Changes requested? Back to implement.

    Gate: VERDICT: APPROVE

Quality gates are your linter, type checker, tests or coverage report, each a named command. Every failing gate is reported in one message, with the end of its output.

Big spec? /sl-feature splits it into steps. Each step runs implement → review in fresh subagents and ends in its own commit on a dedicated branch. If a step shows the plan is wrong, the remaining steps get replanned.

Your Afternoon

Two Commands. Then It’s Tea Time.

You do the parts that need a human: deciding what to build and approving the plan. specloop does the grinding in between.

  • you Write specs/password-reset.md: goal, requirements, acceptance criteria.
  • you /sl-feature, /sl-go. A planner splits it into 5 steps. You skim, approve.
  • Step 1: implement, tests and linter go green, reviewer approves, committed.
  • Step 3: the reviewer catches a token that can be reused. Back to implement. Fixed, approved, committed.
  • Last step committed. The run is done.
  • you You’re back with your tea. One branch, five reviewed commits. You open the PR.

The Input

A Spec Is Just Markdown

No DSL, no YAML, no ticket system. Say what you want and how you’ll know it’s done. The clearer the acceptance criteria, the less there is to argue about at review.

Tip: let Claude help you write the spec in a normal chat first. Then hand it to the loop.

# Password reset

## Goal
Users who forgot their password can set a
new one through a link sent by email.

## Requirements
1. POST /auth/reset sends a link with a
   single-use token, valid for 30 minutes.
2. At most 3 requests per email per hour.
3. Using the link sets the new password and
   invalidates every other session.

## Acceptance
- A used or expired token returns 410.
- Tests cover the rate limit.
- docs/auth.md describes the flow.

Why You Can Walk Away

Guard Rails, so “Unattended” Doesn’t Mean “Unsupervised”

  • Hard gates

    Phases complete on exit codes and verdicts, not on Claude’s opinion of its own work.

  • Independent review

    Review runs in a fresh subagent (specloop-reviewer, installed with the kit) that never saw the implementation chat. It reads the diff, not the excuses.

  • Quality gates

    Your linter, type checker, tests and coverage as named gates, with optional thresholds such as “coverage ≥ 80”. /sl-quality init sets them up from presets for Kotlin, Java, Python, Node, Go and Rust.

  • No gaming the gates

    Tool configs are fingerprinted, and new # noqa or @Suppress lines fail the gate. Only you can accept an exception, with /sl-quality accept.

  • Legacy code welcome

    A ratchet gate passes when a number is no worse than before the run. Old warnings don’t block new work.

  • Never pushes

    git push and PR creation are blocked until the work is done. Opening the PR stays your call.

  • Right model per phase

    Named tiers (light, standard, heavy) pick the model and effort of each delegated phase, with a strong reviewer. A run that stalls or keeps getting rejected moves up to the next tier by itself.

  • One commit per step

    Feature mode leaves a clean branch: one reviewed, tested commit per planned step. Easy to read, easy to revert.

  • Can’t run away

    After 15 blocked stops the run stalls and waits for you. A crash in specloop never breaks your session.

  • Tiny, portable, no extra bill

    Hooks and slash commands in your normal Claude Code session: your subscription, no API keys, no external orchestrator. Pure Python standard library, 3.8+, on macOS, Linux and Windows.

Dogfooding

Specloop Is Built by Specloop

Since feature mode landed, new specloop features are written as specs and run through specloop itself. The copy installed in the repository plans, implements, reviews and commits the next version of the kit, held by its own quality gates: ruff, mypy, a rules checker and the test suite.

  • 23steps planned for one spec: quality gates, built in 4 days
  • 9times the reviewer sent a step of that run back to implement
  • 12 → 14steps: the update checker’s run replanned itself midway
  • 950+unit tests guarding the engine and the installer

The real git log of the update checker, built from specs/update-checker.md:

$ git log --format='%h %s%n    %b'
888ab25 docs: Document updates and config.local.json, release 0.3.0
    specloop step 14/14 (12) of specs/update-checker.md
8eec7a1 feat: Show the update state in /status
    specloop step 13/14 (11) of specs/update-checker.md
ba59562 feat: Apply updates automatically in auto mode at safe points
    specloop step 12/14 (10) of specs/update-checker.md
…
c3d0432 fix: Enforce subprocess timeouts with run_limited
    specloop step 8/14 (14) of specs/update-checker.md
906f9e7 fix: Keep update.json keys and harden the update files
    specloop step 7/14 (13) of specs/update-checker.md
894d8d8 feat: Check for updates and show a notice at SessionStart
    specloop step 6/12 (6) of specs/update-checker.md
…
fae29b7 feat: Add config.local.json as a personal configuration layer
    specloop step 1/12 (1) of specs/update-checker.md

Notice the count jump from 6/12 to 7/14: the reviewer found problems the plan didn’t cover, so the run added hardening steps on its own and kept going.

And this website, too. The page you’re reading was written as a spec and implemented by specloop. If it has a bug, the reviewer missed it, and we’d love a PR.

Quick Start

Install Into Any Project

You need Claude Code, Python 3.8+, git and sh (Git Bash on Windows). The installer copies the kit into your project’s .claude/ directory, detects your test command and never touches your own settings.

Then start a new Claude Code session in the project. Updates are one command: /sl-update.

# once
git clone https://github.com/ba3a/specloop.git ~/tools/specloop
~/tools/specloop/install.sh ~/code/my-project
# Windows: install.cmd C:\code\my-project

# in Claude Code, optional: add linters as gates
/sl-quality init

# one reviewable diff
/sl-spec specs/login.md
/sl-go

# or a big feature, one commit per step
/sl-feature specs/password-reset.md
/sl-go        # plan
/sl-go        # approve, then go make tea

FAQ

Questions People Ask

Does It Cost Extra?

No. specloop is hooks and slash commands running inside your normal Claude Code session, so it uses your existing subscription. There is no separate service and no API key.

Will It Push to My Repo or Open PRs?

Never. Pushing and PR commands are blocked while a run is active, and specloop itself never pushes. You review the branch and open the PR yourself.

What If It Gets Stuck in a Loop?

After 15 blocked stops (configurable) the run goes to stalled and Claude is allowed to stop. /sl-go resumes, /sl-pause lets you talk to Claude in between, and /sl-advance force-passes a phase.

Can I Change the Phases?

Yes. The phases are a configurable graph. Add or drop a phase, attach quality gates to any phase that may edit code, or write your own phase instructions in overrides/. Your config is never overwritten on update.

Does It Work with My Stack?

If your tests run from a shell command, yes. specloop doesn’t care about the language: a gate is an exit code, optionally with a number read from the output. The installer detects Gradle, Maven, npm, pytest, Go, Cargo and .NET tests, and /sl-quality init ships presets for Kotlin, Java, Python, Node, Go and Rust.

Can’t Claude Just Loosen the Linter Config?

No. The files a gate depends on, and the gate definitions themselves, are fingerprinted when the run starts. A change fails the gate, even one made through the shell. New lines that match a forbidden pattern, such as # noqa, fail it too. Only you can allow an exception, with /sl-quality accept, and the reviewer sees what you allowed.

My Project Already Has Lint Warnings. Will Every Run Fail?

No. Use the tool’s own baseline, check only the files the run changed with {changed_files}, or set a gate to ratchet: it then passes when the number is no worse than before the run.

Windows?

Yes. Hooks run through Git Bash, and there is an install.cmd wrapper.

Stop Typing “Continue”

Write the spec. Run two commands. Put the kettle on.

★ Star specloop on GitHub Read the docs

specloop · 0BSD · do anything with it. Not affiliated with Anthropic. Claude Code is a product of Anthropic.

Project details

Documentation
Read the documentation
License
0BSD

Latest posts

  • Some statistics first

    Before the deep dive into how I build with AI, the raw numbers behind Coffer's first release: 6,613 API calls, 164 subagents, a billion cached tokens and ~80k lines of code.

  • Finally built me a site

All projects