Skip to main content

An autonomous engineering runtime that only ships changes it can prove.

Project description

loopd

PyPI CI Python License: MIT

An autonomous engineering runtime that only ships changes it can prove. A persistent planner directs disposable developer sessions, and every step is verified by deterministic checks outside the model before it is committed.

Built on Claude Code's headless mode.

loopd

Why loopd?

Coding agents are good at writing code and bad at knowing when they are done. Left unattended, one will declare success on work that doesn't build, quietly weaken a test to make it pass, or drift off the task. So you supervise it: read the plan, hand it steps, run the tests yourself, review each diff, and decide what is actually finished.

loopd automates that supervision — without trusting the model to grade its own work.

  • A planner breaks the task into small steps and reviews every result.
  • A developer implements one step at a time.
  • A verification layer — ordinary shell commands, run by the orchestrator, not the agent — decides whether a step actually passed.

A model can propose that something is done. It cannot declare it done. When the step's checks are red, "accept" isn't even an option the planner is allowed to choose. The payoff is an agent you can start and walk away from: it runs to completion, commits one reviewable change per step, and stops with a clear report if it can't succeed — instead of confidently handing back broken work.

Architecture

  • Persistent planner. One long-lived session that plans, writes every developer prompt, reviews every result, and decides what happens next.
  • Disposable developer sessions. Each step is implemented by a fresh session whose only authority is to change code.
  • Deterministic verification. A step's checks are plain commands run by the orchestrator. Exit 0, or it didn't happen.
  • The orchestrator holds the rules. Budgets, retries, commits, and the "is it done?" decision live in code, never in a prompt.

For the full picture — directives, handover packets, and guarantees — see docs/architecture.md.

The loop, as a text diagram
your interactive Claude Code session
        │  /handoff  (or --seed-session <id> fork)
        ▼
.agentic/brief.md
        │
        ▼
Execution Forecast  →  cost/runtime/steps estimate  →  raise budget · run constrained · abort
        │
        ▼
┌─ Planner · persistent session · resumed every turn ────────────────────────┐
│  plan → author dev prompt → review handover → directive:                   │
│  accept | reject+feedback | replan | descope | task_complete | abort       │
└──────┬───────────────────────────────────────────────▲─────────────────────┘
       │ next_prompt (verbatim)                        │ handover packet:
       ▼                                               │  dev summary
┌─ Developer · disposable session · sandboxed ──────┐  │  + real git diff
│  implement → inner retry loop vs gates (no        │──┘  + gate transcript
│  planner turn until green or attempts exhausted)  │     + integrity flags
└───────────────────────────────────────────────────┘
       Orchestrator (Python) holds the rules: gates run HERE · accept needs green gates
       + a real diff + evidence · task_complete ⇒ final verify + regression sweep in a
       PRISTINE checkout · budget / attempt / replan caps · resumable state

Design philosophy

  • Models propose; the harness disposes. No agent can mark its own work complete.
  • Verification is deterministic and external. Pass/fail is decided by commands with exit codes, not by a model's opinion.
  • "Done" means reproducibly verified. A task is complete only after its final checks — and every accepted step's checks — pass in a clean, from-scratch checkout.
  • Every step is a reviewable commit. The git log is the audit trail; each accepted step is one commit on an isolated run branch.
  • Bounded autonomy. Budget, attempt, and replan caps mean failures re-plan or stop with a report — they don't hang or burn money silently.
  • Resumable. State is durable; a crash or a budget stop continues with one flag.

Key features

  • Deterministic verification. Gates the model can't bypass, plus built-in probes for real-world checks (HTTP, TCP ports, docker build, env files, "does the server boot?").
  • Execution Forecast. Before it builds, loopd predicts cost, runtime, steps, and risk, then asks the one decision that matters — the budget. It grades itself against actuals and gets truer over time. Read more →
  • Failure Analysis. When loopd genuinely can't finish, it explains the blocker like a senior engineer (what happened · why · what it'd do · other options) and resumes from your one-click choice.
  • Engineering memory. A structured .agentic/memory.md (decisions, past failures, TODOs) the planner reads every run and updates automatically.
  • GitHub, if you want it. Build straight from an issue (loopd #142) and open a PR with a written handover (loopd pr) — via your own gh login, never your tokens. Entirely optional.
  • Reviewable by construction. One git commit per accepted step on a throwaway branch; your default branch is never touched.
  • Bounded and resumable. Per-run USD budget enforced mid-run; any stop resumes with one command.
  • Zero dependencies. Standard library only — pip install loopd and go.

Quick start

Requirements: Python 3.10+, git, and the Claude Code CLI (npm install -g @anthropic-ai/claude-code).

pip install loopd
claude login                # loopd reuses your Claude Code login — no API keys, ever

cd your-project             # the current directory is your project
loopd "Add a /health endpoint that returns {\"status\":\"ok\"} plus a passing test"

The first loopd walks you through a quick one-time setup, then gets out of your way. There's nothing to configure — see INSTALL.md for the full guide.

The current directory is the project — you never paste a path. loopd forecasts the work, takes one decision (the budget), builds it, verifies it in a clean checkout, and hands you a committed change. Your token is read from .env automatically — no export needed.

Basic usage

loopd                       # the workspace home: status, history, "what do you want to build?"
loopd "add rate limiting"   # build something
loopd spec.md               # build from a markdown spec
loopd resume                # continue a paused run (e.g. after a budget stop)
loopd status                # how the last run went
loopd ui                    # open the live dashboard in a browser

Every command lives in the CLI reference. Ctrl-C is always safe — nothing is lost, and loopd resume picks up exactly where it stopped.

Continuing work you've already scoped. If you explored the task in an interactive Claude Code session, hand that context over instead of retyping it. Install the /handoff command (cp commands/handoff.md <repo>/.claude/commands/), run /handoff in that session to write .agentic/brief.md, review it, then launch from that repo:

cd ../my-app && loopd --brief .agentic/brief.md --budget 25

For real work, run inside the container so the developer's file access is confined to it (see docs/security.md):

docker build -t loopd .
docker run --rm --env-file .env -v "$(pwd)/../my-app:/work" loopd --budget 25

Prefer a browser? loopd ui opens a local dashboard to launch and watch runs live (see docs/usage.md).

How a run works

  1. Plan. The planner reads the repo and produces an ordered set of steps, each with acceptance criteria and verify commands (real checks — tests, builds, linters, probes).
  2. Dispatch. The planner writes the developer's instructions for the next step.
  3. Implement + verify. The developer makes the change; the orchestrator runs the step's verify commands. Red gates send the developer back with the transcript — up to a retry cap — without spending a planner turn.
  4. Review. The planner sees a handover packet (the developer's summary, the real git diff, the gate transcript) and decides: accept (commit and continue), reject (send feedback), replan, descope, or abort. Accept is only offered when the gates are green.
  5. Finalize. When no steps remain, the task's final checks and every accepted step's checks are replayed in a pristine checkout. Only then is the run complete.

Every run writes a human-readable .agentic/report.md (outcome, per-step status, cost, time, commits) on completion or failure. That plus plan state, the event log, and the handover packets all live under <repo>/.agentic/, and work is committed step-by-step on an isolated agentic/run-<timestamp> branch.

Exit codes: 0 verified done · 1 stopped with a report · 2 setup/plan problem · 3 budget exceeded (resumable). A stopped run always leaves .agentic/escalation.json.

Configuration

loopd needs no configuration to start — auth comes from your Claude Code login. .env (optional) only overrides defaults. Common knobs (all optional, via .env or environment):

Variable Default Meaning
PM_MODEL, DEV_MODEL claude-opus-4-8 models for the planner and developer
BUDGET_USD 25 per-run spend cap (also --budget)
MAX_ATTEMPTS_PER_STEP 3 developer↔gate retries per step
MAX_REPLANS 3 plan revisions before the run stops

The full list of variables, CLI flags, and seeding options is in docs/configuration.md.

Documentation

Start here:

Going deeper:

Project:

Contributing

Issues and pull requests are welcome. loopd stays stdlib-only and keeps the engine agnostic; see CONTRIBUTING.md for the setup, the tests, and the invariants a PR must hold. Please also read the Code of Conduct.

License

MIT © Ruchir Kulkarni

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

loopd-0.1.1.tar.gz (203.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

loopd-0.1.1-py3-none-any.whl (179.8 kB view details)

Uploaded Python 3

File details

Details for the file loopd-0.1.1.tar.gz.

File metadata

  • Download URL: loopd-0.1.1.tar.gz
  • Upload date:
  • Size: 203.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for loopd-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b87ed3c47451ebee9ca4948bc4dce04c0af4b8b76677614b396639e398f15b68
MD5 80b3971ea5f1d3d38e2c34c0b69f1de6
BLAKE2b-256 1d42339a09dfd0188c8db895c883c8263c4853326ffd17264703adfbf06443b5

See more details on using hashes here.

File details

Details for the file loopd-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: loopd-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 179.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for loopd-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 af8f35022f3d44ce7ba9d76c3df7346259b78ce296ab0eb7d8fdb01dbb9b699e
MD5 41fc5b14268d93eb3ca8c747f5ec4554
BLAKE2b-256 1fafdc8c8f25af429136238c663034356dce7be95873791f1094d476f6bd31a4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page