Project Info
Inspiration
Codex is an amazing tool, but I felt it was still missing a good implementation for turning multi-agent work into durable, reusable workflows. Codex already has strong building blocks. It can delegate work to different agents, use different models and reasoning effort levels, run scheduled tasks, and use skills for procedural work. But there are many use cases where these individual solutions are not enough. I wanted a higher-level layer where the entire process—the agents, dependencies, context, verification, limits, and human decisions—can be defined, inspected, reused, and executed again. Claude Code also inspired me with its configurable subagents and multi-agent workflows. But I wanted to approach the orchestration topic differently and build something simple enough to understand visually, while still being general enough for many different use cases. So I thought: why not use this opportunity to present myself to the Codex team with what I believe could be one of the next big steps in agentic coding: Loops. What this project defines as Loops Loops are reusable, multi-step workflows. Each step is represented by a node, and the nodes are connected through edges. A node represents a unit of work or orchestration logic. It can be an Agent with a task to solve and an explicit definition of done, but it can also represent a condition, verification step, human approval gate, map, join, bounded loop, or subworkflow. An Agent node defines which model and reasoning effort to use, which capabilities it needs, which Context Blocks it is allowed to read, and what should happen if it fails. A retry can even upgrade the model before trying again. The output of a node becomes context and evidence that following nodes can use. This makes context propagation explicit instead of simply putting everything into one increasingly large conversation. A supervisor observes the health of the Loop. It can detect failed or stalled work, allow additional retries, upgrade the model used for recovery, or escalate the problem to the user. The supervisor does not take over the Agents’ tasks. Its purpose is to watch the workflow and help it recover when the original execution plan is no longer progressing as expected. An edge defines the logic path between nodes: what must run before another step can begin and which outputs should be passed forward. Edges can also define what should happen when a node fails, whether the next node should remain blocked, whether the workflow may continue with a warning, or whether the user needs to be asked. The complete Loop also has limits for concurrency, total agents, iterations, tokens, wall-clock time, and repeated rounds without progress. This is important because a workflow called a “Loop” should probably also know when to stop looping :) Why Loops To keep it simple, Loops solve a combination of challenges that individual agents, scheduled prompts, or reusable skills do not completely solve on their own: Use different models and reasoning effort levels for different steps, depending on how difficult or important they are. Run independent work in parallel while keeping dependent work in the correct order. Give every Agent only the context it actually needs instead of sharing one giant conversation. Make the definition of done, verification, retries, approvals, and failure behavior explicit. Keep long-running workflows bounded through budgets, stop conditions, and no-progress detection. Pause, resume, inspect, and intervene in work without losing the history of what happened. Reuse the same workflow manually, on a schedule, or through a webhook. What makes Codex Loop different is the combination of a chat-first experience and an inspectable visual graph. The user does not need to understand graph orchestration before getting started. They can simply describe the outcome they want, and the Loop Designer creates the agents, dependencies, verification steps, integrations, and safety limits. The graph then becomes an explanation and an audit trail of what Codex plans to do—not a complicated form the user has to complete before anything can happen. At the same time, users who want more control can open the visual editor and adjust the individual nodes, edges, models, effort levels, retries, context access, and execution rules themselves.
What it does
Codex Loop lets users describe, create, run, and reuse custom multi-agent workflows. The user starts by describing an outcome in natural language. A persistent 5.6-Sol Loop Designer inspects the available capabilities and creates a schema-constrained workflow proposal. It records reasonable assumptions and asks only when missing information would materially change the safety, architecture, access, cost, or definition of done. The result is a versioned draft that the user can continue refining through chat. Each change creates a new revision, and changes can be undone without silently rewriting the history. The user can also switch to the graphical editor for more precise manual adjustments. Before real execution, the Loop can be simulated. Simulation validates the dependency plan, previews what each node would do, and checks workspace and capability availability without starting Agent threads or modifying files. Once the Loop is ready, it can be published and: Run once with an optional additional prompt and project directory. Run automatically on a configurable schedule. Be triggered through a webhook with input parameters. During execution, Codex Loop creates a native Codex thread for every Agent node. Independent nodes can run in parallel, while dependent nodes wait for their required inputs. Context Blocks control which information each Agent receives, and completed work can create checkpoints that are reused when the workflow definition and repository revision still match. The interface streams the actual Agent messages, commands, tool calls, approvals, file changes, retries, failures, and final outputs. Previous runs keep frozen execution results, so a new run cannot overwrite the evidence from an older one. The user can also pause scheduling, stop active turns, answer Agent questions, approve requested actions, steer an active Agent, queue a follow-up instruction, or share new context with selected future Agents. So it is not just a graph that looks like agents are working. It is a local control plane running real Codex threads and keeping the entire execution inspectable. How I built it I built the frontend with React, TypeScript, Vite, and React Flow. The graph is used both as a visual editor and as a live representation of the execution state. The backend is an Express server with local JSON persistence. For real execution, the backend communicates with codex app-server through its JSONL protocol over stdin and stdout. Each Agent node is mapped to a persistent native Codex thread, and the bridge handles starting and resuming threads, starting turns, streaming events, requesting approvals, answering questions, steering, interruption, and token usage. The Loop Designer is itself a persistent, read-only Codex thread. It receives the current workflow, the user request, and the discovered capabilities, then returns a schema-constrained proposal that can safely be compiled into the next graph revision. I also built an authenticated MCP interface and packaged design-loop and operate-loop skills. This means a user can create or operate a Loop from another Codex task without needing to begin in the visual application. Challenges I ran into My project is intended as inspiration for the Codex team: a cool feature that I think, if polished well, could become an amazing part of the app. But since I do not have access to the Codex source code itself, I had to work around that limitation. That is why I built on top of the Codex CLI and app-server, and created a limited replica of the Codex interface around it. Thankfully, that was enough to build a functional prototype, but it also means I had to build a bridge instead of implementing the feature directly inside Codex. Nevertheless, it was 5.6-Sol’s work to make it happen, so this is mainly a limitation I think you should take into account while assessing the project. Just close your eyes slightly and imagine it is actually Codex, and not a frontend running a copy of it :) The other big challenge was that orchestration becomes much more complicated once the graph needs to do real work. Starting multiple agents is the easy part. The difficult part is deciding which context they receive, what completion means, how retries behave, when branches may continue independently, what pause and stop actually mean, how human questions are routed, how stale approvals are rejected, and how to prevent a repeating workflow from wasting unlimited time and tokens. The final challenge was exposing all that power without making the user design a distributed system before fixing a bug. This is what led me to make chat the primary experience and the graph the secondary, more precise interface. Accomplishments that I’m proud of I love the concept of using an actual sun, moon, and Earth for the graph nodes. I think this was a clever idea and adds a polished, recognizable look to the graph. The different effort levels also have their own visual hints, so the user can understand the expected intensity of a node just by looking at it. Although I think that already looks cool, with a little more time I could probably have made it as strong as the node-type visuals. You get the idea. I am actually more of a backend developer, but I also think I have a lot of potential as a UX designer because I think I understand good the how to make the user experience as best as possible. That is why I decided in the middle of the project to make the graphical interface the secondary interaction and the chat interface the first-class experience. A skill that helps users define what they want became a natural choice: users can describe their outcome first, and only go into the graphical interface when they want to inspect or manually refine the details. I am also proud that the result is more than a visual mockup. The prototype runs native Codex threads, keeps durable execution history, scopes context, handles retries and attention, enforces budgets, and supports real reusable triggers. There is still plenty left to polish, but the important architectural idea is actually there and working. What I learned I learned a lot about agent-harness work during this project. At first, I thought my Loop concept was easy, which was also why I thought it was such a unique and great idea. But halfway through the work and research, I started to understand why orchestration is genuinely challenging. Building one shoe that fits every foot or one workflow abstraction that fits every use case was tough. The hardest part is not asking several models to do several tasks. The hard part is designing the contracts between them: dependencies, context boundaries, definitions of done, verification, failure handling, budgets, and human intervention. I also learned that the best orchestration interface may not look like orchestration at first. Most users should not need to think in nodes and edges. They should be able to explain what they want in chat, while the graph quietly gives them transparency, control, and confidence. The graph then can contain a lot of complexity but abstract the execution in a simple way that the user can easily extend and improve.
What's next
for Codex Loop I would add automatic per-node Git worktrees, richer Observer policies, external notifications when a Loop needs attention, stronger authentication and permissions, better secret-provider bindings, and more production-ready execution storage. The visual language could be developed further as well. I would love to make model strength, effort, cost, context flow, and risk readable almost entirely from the graph. And now, I hope you find this funny. I had a lot of fun building the project, so basically, here comes my résumé for you xD. I’ll keep it super short: I started working with chatbots and NLP at university many years ago, doing classical intent ranking and scoring with a Solr database and similar technologies. Since then, I have always been involved with the application side of language models. I worked at Telekom as an AI Engineer, building a coding agent before today’s coding harnesses existed, as well as an AI Operator intended to work as a first-level support system. Now I am an AI Engineer at Würth IT, building an orchestration system with voice as the first-class experience. So I have seen the application side of language models from before the current boom. I was actually an early fan of GPT-2 because I was born in Bolivia, and one of its example texts examples was about a scientist in Bolivia and the Andes region. The YouTube channel Computerphile made an explanation video about it, and I was amazed. If you are interested in my idea, or simply want to chat about why I think you should build a V2 of this project, feel free to contact me. I have a full-time job, so this project was built during a few hours of work each day. But I am open to starting a new challenge if you would like me to join you. I hope you had as much fun reading this as I had building it, and hope you find inspiration in it for codex.
Codex Loop
Codex Loop is a local, chat-first control plane for designing, running, and supervising reusable Codex workflows. Describe an outcome to the persistent Loop Designer; it turns the request into a validated, versioned execution graph and keeps the full graphical editor behind an explicit Edit visually action.

What it provides
- Chat-first graph creation and revision through a read-only GPT-5.6 Sol Designer thread.
- A read-only graph preview plus a graphical editor for nodes, dependencies, budgets, retries, capabilities, context access, and supervisor behavior.
- Agent, map, join, condition, loop, verify, gate, and subworkflow orchestration nodes.
- Per-node Sol, Terra, or Luna selection, reasoning effort, retry upgrades, and a post-design assessment of model fit, expected token-use drivers, and current Codex credit costs.
- Live discovery of available Codex skills, apps, MCP servers, Computer Use, and supported CLI capabilities.
- Native Codex threads backed by
codex app-server, including streamed messages, tool calls, file changes, approvals, user-input requests, token usage, and status updates. - One-time, scheduled, and webhook-triggered runs; immutable run history; simulation; interventions; checkpoints; bounded retries; and no-progress detection.
- Durable JSON storage and Docker packaging for a local workstation or trusted home server.
- An authenticated Streamable HTTP MCP surface plus packaged
design-loopandoperate-loopskills for controlling Loop from another Codex task.
How it works
The browser is an operator interface, not a Codex credential holder. The Express server owns the authenticated codex app-server subprocess and exposes narrow workflow and thread operations to the UI. Each graph node maps to a persisted native Codex thread. Loop owns dependency scheduling, budgets, checkpoints, capability bindings, context routing, gates, and supervision; Codex owns the reasoning and tool-use loop inside each worker.
The Designer returns schema-constrained proposals. Loop compiles each complete proposal into a new workflow revision, validates it, records the mutation, and shows assumptions or up to three consequential questions. Creating or revising a graph also produces a model-selection assessment that explains:
- whether each model and reasoning effort matches the task complexity;
- how context, reasoning effort, graph fan-out, tools, retries, and the token ceiling affect usage;
- the comparative Codex credit rates for Sol, Terra, and Luna; and
- when a cheaper or stronger model would be a better tradeoff.
Credit rates can change, so the Designer points users to the current Codex pricing page. Actual run cost depends on the input, cached input, output, reasoning, tools, and retries consumed by that run.
Quick start from source
Prerequisites:
- Node.js 22 and npm.
- A current Codex CLI available as
codex. - An authenticated local Codex session (
codex login status). - A repository or projects directory that workers may use as their workspace.
npm ci
codex login status
npm run dev
Open http://127.0.0.1:5173. Vite proxies API requests to http://127.0.0.1:4317 during development.
For a production-style source run:
npm run build
npm test
npm start
Open http://127.0.0.1:4317 after the build. The server serves the compiled interface and API from the same origin.
For the simplest agent-oriented local container build, follow build.md. That guide builds and runs one local Docker image and intentionally excludes release tagging, GHCR, Watchtower, Caddy, and home-server setup.
Designing a Loop
- Open Loop and create a blank Loop or start from a template.
- Describe the outcome in the Designer chat.
- Review the graph, the Designer response, model/cost assessment, assumptions, setup requirements, and validation issues.
- Refine the graph in chat, or choose Edit visually to change it directly.
- Simulate the Loop for a non-persisted, read-only readiness report.
- Save and publish a valid revision, configure its trigger, and run it.
Visual edits support node creation and deletion, connection management, drag positioning, orchestration settings, model and effort selection, retry policy, task capability autocomplete, context visibility, secrets-by-reference, run budgets, and supervisor escalation policy. Secret values do not belong in a Loop definition.
Node kinds
| Kind | Purpose |
|---|---|
agent | Run one bounded Codex worker task. |
map | Fan out independent work over a collection within concurrency and total-agent budgets. |
join | Wait for upstream branches and synthesize their results. |
condition | Select supported outgoing routes from evidence. |
loop | Repeat until a declared stop condition or iteration limit is reached. |
verify | Independently test or challenge upstream claims against a rubric. |
gate | Require explicit human approval before continuing. |
subworkflow | Invoke another saved Loop as a bounded child workflow. |
Run modes
- Simulate validates the dependency plan and produces a generic preview. It performs only read-only workspace and capability/authentication probes; it does not create threads, run tools, modify files, or persist a run.
- Run once starts a saved Loop with an optional one-time prompt and working directory. It does not overwrite the configured scheduled or webhook trigger.
- Scheduled run starts on selected weekdays and times in an IANA time zone. The coordinator prevents duplicate starts for the same scheduled minute.
- Webhook run exposes a tokenized
GETorPOSTendpoint at/api/triggers/:token. Query values or a JSON object are merged with configured defaults and made available to the run.
Each run freezes its thread messages, tool calls, file changes, final outputs, checkpoints, token use, and audit events. The operator can pause, resume, stop, answer native user-input requests, resolve gates, steer active work, queue follow-ups, or inject curated context. Token ceilings and maximum no-progress rounds stop unbounded work.
Models and token use
Loop uses the short names Sol, Terra, and Luna in workflow definitions:
- Sol is the highest-capability and highest-cost option for ambiguous, difficult, or high-value work.
- Terra balances reasoning quality and cost for everyday implementation and tool use.
- Luna is the lowest-cost option for clear, repeatable, high-volume tasks.
Reasoning effort is configured separately. Use the lowest effort that reliably satisfies the node’s definition of done; higher effort, larger context, verbose tool results, fan-out, retries, and long outputs can all increase token consumption. Loop tracks native thread/tokenUsage/updated events against an optional workflow token ceiling.
Persistence and security
By default, workflow definitions, native thread mappings, mutations, run records, and execution evidence live in data/codex-loop.json. Keep data/ persistent when replacing a container. The Docker setup also mounts the host Codex home and workspace instead of baking credentials or user data into the image.
Codex Loop can launch native Codex workers that read and modify the mounted workspace according to CODEX_LOOP_SANDBOX. It has no built-in public-user authentication for the web interface. Keep it on a trusted local machine, LAN, or private network. Do not expose it to the public internet without adding authentication and TLS, and never commit .env, Codex credentials, tokens, secrets, or workflow state.
Configuration
| Variable | Default | Purpose |
|---|---|---|
HOST | 127.0.0.1 | API/UI bind address. The container sets 0.0.0.0. |
PORT | 4317 | API/UI port. |
CODEX_BINARY | codex | Codex CLI executable path. |
CODEX_LOOP_WORKSPACE | server working directory | Default repository or workspace for Designer inspection and worker runs. |
CODEX_LOOP_MODEL | Codex default | Optional native worker model override. |
CODEX_LOOP_DESIGNER_MODEL | gpt-5.6-sol | Persistent Designer model. |
CODEX_LOOP_SANDBOX | workspace-write | Worker sandbox: read-only, workspace-write, or danger-full-access. |
CODEX_LOOP_PUBLIC_URL | http://127.0.0.1:4317 | Base URL used in generated deep links. |
CODEX_LOOP_MCP_TOKEN | empty | Bearer token required by /mcp when configured. |
CODEX_LOOP_SUPERVISOR_INTERVAL_MS | internal default | Attention-supervisor polling interval. |
CODEX_LOOP_STALL_THRESHOLD_MS | internal default | Age threshold for stalled-work attention. |
Container-only path variables in .env.example map the host Codex home and workspace into the published Compose deployment.
HTTP and MCP surfaces
Important health and integration routes include:
GET /api/health— liveness ({"status":"ok"}).GET /api/version— build version, Git revision, and build timestamp.GET /api/bridge/status— native Codex bridge state.GET /api/task-capabilities— normalized live capability inventory./api/workflows/...— workflow, revision, validation, Designer, run, simulation, thread, attention, and intervention operations.GET|POST /api/triggers/:token— published webhook triggers.POST /mcp— Streamable HTTP MCP endpoint, protected byCODEX_LOOP_MCP_TOKENwhen set.
The repository contains plugins/codex-loop with two skills:
design-loopcreates, clarifies, revises, validates, and explicitly publishes definitions.operate-loopinspects runs and performs only explicitly requested start, pause, resume, stop, or gate actions.
Install that plugin through a local Codex plugin marketplace, configure its MCP URL, and export the same CODEX_LOOP_MCP_TOKEN on both sides. For the home-server deployment, use http://codex-loop.home/mcp.
Local validation
Run the repository checks before committing:
npm test
npm run build
docker build -t codex-loop:local .
docker compose config
For deployment changes, also verify /api/health, /api/version, and scripts/check-latest-release.sh against the live route. A build pass alone does not prove the rendered graph and editor interactions; visually check the affected flow at desktop and mobile sizes.
Release and home-server deployment
Every successful push to main is a release event. .github/workflows/release.yml runs tests and the production build, publishes multi-architecture ghcr.io/mauri3112/codex-loop:latest and immutable v1.0.<run-number> images, and creates the matching GitHub release.
The repository’s docker-compose.yml is the always-current home-server deployment, not the minimal local build path. It joins the external home-server-proxy network and runs a label-scoped Watchtower updater every five minutes. Runtime data, the host Codex home, and the mounted projects workspace survive image replacement.
cp .env.example .env
# Set CODEX_LOOP_MCP_TOKEN to a long random value before using MCP over the LAN.
docker compose pull
docker compose up -d
./scripts/check-latest-release.sh
The LAN route is http://codex-loop.home; version metadata is at http://codex-loop.home/api/version. Caddy routing, LAN DNS, the landing page, and operator documentation belong to the sibling /Users/mauri-home/Documents/projects/home-server-setup repository. Any route, container, network, port, or deployment-procedure change must be kept aligned there.
Repository map
src/components— chat, canvas, editor, run control, history, activity, and intervention UI.src/domain— workflow types, normalization, validation, simulation, context, and model helpers.server— Express API, persistence, Designer, Codex bridge, run coordinator, supervisor, simulation, triggers, and MCP.plugins/codex-loop— packaged Loop design and operation skills.docs— architecture, parity, attention, and intervention notes plus the README demo.scripts— bridge and release/runtime verification helpers.build.md— minimal local Docker build and run instructions for an agent.
Additional documentation
License
Codex Loop is open-source software licensed under the MIT License.
Analysis
View
Metric
- 13
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- CSSIn code
- ExpressIn code
- HTMLIn code
- ReactIn code
- TypeScriptIn code
5 of 5 appear in the indexed code.
AI coding agents
- CodexConfig
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
686 KB
Source files
95
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
mauri3112/codex-loop
112 files · 2.1 MB · @ 97782d6
Structure
Interface
38 files · 34%Screens, components and styles rendered to the user.
API & routing
11 files · 10%Request entry points: routes, handlers and controllers.
Application logic
18 files · 16%Domain rules, services and shared utilities.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- TypeScript75%
- CSS16%
- Markdown8%
- YAML1%
- Shell0%
- HTML0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
package.json
npm · 19- @xyflow/react
- express
- lucide-react
- react
- react-dom
- react-router-dom
- zod
- zustand
- +11 more
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.