{"slug": "loopx-a-control-plane-for-ai-agents-that-have-to-keep-working-for-days", "title": "LoopX: A Control Plane for AI Agents That Have to Keep Working for Days", "summary": "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.", "body_md": "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.\n\n[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.\n\nYour 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.\n\nThe project draws the separation like this:\n\n| Layer | Role |\n|---|---|\n| Codex / Claude Code / Cursor | Execute a bounded agent loop: read, write, run commands, respond |\n| Goal mode / automation / CLI / TUI | Trigger or schedule the next loop |\n| LoopX | Preserve goals, gates, todos, run history, quota, evidence, handoff state |\n\nThat 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.\n\nA `TODO.md`\n\nplus a long system prompt gets you surprisingly far. It falls over once any of these become true:\n\nLoopX makes those things explicit and machine-readable, which is what lets a loop run longer without becoming less accountable.\n\n**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.\n\n**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.\n\n**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.\n\n**Todo ownership.** Todos are tagged user or agent, with a `claimed_by`\n\nfield so multiple agents can coordinate instead of colliding.\n\n**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.\n\n**Run history and evidence.** Compact append-only events for progress, validation, blockers, rewards, and quota spend.\n\n**Public/private boundary checks.** A local scan that tries to keep credentials, raw logs, local paths, and private state out of anything you publish.\n\nRequirements are refreshingly light: Python 3.11+, `curl`\n\n, `tar`\n\n, 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.\n\n```\ncurl -fsSL https://raw.githubusercontent.com/huangruiteng/loopx/main/scripts/install-from-github.sh | bash\nexport PATH=\"$HOME/.local/bin:$PATH\"\nloopx doctor\n```\n\nThe installer drops a release snapshot under `~/.local/share/loopx/releases/`\n\n, a CLI wrapper in `~/.local/bin`\n\n, a man page, and reusable agent skills under `~/.codex/skills`\n\n. As always, read a piped install script before running it if that matters to you.\n\nUpdates go through an explicit interface rather than re-running the installer blind:\n\n```\nloopx update --check     # read-only\nloopx update --dry-run   # read-only\nloopx update --execute\nloopx demo\ncd /tmp/loopx-demo\nloopx status\nloopx quota should-run --goal-id demo-goal\nloopx history --goal-id demo-goal\n```\n\nThis creates a disposable goal with one user todo and one agent todo. You should see `ok: True`\n\nand a `should_run=True`\n\n/ `state=eligible`\n\nquota response. Do this first. It takes thirty seconds and tells you whether the mental model clicks for you.\n\n```\ncd /path/to/your-project\nloopx bootstrap \\\n  --goal-id your-project-goal \\\n  --objective \"Improve this project through bounded, verified goal segments.\" \\\n  --goal-doc GOAL.md\n```\n\n`loopx connect`\n\nis an alias for `bootstrap`\n\n. This creates:\n\n```\nyour-project/\n  .loopx/registry.json\n  .codex/goals/your-project-goal/ACTIVE_GOAL_STATE.md\n\n~/.codex/loopx/\n  goals/<goal-id>/runs/\n```\n\n**Add these to .gitignore before you commit anything:**\n\n```\n.loopx/\n.codex/goals/\n.opencode/goals/\ngoals/**/ACTIVE_GOAL_STATE.md\n```\n\nThat state is live local runtime data. Committing a controller's active goal state is how private paths and internal notes end up in a public repo.\n\nA healthy connection means `loopx doctor`\n\npasses, both files above exist, `loopx status`\n\nshows who acts next, and none of it is staged for commit.\n\nThe docs actually push you toward *not* running these commands yourself. Paste something like this into Codex, Claude Code, or Cursor from your project root:\n\n```\nConnect the current project to LoopX. Do not clone the LoopX repository.\nIf `loopx` is not on PATH, install it with the official no-clone installer.\n\nThen run `loopx doctor`. Working only from the current project root:\n1. If LoopX state already exists, reuse it. Do not overwrite the goal or objective.\n2. If the project is not connected, prefer `loopx connect`; use `loopx bootstrap`\n   only when state clearly needs initialization.\n3. Ensure `.loopx/`, `.codex/goals/`, and `.local/` are ignored.\n4. Set up the thin LoopX heartbeat for this surface.\n5. Stop after setup and report the active state id, current user gate, top agent\n   todo, and next safe action.\n\nDo not start longer delivery work in this setup turn.\n```\n\nOne caveat worth knowing before you try this with a non-Codex agent: LoopX can only drive an agent that exposes at least one control hook, such as shell execution, a goal/task command, an automation hook, or its own scheduler. Without one, LoopX still tracks state, but you run the commands by hand.\n\n```\nloopx status\nloopx history --goal-id your-project-goal\nloopx quota should-run --goal-id your-project-goal\n```\n\nAdding work:\n\n```\nloopx todo add --goal-id your-project-goal --role agent \\\n  --text \"Run the next bounded validation slice.\"\n```\n\nDiagnosing is also meant to be delegated. `loopx diagnose`\n\ndeliberately emits an agent-facing evidence packet rather than a verdict, so you ask your agent to run it and reason from it: can this project self-drive, what blocks it, what exact question needs your answer, what happens next.\n\nAn automatic turn is supposed to check quota before working and record spend exactly once after validated writeback:\n\n```\nloopx quota should-run --goal-id your-project-goal\nloopx heartbeat-prompt --thin --goal-id your-project-goal\nloopx quota spend-slot --goal-id your-project-goal --slots 1 --source heartbeat --execute\n```\n\nSpend is not appended for quiet skips, preflight failures, or dry runs. `should-run`\n\nreturns a fairly rich contract: whether delivery may run, what it is waiting on (user, controller, external evidence, health, quota), the work lane, todo summaries, and the spend policy.\n\n```\nloopx check --scan-path README.md --scan-path docs/ --scan-path examples/\n```\n\nThere is a read-first React dashboard for inspecting projects, todos, gates, and evidence across a global registry. It is explicitly experimental: the CLI stays the source of truth and browser writes require local opt-in. Check the repo docs for the current path, since it moved between the README and the getting-started guide.\n\nThe maintainer is unusually direct about this, which is a good sign. LoopX is not a full agent platform, not an autonomous production controller, and not a replacement for your runtime. Project ownership and dangerous permissions stay with the human. It is a local coordination substrate.\n\n**Yes, if:** you are running agents on goals that span days, you have heartbeat or monitor-style turns firing on a schedule, you coordinate a controller agent with scoped side agents, or you have already been bitten by an agent confidently redoing work it finished last Tuesday. The demo costs you a minute, and the ideas are portable even if you never adopt the tool.\n\n**Probably not yet, if:** you use agents for single-session tasks, you are on Windows without WSL, you need something battle-tested with a release history and a large user base, or you do not use Codex-family or shell-capable agents. The value shows up proportionally to how long your loops run. Short loops do not drift, and the ceremony will feel like overhead.", "url": "https://wpnews.pro/news/loopx-a-control-plane-for-ai-agents-that-have-to-keep-working-for-days", "canonical_source": "https://dev.to/arshtechpro/loopx-a-control-plane-for-ai-agents-that-have-to-keep-working-for-days-47n", "published_at": "2026-08-05 18:23:46+00:00", "updated_at": "2026-08-05 18:25:41.422372+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-infrastructure"], "entities": ["LoopX", "Ruiteng Huang", "Codex", "Claude Code", "Cursor"], "alternates": {"html": "https://wpnews.pro/news/loopx-a-control-plane-for-ai-agents-that-have-to-keep-working-for-days", "markdown": "https://wpnews.pro/news/loopx-a-control-plane-for-ai-agents-that-have-to-keep-working-for-days.md", "text": "https://wpnews.pro/news/loopx-a-control-plane-for-ai-agents-that-have-to-keep-working-for-days.txt", "jsonld": "https://wpnews.pro/news/loopx-a-control-plane-for-ai-agents-that-have-to-keep-working-for-days.jsonld"}}