← Back to blog
AiAbout 7 min read

agent-autoloop treats waiting for a human as a database row

Published Nov 15, 2026
agent-autoloop treats waiting for a human as a database row

Every few weeks I watch someone start a coding agent in a terminal, get up to make coffee, and come back to find it parked on a question nobody saw. The usual fix is a louder notification sound. agent-autoloop attacks the waste underneath: a process and a context window sitting open, doing nothing, while a person is away from the keyboard.

It is a local hub, 5,459 GitHub stars as of 15 November 2026, MIT licensed. It watches for events, hands them to whichever command line agent you already run, and stays out of the way. The agent finishes a round, writes its answer, exits. When it needs a decision, the hub sends a card to your desktop, or to Feishu, DingTalk, WeCom, Slack or Discord. You pick an option. The agent picks the conversation back up.

No cloud box, no open port, no dashboard.

Install, and the one command that proves it works

Requirements: Node 24 or newer, Git, and one command line agent already installed and logged in. On macOS and Linux you also need curl.

irm https://raw.githubusercontent.com/KKKKhazix/agent-autoloop/main/install.ps1 | iex
curl -fsSL https://raw.githubusercontent.com/KKKKhazix/agent-autoloop/main/install.sh | sh

Then run agent-autoloop try. Install scripts that print a version number prove nothing about whether your agent's flags and login work. try walks a real ask, wait, answer, continue cycle with your own agent: an event goes out, the agent works, stops, asks a question with options, exits, then waits. Answer it and the hub resumes the session and finishes. If something is misconfigured you find out in two minutes, not at 2am when a cron rule misfires.

One sentence of contract, one file of rules

The interface between hub and agent is a single convention: put the result in the final reply. No SDK, no wrapper, no patched binary. Anything that takes a prompt and prints a last message can be attached, which is why a generic command adapter sits alongside Claude Code, Codex, ACP, DeepSeek Harness and ZCode.

Asking is an append. The agent ends its reply with a fenced block named agent-autoloop holding JSON: an ask array with a title, text, options and a key, plus notice, resolve, later and events for the other verbs. That is the whole protocol an agent author has to learn.

Rules live in ~/.agent-autoloop/rules.json. A rule answers three questions: what happened, which agent gets it, which directory it runs in.

{
  "when": { "cron": "0 9 * * *" },
  "to": "codex",
  "cwd": "~/notes"
}

An event rule swaps the clock for a source: match GitHub issues.opened, add parallel: 3 and a skill, same shape. Two files hold the configuration, this one and whatever your agent already reads. I like that it is inspectable and easy to diff.

Four mechanisms borrowed from systems work

The kernel is where the design gets interesting. Almost none of it is new in isolation.

Zero-cost suspension comes first. While waiting, the process exits and the state moves into a database. Three days of silence costs three days of no tokens and no running agent. Only the hub stays up, which is a small thing to leave running.

Event sourcing is second. Every piece of state derives from an append-only log, and the log is written in the same transaction as the index before the hub replies. Kill the process and confirmed work survives. Any round can be explained later by its number. Schema changes rebuild from the log instead of requiring migration scripts.

Instruction and data separation is third. External text, such as an issue title, is stored as material in a file and never concatenated into the prompt. The prompt carries only validated type, id and link. Which agent runs, in which directory, with what access, comes entirely from your local rules. An event arriving with cwd, agent or access on it is rejected.

The hop fuse is fourth, and my favourite. Agent generated events dispatched back to agents accumulate depth, in the way a packet accumulates a TTL. Human questions and scheduled rechecks do not reset the counter, and the agent cannot edit it. Past 8 levels the hub stops dispatching, records the event, and sends you a card instead.

The numbers, and where I stop believing them

Its benchmark table comes from an Apple M5 Pro with 24 GB and Node 24.21.0, with every write committed individually and the transaction on disk before the reply. Cold start 88.78 ms. Idle memory 59.94 MB RSS. A thousand simultaneous long polls at 170.49 MB. 2,394 durable writes per second. Dispatch p99 of 1.82 ms, and a heartbeat p99 of 1.66 ms while 5,000 items sit in the queue. Startup over 1.1 million facts at 99.8 ms. Zero runtime dependencies.

Those are queue numbers, not app numbers, which is the point. A hub that stores waiting as a row and work as an event should behave like a queue.

My scepticism: one machine, one operator, a warm page cache, and a harness written by the person who wrote the kernel. The benchmark never runs against a laptop with a video call and a build in the background, so read it as a lower bound, not a promise. The 1.1 million fact figure is also paired with an honest cost elsewhere. The README says the first start after a format change rebuilds from the log, and that took 43.1 seconds. Fine for a laptop, awkward if you assumed otherwise.

Two places autonomy can hurt you, and what you inherit

Security is where the authors were least clever, which I mean as praise. Instruction and data separation means a hostile issue title cannot redirect a run to a different directory or a different agent, because those fields are refused at the door. The hop fuse means a set of agents passing work to each other cannot spin forever, because depth is incremented by the hub and not by the participants.

Neither is a proof. The fuse is a policy at 8 levels. If a legitimate workflow needs 9, you have a problem, and if the dangerous case is a slow two level loop that does real damage on each hop, the fuse never fires. Separation guards the dispatch decision, not what the agent does once it has a shell in the directory you handed it.

Simulation is stronger than most. node sim/random.ts 24301 200000 runs 200,000 steps of dropped connections, lost packets, crashes and duplicate submissions under a fixed seed, so a failure can be reproduced. node sim/crash.ts 1000 12648430 kills the process 1,000 times and checks that no confirmed record disappears. Then the README adds that whole machine power loss was not tested. I respect that sentence, and it makes me ask what else was not. The webhook templates were only run against local mock servers. The GitLab webhook was checked against its documented format and never against a real GitLab. The recipe scripts were validated against a fake Feishu CLI. Each is a place where "tested" means less than a reader will assume.

What you inherit with a hand written kernel and zero runtime dependencies is the maintenance. A small dependency tree ages well when someone is paying attention and badly when the author moves on. That is the trade for an 88 ms cold start.

One billing detail sits outside the design entirely. The hub drives the CLI tools already installed and logged in on your machine, so usage lands on your own account or subscription. The README notes that vendors prefer API keys for high frequency automation, because personal plans are built for human paced interaction. Read that twice before pointing a cron rule at your Claude Code session and going to bed.

One risk survives every mechanism above. A loop that can file GitHub issues, and with the delivery pipeline merge pull requests that carry a deliver label, is a supply chain actor with your credentials. Everything above makes it reliable and gives it a short leash. The review step you configured is the only thing standing between it and a bad merge, and no amount of event sourcing improves a review you did not read.

Related articles