Moirai: Orchestrating Thin LLM Agents Without the Bespoke Wiring
How two nightly LLM agents became Moirai — a reusable orchestrator now running three fate-named agents (Clotho, Lachesis, Atropos), one of which is trusted to actually close things.
The first time you wire an LLM agent into a CI pipeline, it's a workflow file. The second time it's a workflow file, a config and a prompt: almost the same shape as the first, copied and tweaked. By the fifth you have five slightly different setups, none better than the others, and changing an agent's behaviour means editing five places.
That's roughly where I was last week. I had two agents living inside monospace.studio: Curator, a nightly scanner that files GitHub issues for cleanup candidates, and Auditor, a PR reviewer that writes coherence problems into my session inbox. Both worked, and neither was reusable. Prompts, config, workflow wiring and secrets were all tangled up with this one repo.
So I pulled them out, and built the thing that lets them plug back in.
What Moirai is
Moirai is named for the Greek fates: Clotho spins the thread, Lachesis measures it, Atropos cuts it. It's an orchestrator for thin LLM agents, the glue rather than the host, and it keeps three layers apart:
| Layer | What it is | Examples |
|---|---|---|
| Agent repo | One agent, one purpose. AGENT.md (persona), PROMPT.md (instructions), schema.json (config shape), defaults.yml (sane defaults). No workflows, no config values, no host-specific wiring. | derrybirkett/clotho, derrybirkett/lachesis, derrybirkett/atropos |
| Moirai | Registry, protocol spec, host adapters, installer. The substrate that lets thin agents work the same way everywhere. | derrybirkett/moirai |
| Consuming repo | Submodules Moirai. Per agent, has .github/agents/<name>/config.yml (validated against the agent's schema) + a workflow per trigger. | monospace.studio, future adopters |
Each agent is independent and versioned, and a consuming repo mounts only the ones it needs. When an agent gets better (a sharper prompt, better scope detection, smarter dedup), every repo using it picks that up with one submodule bump.
The agent definition is the part that improves over time. Per-repo tuning stays local and disposable.
Installing an agent
In the consuming repo:
git submodule add https://github.com/derrybirkett/moirai .moirai
.moirai/bin/install lachesis
That one install command:
- Reads Moirai's
registry.ymlto find the agent and its pinned tag. - Submodules the agent at that tag under
.agents/lachesis/. - Scaffolds
.github/agents/lachesis/config.ymlfrom the agent'sdefaults.yml(the consumer overrides; unset fields fall back). - Renders
.github/workflows/lachesis.ymlfrom the chosen adapter's template, with permissions and tool access derived from the declared sink.
Edit the config, commit four files, push, and the agent runs on its trigger.
The walking skeleton
I built Moirai bottom-up. Writing the spec first risks designing a protocol for problems you don't have yet. So I extracted one agent end to end, built the thinnest orchestrator around it, and only then wrote the spec.
Step 1: Curator. I lifted it out of a submodule into its own repo, changed the prompt to read its config from $AGENT_CONFIG_PATH (injected by the host) instead of a hard-coded path, and replaced the literal config.yml with defaults.yml plus a JSON Schema. Two days ago, that was Moirai v0.1.0.
Step 2: the orchestrator. protocol/SPEC.md, registry.yml, the bash installer, and a GitHub Actions adapter with a parameterised workflow template.
Step 3: consume it. I refactored monospace.studio to install Curator through Moirai, the first real test of the installer. It found a bug straight away: git refuses a submodule nested inside another submodule.
fatal: Pathspec .moirai/agents/curator is in submodule .moirai
The fix was to put agents at .agents/<name>/, next to .moirai/ rather than inside it. Curator filed five real issues that night.
Step 4: the real test. Auditor was the second agent, and the test of whether a protocol written around Curator could take a different shape. Auditor triggers on pull_request, not schedule. It writes to an inbox sink (a markdown file the host commits back), not issues. And it needs extra environment variables: PR_NUMBER, PR_BASE_SHA, PR_HEAD_SHA.
The protocol mostly held. What it needed (conditional template blocks, the inbox commit-back contract and a fork-safety skip) shipped as Moirai v0.2.0 without touching Curator's path. Auditor ran on its own PR, and auditor-bot pushed the audit block back. Two agents with very different shapes, validated end to end.
That's the whole method: build the thinnest version that works, extract the next thing, and let the friction tell you what to fix.
From two agents to three fates
Curator and Auditor didn't last. On 2026-06-05, a week and a half after the skeleton proved out, I retired both and folded them into Lachesis, one of the fates the system was named after in the first place. One PR did it:
feat: Moirai Fate transition — install clotho + lachesis, retire curator + auditor (#124)
The reason wasn't cosmetic. Curator's scans (dead exports, oversized files, component drift) and Auditor's checks (link integrity, orphans, copy drift) were the same job underneath: read the repo at HEAD, score what exists, file an issue for what falls short. Two agents, two config schemas and two workflows, for one job.
Lachesis does it with three dimensions: quality (Curator's turf), coherence (Auditor's) and a new coverage dimension for thin entries and missing required fields. A fourth, stale_branches, came later: Lachesis flags cold branches, and Atropos deletes them once the grace window clears.
Clotho is genuinely new. She holds a line Lachesis doesn't: absence, not adequacy. A nextCase: "payfit" pointing at a payfit.mdx that was never written is Clotho's gap. The same file existing with an empty outcome field is Lachesis's thin entry. Once an artifact exists, even as an empty stub, it moves from Clotho to Lachesis.
So the roster settled into the three fates the name was always pointing at. Clotho names what's missing, Lachesis scores what exists, and Atropos closes what's gone stale. Curator and Auditor stay in the registry marked retired: true, for provenance.
What the protocol guarantees
Installing an agent through Moirai also gets you a few guarantees.
Typed sinks. Every agent declares where it writes (issues, inbox, summary or pr-comment), and the installer derives the GitHub Actions permissions from that. Clotho and Lachesis get issues: write, which is observe trust: file and score. Atropos gets that plus the extra reach an act-trust agent needs to close, warn and delete. The consuming repo doesn't have to think about it.
One envelope. Every agent gets the same environment variables: AGENT_NAME, AGENT_CONFIG_PATH, AGENT_REPO_DIR and TODAY, plus PR_NUMBER, PR_BASE_SHA and PR_HEAD_SHA for PR-triggered ones. Agents read config from wherever the host says and never assume a location.
Stable issue titles. A future meta-agent (call it Conductor) could read across [clotho] <category>: and [lachesis] <dimension>: titles and propose action that cuts across both. The agents don't need to know about each other.
One-command install, pinned versions. Adding an agent to the catalogue means pinning it in registry.yml. Adopting it means bin/install <name>. Agents and Moirai are both tagged, consumers pin specific tags, and changes only arrive when you bump a submodule.
What it doesn't do
- Write the agents. Each agent is its own repo with its own prompt, scope and schema. Its quality is its own problem.
- Run on anything but Claude, yet. There's one adapter: Claude Code via
anthropics/claude-code-action@v1on GitHub Actions. An OpenAI Assistants adapter or a local CLI runner could slot in without changing any agent, but I haven't built one. - Read across agents. The protocol leaves room for a meta-agent (typed sinks, stable titles), but nothing reads across sinks today.
Atropos, for real
When this post first went up, Atropos was only a name. Her workflow existed and reported green every night. It just wasn't doing anything.
The green was a lie. The Claude SDK call inside the workflow failed immediately (is_error: true, an auth problem with the API key), and the action swallowed the error and exited 0. Success, with zero work done, night after night. I parked it rather than debug in a hurry.
The fix turned out simpler than buying credits: swap ANTHROPIC_API_KEY for a Claude Code OAuth token (claude setup-token, the same mechanism the other fates already used) and pass it as claude_code_oauth_token. Atropos started running.
She's a different kind of agent. Clotho and Lachesis observe: they file and score, and never touch state. Atropos is the only fate with act trust:
- Stale issues: she warns after
stale_issue_daysof inactivity and closes after a further grace period if nothing changes. One warning per window, never a repeat. - Stale PRs: she warns but never closes. Humans close PRs.
- Stale branches: she deletes branches Lachesis has already flagged as cold, once the grace window clears. She never prunes on her own initiative.
- Inbox archival: opt-in, moving completed items to an archive section.
Her first real output landed on 2026-07-08, on issue #153 ("Lachesis PR-diff mode (v0.3.0) — optional"): a warning after 30 days of inactivity, and an atropos:stale label.
👋 This issue has been inactive for 30 days. It will be closed in 14 days if there is no further activity.
To keep it open: remove the
atropos:stalelabel or addatropos:keep.Filed by atropos · 2026-07-08
Nobody touched it. Fourteen days later, exactly on schedule, she closed it.
Closing due to inactivity (44 days). If this is still relevant, reopen and add
atropos:keepto prevent future auto-closure.Filed by atropos · 2026-07-22
Small, boring, and exactly the job. The atropos:keep exemption works too, though this issue didn't need it. Elsewhere it sits next to labels from the repo's other automations:

When it's worth it
Moirai assumes three things: you're shipping LLM automation across several repos, you'd rather split a workflow into thin specialised agents than build one agent that does everything, and you'll accept a small protocol spec to stop maintaining five bespoke workflow files.
With one repo and one agent, it's overhead. With five repos that all want the same scanner, or one repo running all three fates plus a Conductor reading their output, it pays for itself. Every new repo and every new agent adds to that: install three agents in 30 seconds, or improve Lachesis's rubric once and every repo gets it on the next bump.
What's next
Moirai has been public from day one at github.com/derrybirkett/moirai, and is well past its original v0.2.0 tag. The three registered agents are clotho, lachesis and atropos.
Next on the list:
- Stories, the layer above a single agent. Today each agent is one workflow file. A story would bundle several agents under one trigger with a shared budget and termination policy ("nightshift" as one file instead of three). It's sketched in Moirai's roadmap, not built.
- A second consumer. Installing Moirai in one of the standalone repos in my Delta Suite, because the second consumer is where the real bugs surface.
- A meta-agent that reads across the
issuesandinboxsinks and proposes cross-cutting action. It's also why Stories comes first: a meta-agent needs somewhere to be declared.
So far, every new agent has bent the protocol a little. That's the point of building it bottom-up.