Agent Autoloop Lets Your Coding Agent Quit the Moment It Needs You
A self-hosted kernel that routes events to Claude Code or Codex, writes every fact to SQLite, and wakes you only when a decision is waiting.

我希望它应该是极其轻量、快速、安全,但同时也是可扩展性极佳的。
- Agent Autoloop's core inversion is that the agent process exits the moment a human decision is pending, instead of blocking on a socket while you think.
- The agent-to-hub contract is a fenced Markdown code block printed to stdout, so any CLI that accepts a prompt and prints a reply can participate.
- The kernel is event-sourced over node:sqlite and rebuilds its own projections from a hash of its reducer source text, with no version number to bump.
- It is a local glue layer between triggers, a CLI agent, durable task state, and human approval, not a workflow engine or a multi-agent framework.
The Agent Quits When It Needs You
It is 02:00. A GitHub issue opens on a repo you maintain. A small always-on hub is watching the repo's webhook, matches the event against a rule in a JSON file, and spawns Codex with a prompt. Codex reads the issue, drafts a triage note, and reaches a judgement call it will not make on its own: is this a bug or a feature request, and does it deserve a reply tonight?
So it prints a card and exits. Not idles. Not blocks on input(). The process is gone. Nothing is running. The question is now a row in a SQLite log, and a notification is sitting on your phone. You read it over coffee at 08:00, tap an option, and Codex is respawned with its session intact to finish the job.
That is the whole thesis of KKKKhazix/agent-autoloop, and it reframes what a background agent even is. Every human-in-the-loop system you have used keeps something alive while it waits. Autoloop argues the process is the least important part.
The README describes the intended effect plainly: let your command-line agent take jobs on its own in the background and follow through to the end, and normally it does not bother you, sending a card only when it is unsure.
中台只让它在原会话里重写最后这段回复,不会把已经干完的业务重做一遍;重写也失败时,保留原结论并通知你回执没有生效。
(The README's own words, roughly: the hub only asks the agent to rewrite its final reply inside the original session, so it never redoes work it has already finished. If the rewrite fails too, it keeps the original conclusion and tells you the receipt did not take effect.) That is the resume guarantee in one sentence.
One Year, Then a Rewrite
KKKKhazix spent a year on this before releasing it. The first version worked, but it was not the version that shipped. The creator's announcement describes a redesign that split the core from four separable concerns: event sources, agents, notification channels, and delivery pipelines, so each could be swapped as a plugin.
Roughly translated: I wanted it to be extremely lightweight, fast, and safe, while also being extremely extensible. That tension between a tiny core and a wide surface is the design brief. The kernel is about 1,800 lines with zero runtime dependencies, MIT licensed, and it requires Node 24. The announcement credits two influences: Pi's minimal-kernel-with-extensions design, and DeepSeek Harness's everything-is-a-plugin architecture.
The creator's stated motivation is narrower than the feature list suggests. In the same announcement, the reason behind the whole project: human attention is, and always will be, the most precious asset.
Rules, Not Code
The routing surface is a single file, ~/.agent-autoloop/rules.json. A rule pairs a trigger with an agent and a prompt. One cron rule, one source rule:
[
{
"name": "morning-brief",
"when": { "cron": "0 9 * * *" },
"to": "codex",
"cwd": "~/notes",
"prompt": "Summarize anything that changed in this folder overnight."
},
{
"name": "issue-triage",
"when": { "source": "github", "types": ["issues.opened"] },
"to": "claude",
"cwd": "~/repos/site",
"parallel": 3,
"prompt": "Triage this issue. Ask before you reply publicly."
}
]
The difference from a bare cron job is not the schedule. A cron job runs a command and forgets it. A rule here carries the agent choice, the working directory, a concurrency limit, and the prompt, and its output is persisted as events rather than lost to a log file.
Two commands make the config honest. agent-autoloop rules explain prints the effective rules, the agents, the channels, and the next cron fire time exactly as this machine would run them. And emit <type> --dry-run tells you which rule would catch an event before you send it, or warns that no rule takes it at all. Both are read-only and never touch the running hub.
The Protocol Is a Code Fence in stdout
Here is the part that makes people stop reading and look up. The contract between the agent and the hub is not an SDK, not a client library, not an API key. It is a fenced Markdown block in the agent's final message.
agent-autoloop
{
"ask": [
{
"title": "Reply to issue #412?",
"text": "This looks like a feature request, not a bug. Draft a reply?",
"options": ["reply", "skip", "escalate"],
"key": "shipping"
}
]
}
The worker parses the final output of the CLI process for this block. If it finds an ask, it raises a question card. If it finds a notice, it sends a one-way message. If it finds nothing, the run just ends. Any tool that can print text and exit can participate, which is why the README claims any command-line tool can be plugged in.
The init command also accepts a raw command template, --command 'somecmd {prompt}', where {prompt} is passed as a single argument. That single-argument rule is the shell-injection guard: the prompt cannot be split into extra flags or chained commands.
Under the Hood: A Log, a Hash, and No Version Numbers
The storage layer is two tables. facts is an append-only log: a sequence number and a JSON blob. projections is a generic key-value store of JSON documents, keyed by collection and key. Everything the system knows is derived by folding the log into the projections.
The clever part is how the relational views are built. Instead of hand-writing them, the runtime regex-parses kernel/schema.sql, extracts each column name, and generates a SQL view per table that does json_extract(data,'$.col') AS col over the projections. The schema file is the single source of truth for both the table shape and the JSON paths inside it.
The fingerprint is the reward for the reader who stayed. The runtime hashes the source text of the files that define how facts fold into state (evolve.ts and credentials.ts), plus the master key. When that hash changes, the projections are rebuilt from the log automatically. The code comment makes the invariant explicit: the persisted projection is expendable, and the log alone rebuilds it.
That buys you a system with no version number to bump and no migration to write. The tradeoff is real: any cosmetic edit to those two files forces a full rebuild, and the cost of that rebuild grows with the size of the log. Views are dropped and recreated inside one BEGIN IMMEDIATE transaction so no other process ever sees the gap between them.
The same restraint shows up in the scheduler, which is not a scheduler. One setTimeout is re-armed after every change to fire at the minimum of three things: the earliest scheduled item, the earliest long-polling waiter, and a retry timestamp. It clamps to the largest value Node's timer accepts, about 24.8 days, a detail a lot of implementations miss.
How It Compares
The fastest way to place Autoloop is to say what it is not. It is the glue between triggers, a local CLI agent, durable task state, and human approval. It is not a workflow engine, not a visual builder, not a multi-agent framework.
| Project | What it is | Who runs the agent | How you get pulled in | Durability model |
|---|---|---|---|---|
| Agent Autoloop | Local event-to-agent hub | The hub spawns the agent as an intermittent subprocess | Cards via Feishu, desktop, or webhook | Event-sourced SQLite log |
| LangGraph | Library for stateful agent graphs | You write the graph and run it | A human-in-the-loop node you author | Your choice of checkpointer |
| Temporal | General durable execution platform | Your workers run arbitrary code | Approvals are signals | Durability is the product |
| n8n | Visual workflow automation | Nodes call services | Approvals via integrations | Workflow state |
| OpenHands / SWE-agent | Autonomous software-engineering agents | The agent is the product | No external event router | The agent's own run |
The axis that separates Autoloop from all of them is not features. It is where the process lives while a human thinks. Everyone else keeps something running. Autoloop writes a row and exits.
What's Proven and What Isn't
The repo is unusually candid about the line between tested and assumed, and that honesty is worth taking at face value.
- Verified: multi-turn and cross-process session continuation with Claude Code, Codex, and ACP, plus Feishu card interactions.
- Simulated only: the webhook templates were tested against local simulations, and some examples were never run end to end against real accounts.
- Platform limits: macOS and Linux only, Windows support is pending, and Node 24 is required.
- Self-reported: the creator's internal figure of about 80 suggestions with nearly 70 handled autonomously is the author's account, not an independent audit.
None of that undercuts the design. It just means you should treat the untested integrations as templates to adapt, not turnkey connectors, and read the README's own verification notes before you wire it into anything that matters.





