Skip to content

The loop does the work. You work the gates.

A small stack of tools for building, marketing, and following through on your own projects with an AI agent. One Foundation layer, three kits that sit on top of it. All of it runs inside Claude Code, and all of it is free and open source.

Loop & Gate is the name for a specific way of working with an AI agent: the loop runs on its own, and it stops at a fixed set of gates where a human has to decide. It's the opinionated instance of what the field now calls loop engineering and human-in-the-loop control.

Start with the Foundation

MIT licensed. Needs a paid Claude plan (Pro or Max).

the mental model

Most people meet an AI agent as a blank chat box. It is brilliant and it forgets you the moment the window closes. It will build whatever you ask, including the wrong thing, confidently. And it has no opinion about whether you actually shipped the work you meant to.

This stack fixes those three gaps. The Foundation gives the agent a memory and a sense of who you are that persists across every session. The Build Kit puts human decision points into an agentic build loop, so a fast agent ships good software instead of a fast mistake. The Grow Kit does the same for taking that software to market. The Accountability Kit points the same idea at you.

The kits share a single idea, which is where the name comes from. An agentic loop can run on its own most of the time. But it has to stop at a fixed set of gates where a human has to decide. The loop does the work between the gates. You work the gates. That is it.

the gate that earns its keep

Here is the whole idea in one moment. Mid-session the agent hits a test that fails once, digs in, and decides it has learned something worth keeping: the payments suite is flaky, so wrap the assertions in a retry before checking. A blank chat box forgets that by tomorrow. A naive memory writes it down forever.

# MEMORY.md
+ Payments tests are flaky. Wrap assertions in retry() before asserting.

That line would load into every future session. It is also wrong. The test failed once because a fixture had not finished seeding, not because the suite is flaky, and now the agent hides real failures behind a retry it never needed.

So the loop proposes the lesson and a gate stops the write. One observation is a coincidence with a good story, not a rule. The candidate waits in a holding file for a second, independent time the same thing happens. It never does, so nothing enters your memory. The diff above is the one that did not happen. That is loop and gate turned on the memory itself: the loop decides what to remember, the gate decides what is true enough to keep.

the pieces

The Foundation sits underneath all three kits. The kits work better when it is there, because they can read your voice and taste and write what they learn back into your memory. One of them needs it. The other two can start without it.

  1. 01

    The Foundation

    loop-and-gate-foundation

    An AI agent that remembers you and gets a little sharper every session. Its memory is plain, readable notes in an Obsidian vault, with no vector database, no cloud service, and nothing to sign up for. It captures what you tell it, files it, and writes down one lesson at the end of each session.

    Cross-session memory, so your projects and decisions survive the window closing. Your voice and taste profiles come from a short interview that turns "how you write" and "what good looks like to you" into notes the kits can read.

    Not a plugin. It is a folder you open and work inside. The skills live in the folder, and a memory-loader turns on automatically every time you open it.

    View on GitHub

  2. 02

    The Build Kit

    loop-and-gate-build-kit

    Turns "an AI agent that writes code" into "an AI agent that ships good software." It is a map of the eleven points in a build where a human has to decide, and how to work each one, even the ones whose expertise you do not have yet.

    Should this exist at all? Who is it for, and what is a win? Is the plan right? Is the architecture sane? Is the agent off the rails? Does the test prove it, or is it a demo? And above all of them, the master gate: how much of this process does this change even deserve, because a typo fix and a billing change do not get the same treatment.

    The gates sit on top of an actual build loop, so you also install two free public plugins that provide the loop itself (superpowers and agent-skills). Works with or without the Foundation, better with it.

    View on GitHub Read the field guide

  3. 03

    The Grow Kit

    loop-and-gate-grow-kit

    The other half of the loop: taking finished software to the right people and reading whether it worked. Same method, pointed at go-to-market.

    Who the audience is, what the one claim is, whether the design carries it without looking like slop, whether the copy is true and in your voice, the right channel and timing, and finally whether it actually moved anything.

    Requires the Foundation, because two of its gates are your Foundation profiles: the design gate reads your taste, the copy gate reads your voice. It also uses two free public plugins for the design and writing work.

    View on GitHub Read the field guide

  4. 04

    The Accountability Kit

    loop-and-gate-accountability-kit

    Points the loop at your own follow-through. A daily rhythm with eight gates: set the one thing that matters today, capture what you actually did, reckon honestly at night, and get caught when you keep quietly deferring the hard thing.

    The deferral engine is the part that makes it more than a journal. Every morning focus that does not show up in the day's log gets counted, and at three strikes it stops being polite and forces a decision: re-commit with a reason, or kill it.

    Nothing. It runs on Claude alone, with no extra plugins, no account, and no local model. It keeps plain-text state by default, and uses your Obsidian vault instead when one is present.

    View on GitHub Read the field guide

how they fit together

Build → Grow → Accountability → Build.

You build something with the Build Kit. You take it to market with the Grow Kit, whose final gate reads whether it actually landed and writes those customer signals back into the Foundation vault. The Build Kit's first gate reads those same signals to decide what is worth building next. And the Accountability Kit runs underneath the whole thing, so when a build stalls or a launch never goes out, the nightly reckoning is where it gets caught instead of quietly slipping.

The Foundation is the shared bus in the middle. It is how the halves talk to each other, and it is why the profiles and memory are worth setting up first. You do not need all four to get value. Each kit stands on its own, with the one exception that Grow needs the Foundation. Start with what maps to your actual problem and add the rest when you feel the seam.

from scratch

If you have never used Claude Code, this is the whole path from nothing to a working setup. Budget about 20 minutes, most of it one-time.

  1. Get a paid Claude plan

    Go to claude.ai and make sure you are on Pro or Max, not the free plan. This is the step people miss, and nothing here works without it.

  2. Install the Claude desktop app

    A normal app you double-click, no terminal required. Installers are on Anthropic's download page. On Windows, if it asks you to install Git first, say yes and reopen the app. Sign in, then click the Code tab.

    Optional, but worth it: install the Claude mobile app too. With Remote Control on, it lets you steer a session running on your desktop from your phone, or hand a task to Dispatch and get pinged when it needs you. That flexibility is covered in working across devices below.

  3. Set up the Foundation first

    The Foundation installs the same way as the kits: one command in the chat, no download:

    /plugin marketplace add slogsdon/loop-and-gate-foundation

    Click Install on the menu that appears. Then, in your first session, ask it to set up your vault. The setup skill asks where your vault should live (recommending iCloud on a Mac, so it syncs to your phone and tablet), then places it:

    Set up my vault.

    With that done, give it a real goal:

    Get to know me: ask about my current project and my preferences, then save what you learn.

    While you are here, seed your voice and taste, which the Grow Kit will need:

    Run the profile interview so you know how I write and what good looks like to me.

    One caveat: installed as a plugin, the Foundation's skills sit in a read-only cache, so on some platforms the agent can improve its memory but not rewrite its own skill files. If you want the full self-improving loop, download the repo instead. Use the green Code button on the Foundation repo → Download ZIP, open the folder with File → Open folder, and run the setup the same way. The plugin is the quickest start. The download is the complete one.

  4. Install Obsidian and open your vault

    Your memory is a folder of plain markdown files, and Obsidian is the free app for reading and editing them, with links between notes and a graph you can watch grow. Install it on your desktop, choose Open folder as vault, and point it at the vault the setup script just created.

    Install the Obsidian app on your phone and tablet too, pointed at the same vault, and you have the cross-platform half: jot a thought into the inbox from your phone and the agent triages it on your desktop next session. It is optional, since the system is just files and runs fine without it, but it is how you actually see and steer what the agent knows.

  5. Add your first kit

    Kits install differently from the Foundation. They are plugins, added with one command in the chat, no download. The simplest to start with is the Accountability Kit, because it needs nothing else.

    /plugin marketplace add slogsdon/loop-and-gate-accountability-kit

    Click Install on the menu that appears, then start the daily loop with /morning. That is a complete, working setup: a Foundation that remembers you, and a kit that keeps you honest about your days.

layering in the kits

With the Foundation set up, each kit is a one-time plugin install plus, in two cases, a couple of free public plugins that provide the underlying loop.

accountability kit: needs nothing else

/plugin marketplace add slogsdon/loop-and-gate-accountability-kit

Then use the five daily commands: /morning sets the one thing today, /log captures what you did as you go, /eod reckons honestly at night, /plan-tomorrow sets you up to start cold, and /weekly-signals reads your patterns once a week.

build kit: needs the build-loop plugins

/plugin marketplace add slogsdon/loop-and-gate-build-kit
/plugin marketplace add obra/superpowers-marketplace
/plugin install superpowers@superpowers-marketplace
/plugin marketplace add addyosmani/agent-skills
/plugin install agent-skills@addy-agent-skills

The first line is the gates. The rest are the free public plugins that run the loop underneath them. Then, at any build decision, run /loop-and-gate and tell it what you want to build. It sizes the change first, then walks you only through the gates that change actually earns.

grow kit: needs the foundation plus the design and writing plugins

/plugin marketplace add slogsdon/loop-and-gate-grow-kit
/plugin marketplace add slogsdon/claude-code-config
/plugin install skills-design@slogsdon-claude-code-config
/plugin install skills-writing@slogsdon-claude-code-config

The Foundation is a hard requirement here. Then, per piece or per campaign, run /grow-and-gate. It runs the gates for whatever cadence you are in, and at the end writes what it learned back to your vault, where the Build Kit's first gate can read it.

working across devices

None of this is chained to one desk. The whole stack runs from your phone, your tablet, or your laptop against one shared vault, because the session always runs on the machine that holds your files, and two Claude Code features reach it from anywhere.

Remote Control lets a session running on your desktop be driven from any other Claude app: web, mobile, or tablet. Turn it on once (remoteControlAtStartup in settings, or the desktop app's Claude Code settings) and you can start a session at your desk and keep steering it from the couch. Dispatch is the other half: from the mobile app you hand off a task, it spins up a Code session on your desktop, and it notifies you when it needs a decision. Delegate from the beach, the work runs where your vault lives.

Underneath, the vault just has to sync. On Apple devices that is iCloud, set up for you, with one caveat for a large vault: tell iCloud Drive to keep the Obsidian folder downloaded on each device, or you wait on it. On Android or Windows, where iCloud is not an option, Obsidian Sync, the community git plugin, or a Dropbox / OneDrive folder all do the same job. Sync is not instant, so a note you just wrote on your phone can read as missing or stale to a desktop session for a few seconds. That is lag, not loss.

Running more than one session at once? Git keeps them from clobbering each other. The clean move is a separate worktree per session, deleted when you are done so copies do not pile up, with one machine, your desktop, as the single writer that commits and pushes to a private backup. All of this is Foundation-level: every kit rides the same vault, so none of it is kit-specific.

a suggested order

You do not have to follow this, but if you want a path:

  1. 01

    Foundation

    Set up memory and run the profile interview. Everything else is sharper once this exists.

  2. 02

    Accountability Kit

    The lightest kit, and the one that makes the habit of using the system stick. Start running your days through it.

  3. 03

    Build Kit

    The first time you have something real to build.

  4. 04

    Grow Kit

    The first time you have something built and need to take it to people.

By the time all four are in place, you have the full flywheel: a system that remembers you, helps you build the right thing well, take it to market in your own voice, and stay honest about whether you actually did it.

built on

The gates are the original work here. The thinking underneath them is a synthesis of others': Andrej Karpathy's system-prompt learning, an agent that edits its own instructions, Addy Osmani's self-improving coding agents, and a widely shared agent configuration by Forrest Chang that the Foundation's operating rules adapt. The Foundation's ARCHITECTURE.md credits the full set.

The kits reference, and never vendor, free community plugins for the loop between the gates: superpowers by obra, agent-skills and web-quality-skills by Addy Osmani, worktrunk by max-sixty, and ponytail by Dietrich Gebert. Each stays theirs. Swap in your own equivalents any time.

get it

Start with the Foundation. Add the kit that matches your problem.

Every repo has its own getting-started.md, a no-terminal walkthrough, and a reference/ folder with the gates in plain language. This page is the map. Those are the detail.

If it earns a place in your setup, a star on the Foundation repo helps other people find it.

The story behind it is in Building on the Margins, the essay this whole system came out of.

the newsletter

New posts by email

Occasional writing on developer platforms, payments, and AI-assisted engineering. No spam, and you can unsubscribe anytime.