Moadim: Open Source Loop Engine for AI Agents

Moadim is an open-source loop engine designed to automate the execution of AI agents on a recurring schedule. By pairing a prompt, a schedule, and a specific agent, Moadim enables "loop engineering"—the practice of moving beyond manual prompting to create autonomous, repeating workflows that act on repositories and tasks.

Local Scheduling and Execution

Moadim operates as a local daemon that manages agent execution without relying on cloud queues or host cron daemons. It uses a portable in-process scheduler to dispatch loops and launches each agent instance within a tmux session to ensure process isolation.

System Integration and Persistence

To ensure the daemon survives system reboots and user logins, Moadim provides an installation command (moadim install) that registers the service with launchd on macOS or systemd on Linux. The tool is written in Rust and can be installed via cargo install --locked moadim, cargo binstall moadim, or npm install -g moadim.

Isolation and Reliability

Each "tick" of a scheduled loop launches the agent in a fresh, isolated workbench. To prevent resource leaks or stalled processes, Moadim employs a watchdog timer that kills hung runs and reaps the session immediately upon completion. This architecture ensures that state does not leak from one execution run to the next.

Supported Agents and Interfaces

Moadim supports several built-in agents, including Claude, Codex, Hermes, NanoClaw, and Pi. While most agents run in the isolated workbench, NanoClaw is handled by queuing a one-shot task in a configured agent group. The Claude agent specifically requires python3 to be present on the system PATH to handle MCP-approval states and unattended trust.

Management Interfaces

Users can interact with and manage their loops through three primary interfaces:

  • REST API: Every loop is a documented HTTP endpoint with a built-in OpenAPI schema and Swagger UI.
  • Model Context Protocol (MCP): Loops are available as MCP tools, allowing MCP-compatible agents to list and trigger routines via the /mcp endpoint.
  • Web UI: The daemon includes a built-in web interface and an iCal feed for monitoring.

Community Perspectives on Loop Engineering

While Moadim provides the infrastructure for scheduling, the broader discussion around "loop engineering" suggests a shift in how AI agents are utilized. Some users argue that the true value of loop engineering lies in the definition of skills and workflows triggered by specific events, such as the creation of a incident ticket, rather than simple time-based scheduling.

Other technical concerns raised by the community include the potential for uncontrolled token consumption if the "done" state of a loop is not deterministic, as well as the simplicity of achieving similar results using standard system tools like crontab for basic shell-based agent calls.

"I monitor this thread via moadim.io, I have a routine that ping this page every 10 minutes and ping me on discord for every message that I didn’t responded to yet"

— Author of Moadim (@tupe12334)

Sources

Related

  • Project
  • Dispatch
  • Project
  • Dispatch
  • Project