LoopX: A Control Plane for AI Agents That Have to Keep Working for Days LoopX, a new open-source control plane for long-running AI agents, aims to solve the problem of agents losing context and accountability over multi-day tasks. The tool, created by developer Ruiteng Huang, preserves goals, gates, todos, and run history between bounded agent loops, allowing agents like Codex, Claude Code, or Cursor to work persistently without losing track of objectives. LoopX introduces features such as lifetime goals, user gates, safe fallback paths, and quota guards to manage agent behavior and prevent token waste. If you have ever pointed a coding agent at a multi-day goal, you know the failure mode. It is not that the model writes a bad function. It is that on turn 40, the agent no longer remembers what the objective was, which decision you already made, what is out of scope, or what the last run actually proved. The context window rolled over, and the plot went with it. LoopX https://github.com/huangruiteng/loopx is an attempt to fix that specific problem. It calls itself "loop engineering for long-running AI agents," and it is a local control plane that sits above your agent runtime rather than replacing it. Your agent Codex, Claude Code, Cursor, whatever executes bounded loops. Something a heartbeat, a cron job, you hitting enter triggers the next loop. LoopX holds the state that has to survive between those loops. The project draws the separation like this: | Layer | Role | |---|---| | Codex / Claude Code / Cursor | Execute a bounded agent loop: read, write, run commands, respond | | Goal mode / automation / CLI / TUI | Trigger or schedule the next loop | | LoopX | Preserve goals, gates, todos, run history, quota, evidence, handoff state | That third row is the whole product. LoopX is not an executor and not an autonomous production controller. It is a state kernel with a CLI. A TODO.md plus a long system prompt gets you surprisingly far. It falls over once any of these become true: LoopX makes those things explicit and machine-readable, which is what lets a loop run longer without becoming less accountable. Lifetime goals. A durable project intention that outlives one chat thread. Importantly, a lifetime goal does not hand the agent open-ended autonomy: only the next bounded transition is executable. User gates. A concrete decision that belongs to you, recorded as a first-class object instead of a sentence in a transcript. The loop can see that it is blocked on a human. Safe fallback. When one lane is gated, audited side paths can keep moving without bypassing the gate. This is the part I find most interesting: the alternative designs are usually "block everything" or "let the agent decide," and both are bad. Todo ownership. Todos are tagged user or agent, with a claimed by field so multiple agents can coordinate instead of colliding. Quota. A guard that answers whether an automatic turn should run right now, wait, ask the user, self-repair, or stay quiet. Practically, this is your defense against a heartbeat loop burning tokens on turns that cannot produce a verified transition. Run history and evidence. Compact append-only events for progress, validation, blockers, rewards, and quota spend. Public/private boundary checks. A local scan that tries to keep credentials, raw logs, local paths, and private state out of anything you publish. Requirements are refreshingly light: Python 3.11+, curl , tar , and a macOS or Linux shell. The Python package has no runtime dependencies outside the standard library. Git is only needed if you want to contribute. curl -fsSL https://raw.githubusercontent.com/huangruiteng/loopx/main/scripts/install-from-github.sh | bash export PATH="$HOME/.local/bin:$PATH" loopx doctor The installer drops a release snapshot under ~/.local/share/loopx/releases/ , a CLI wrapper in ~/.local/bin , a man page, and reusable agent skills under ~/.codex/skills . As always, read a piped install script before running it if that matters to you. Updates go through an explicit interface rather than re-running the installer blind: loopx update --check read-only loopx update --dry-run read-only loopx update --execute loopx demo cd /tmp/loopx-demo loopx status loopx quota should-run --goal-id demo-goal loopx history --goal-id demo-goal This creates a disposable goal with one user todo and one agent todo. You should see ok: True and a should run=True / state=eligible quota response. Do this first. It takes thirty seconds and tells you whether the mental model clicks for you. cd /path/to/your-project loopx bootstrap \ --goal-id your-project-goal \ --objective "Improve this project through bounded, verified goal segments." \ --goal-doc GOAL.md loopx connect is an alias for bootstrap . This creates: your-project/ .loopx/registry.json .codex/goals/your-project-goal/ACTIVE GOAL STATE.md ~/.codex/loopx/ goals/