HOW IT WORKS

How Alfred works.

One run, from the timer that starts it to the Slack message at the end. Nothing running in the cloud, no service to sign up for.

THE SEVEN STEPS

Seven steps, every time.

Every Alfred agent follows the same seven steps. If any step fails, the run stops cleanly and posts a note to Slack.

  1. 01

    A timer starts the run

    A built-in scheduler (launchd on macOS, systemd on Linux) starts each agent on its configured cadence. Lucius checks for implementation work every 20 minutes by default, and the fleet keeps running across reboots.

    [12:00:00] launchd → ~/.alfred/bin/lucius.py
  2. 02

    Safety checks run first

    Before any paid call, the agent checks that GitHub and the Claude Code or Codex command line are signed in, that you are under your spending limit, and that you are not rate-limited. If any check fails, the run stops cleanly.

    [12:00:01] preflight ok  spend=$3.21/$20.00
  3. 03

    It picks up a task

    Lucius looks at the open tasks marked agent:implement, takes the oldest one, and marks it agent:in-flight. Other agents see that label and leave it alone.

    [12:00:03] lucius claimed your-backend#247  label=agent:in-flight
  4. 04

    It makes its own copy of the repo

    A fresh copy of the repo opens in its own folder under ~/.alfred. Each run gets its own copy, so runs can happen at the same time and a crash never affects your working files.

    [12:00:05] worktree ~/.alfred/wt/12000305/  branch=agent/247-billing-v2
  5. 05

    Claude Code or Codex writes the code

    The agent hands the task to Claude Code or Codex on the command line, with the full project in context. Everything it does is saved to a log file on your machine.

    [12:00:06] claude_invoke pid=84217  log=state/logs/12000305.log
  6. 06

    It opens a pull request

    When the work is done, the agent pushes the branch and opens a pull request on GitHub. The task's label changes from agent:in-flight to agent:pr-open.

    [12:18:09] gh pr create  PR #1247  label=agent:pr-open
  7. 07

    It tells you on Slack

    The agent posts a short summary to your Slack: what it did, what it opened, what failed, and what it cost. Anything that needs your attention is easy to spot.

    [12:18:11] slack_post severity=info  PR #1247 opened
HOW AGENTS STAY OUT OF EACH OTHER'S WAY

GitHub labels track every task.

Agents coordinate through GitHub labels, not a database. The label on a task tells every agent what is happening and who is on it, so two agents never grab the same work.

agent:implement

You or Drake add this. It tells Lucius the task is small enough and clear enough to pick up.

agent:in-flight

Lucius adds this when it takes the task. Other agents see it and skip the task.

agent:pr-open

Added when the agent opens a pull request. Ra's al Ghul watches for this label to start a review.

agent:done

Added when the pull request merges. The task is finished and drops out of the active list.

agent:needs-changes

Ra's al Ghul adds this when a review asks for changes. Lucius picks it back up on its next run.

TRY IT ON YOUR MACHINE

Do a test run before you spend anything.

A test run walks through every step above without calling Claude or Codex, so nothing is spent. Run it once on every new setup.

terminal copy
$ alfred dry-run lucius
alfred dry-run: lucius
role: feature dev
mode: safe simulation
would: resolve config, acquire the agent lock, run preflight, and enter the runner
would not: call the host scheduler, mutate GitHub, post Slack, invoke an LLM, or edit files