import ExcalidrawDiagram from '@/components/ExcalidrawDiagram.astro';

We are in the agentic age of organizational growth.

Last year, Microsoft published the [Work Trend Index Annual Report](https://www.microsoft.com/en-us/worklab/work-trend-index/2025-the-year-the-frontier-firm-is-born), defining "hybrid" teams of humans and agents. I read it and moved on — until I started reflecting on the progress of multi-agent systems like Claude Code and OpenClaw.

Then, on February 5th, Anthropic shipped agent teams in research preview:

<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Claude Code now supports agent teams (in research preview)<br /><br />Instead of a single agent working through a task sequentially, a lead agent can delegate to multiple teammates that work in parallel to research, debug, and build while coordinating with each other.<br /><br />Try it out today by… <a href="https://t.co/vi7lUJDOTi">pic.twitter.com/vi7lUJDOTi</a></p>&mdash; Lydia Hallie ✨ (@lydiahallie) <a href="https://twitter.com/lydiahallie/status/2019469032844587505?ref_src=twsrc%5Etfw">February 5, 2026</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

According to Anthropic's [agent teams](https://code.claude.com/docs/en/agent-teams) docs:

> Coordinate multiple Claude Code instances working together as a team, with shared tasks, inter-agent messaging, and centralized management.

We went from one AI agent at a time to multi-agent systems. The shift is agentic orchestration.

One unlock is [OpenClaw](/posts/openclaw). It adds a gateway layer around agent runtimes. In OpenClaw, heartbeats are Markdown files and cron jobs are JSON files.

Git worktrees are used by OpenAI Codex in the Codex macOS app, but the cron-like automation idea is similar to what I covered in [agentic automation](/posts/agentic-automation).

OpenClaw still sets up one agent by default. To go further, you need an orchestrator. That is where `antfarm` by Ryan Carson comes in:

<blockquote class="twitter-tweet"><p lang="en" dir="ltr">If you're using <a href="https://twitter.com/openclaw?ref_src=twsrc%5Etfw">@openclaw</a> this will be a big unlock.<br /><br />Antfarm is a batteries-included agent team that operates reliably and deterministically.<br /><br />Works with OpenClaw using just crons, YAML and SQLite.<br /><br />It auto-runs Ralph loops after creating atomic user stories.<br /><br />I open sourced it… <a href="https://t.co/g6a1N0jwel">https://t.co/g6a1N0jwel</a></p>&mdash; Ryan Carson (@ryancarson) <a href="https://twitter.com/ryancarson/status/2020943085426049213?ref_src=twsrc%5Etfw">February 9, 2026</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

When you spin up your first antfarm, you get six agents:

![](/images/antfarm-wide.png)

Now we are getting closer to a real team.

## How Antfarm Works

Antfarm combines cron jobs, YAML, and SQLite. The execution step is built around the "Ralph Wiggum Loop" — named after the simpleton character from The Simpsons.

Ralph is an autonomous coding loop. It shares the same workflow as a human developer: consult a task list, implement, run tests, commit, mark complete, log what it learned, pick the next task.

Ralph picks one story and executes it:

```js
export type Story = {
  id: string;
  runId: string;
  storyIndex: number;
  storyId: string;
  title: string;
  description: string;
  acceptanceCriteria: string[];
  status: "pending" | "running" | "done" | "failed";
  output?: string;
  retryCount: number;
  maxRetries: number;
};
```

https://github.com/snarktank/antfarm/blob/bbd6debda1f6b76ca178db923d2478357d810baf/src/installer/types.ts#L61C1-L73C3

The workflow in practice: a human says "I want to build this feature." A specialized agent interviews the human for specifics. Another agent turns those notes into a prioritized task list. Coding agents implement the work. Category experts verify it.

Spec-driven development handles the planning layer.

Think of it as humans plus RPG agents:

![](https://pbs.twimg.com/media/HBIq5B9bQAAOJj-?format=jpg&name=medium)

![](https://pbs.twimg.com/media/HA1YMJrbQAAiSOJ?format=jpg&name=medium)

![](https://pbs.twimg.com/media/HA1YMJlWQAAuss2?format=jpg&name=medium)

According to [antfarm.cool](https://www.antfarm.cool):

> Built on the Ralph loop. Each agent runs in a fresh session with clean context. Memory persists through git history and progress files — the same autonomous loop pattern from Ralph, scaled to multi-agent workflows.

Microsoft recognized early that too many agents creates its own problem:

<img
  class="microsoft-agents-light"
  src="/images/microsoft-agents.jpg"
  alt="Microsoft agents chart light"
/>
<img
  class="microsoft-agents-dark"
  src="https://assets-c4akfrf5b4d3f4b7.z01.azurefd.net/assets/2025/04/MSFT_WTIAPR2025_Chart5_HumanAgent@2x_68088c83aec2d-scaled.webp"
  alt="Microsoft agents chart dark"
/>

## High-Level Architecture

<ExcalidrawDiagram
  diagram={`flowchart LR
    User -->|CLI Command| AntfarmCLI
    AntfarmCLI -->|Creates Run| SQLiteDB[(SQLite DB)]
    AntfarmCLI -->|Spawns/Configures| Agents

    Agents -->|Poll for Work| SQLiteDB
    Agents -->|Read/Write| Workspace[Git Workspace]
    Agents -->|Update Step Status| SQLiteDB

    Cron -->|Triggers Polling| Agents

    Dashboard -->|Reads State| SQLiteDB`}
  theme="auto"
/>

## Agent Lifecycle (Ralph Loop Model)

<ExcalidrawDiagram
  diagram={`sequenceDiagram
    participant Agent
    participant SQLite
    participant Workspace

    Agent->>SQLite: Poll for available step
    SQLite-->>Agent: Step claimed
    Agent->>Workspace: Read code + progress files
    Agent->>Workspace: Make changes
    Agent->>SQLite: Update status (done / retry / fail)`}
  theme="auto"
/>

## Multi-Agent Story Isolation (feature-dev example)

<ExcalidrawDiagram
  diagram={`flowchart TD
    Planner -->|Decomposes Feature| Story1
    Planner --> Story2
    Planner --> Story3

    subgraph Story 1
        Dev1[Developer]
        Ver1[Verifier]
        Test1[Tester]
        Dev1 --> Ver1 --> Test1
    end

    subgraph Story 2
        Dev2[Developer]
        Ver2[Verifier]
        Test2[Tester]
        Dev2 --> Ver2 --> Test2
    end

    Story1 --> Dev1
    Story2 --> Dev2`}
  theme="auto"
/>

## Custom Workflow Definition (YAML to Runtime)

<ExcalidrawDiagram
  diagram={`flowchart TD
    YAML[workflow.yml]
    CLI[Antfarm CLI]
    DB[(SQLite Run State)]
    Agents

    YAML --> CLI
    CLI -->|Parse Steps + Agents| DB
    Agents -->|Execute According to DB| DB
`}
  theme="auto"
/>

## End-to-End Example Run

<ExcalidrawDiagram
  diagram={`sequenceDiagram
    participant User
    participant CLI
    participant Planner
    participant Developer
    participant Verifier
    participant Tester
    participant Reviewer

    User->>CLI: Run feature-dev "Add OAuth"
    CLI->>Planner: plan
    Planner-->>CLI: stories

    CLI->>Developer: implement story 1
    Developer->>Verifier: verify
    Verifier->>Tester: test

    CLI->>Reviewer: review PR
    Reviewer-->>User: Final PR Ready`}
  theme="auto"
/>

Instead of one big agent doing everything, antfarm becomes a deterministic assembly line of specialized agents.

## Claude Agent Teams, Taught Incrementally

One way to understand Anthropic's agent teams is to contrast them against subagents:

![](https://mintcdn.com/claude-code/nsvRFSDNfpSU5nT7/images/subagents-vs-agent-teams-light.png?w=2500&fit=max&auto=format&n=nsvRFSDNfpSU5nT7&q=85&s=e402533fc9e8b5e8d26a835cc4aa1742)

### Step 1: One agent, one thread

Start simple: one agent handles everything in sequence.

<ExcalidrawDiagram
  diagram={`flowchart LR
    User --> Agent
    Agent --> Codebase
    Agent --> Result`}
  theme="auto"
/>

### Step 2: Add a lead and specialists

The lead delegates. Teammates run in parallel.

<ExcalidrawDiagram
  diagram={`flowchart TD
    User --> Lead
    Lead --> T1[Researcher]
    Lead --> T2[Builder]
    Lead --> T3[Reviewer]`}
  theme="auto"
/>

### Step 3: Share tasks and messages

Agent teams add a shared task list and direct teammate messaging.

<ExcalidrawDiagram
  diagram={`flowchart TD
    Lead --> Tasks[(Shared Task List)]
    T1[Researcher] --> Tasks
    T2[Builder] --> Tasks
    T3[Reviewer] --> Tasks
    T1 <--> Mailbox[(Mailbox)]
    T2 <--> Mailbox
    T3 <--> Mailbox
    Lead <--> Mailbox`}
  theme="auto"
/>

### Step 4: Run the claim-and-complete loop

Each teammate claims unblocked work, executes, and updates status.

<ExcalidrawDiagram
  diagram={`sequenceDiagram
    participant Teammate
    participant Tasks as Shared Task List
    participant Repo as Codebase
    Teammate->>Tasks: claim next unblocked task
    Tasks-->>Teammate: task assigned
    Teammate->>Repo: implement and test
    Teammate->>Tasks: mark completed or blocked
    Teammate->>Lead: send findings`}
  theme="auto"
/>

### Step 5: Add quality gates and cleanup

Hooks enforce standards before tasks close; the lead shuts down the team.

<ExcalidrawDiagram
  diagram={`flowchart LR
    Teammate --> Done[Task marked complete]
    Done --> Hook1[TaskCompleted hook]
    Teammate --> Idle[Teammate idle]
    Idle --> Hook2[TeammateIdle hook]
    Hook1 --> Lead
    Hook2 --> Lead
    Lead --> Cleanup[Clean up team resources]`}
  theme="auto"
/>

This is the shift: from one big agent to a coordinated team with explicit roles, shared state, and controlled handoffs.

### Step 6: Gate the feature explicitly

Agent teams stay opt-in behind an environment flag.

<ExcalidrawDiagram
  diagram={`flowchart LR
    Start[Claude Code start] --> Check{CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1}
    Check -->|No| Single[Run single-agent flow]
    Check -->|Yes| Team[Enable agent teams]`}
  theme="auto"
/>

### Step 7: Use local team state files

Coordination runs through local frontmatter state files, not hidden magic.

<ExcalidrawDiagram
  diagram={`flowchart TD
    State[.claude/multi-agent-swarm.local.md] --> Parse[Hook parses frontmatter]
    Parse --> Enabled{enabled true}
    Enabled -->|No| Exit[Exit fast]
    Enabled -->|Yes| Fields[Read agent_name task_number dependencies coordinator_session]
    Fields --> Action[Run coordination action]`}
  theme="auto"
/>

### Step 8: Notify the lead through tmux

Idle teammates report back through a coordinator session.

<ExcalidrawDiagram
  diagram={`sequenceDiagram
    participant Mate as Teammate
    participant Hook as agent-stop-notification.sh
    participant State as Local state file
    participant Tmux as tmux session
    participant Lead
    Mate->>Hook: teammate becomes idle
    Hook->>State: read enabled and coordinator_session
    Hook->>Tmux: send-keys notification
    Tmux->>Lead: deliver teammate status`}
  theme="auto"
/>

### Step 9: Launch swarm from interactive command

The command gathers constraints first, then writes shared tasks.

<ExcalidrawDiagram
  diagram={`flowchart TD
    User --> Cmd[launch multi-agent swarm]
    Cmd --> Q1[Ask agent count]
    Cmd --> Q2[Ask coordination mode]
    Cmd --> Q3[Ask dependencies and base branch]
    Q1 --> TasksFile[Write .daisy/swarm/tasks.md]
    Q2 --> TasksFile
    Q3 --> TasksFile
    TasksFile --> StartTeam[Start team with structured tasks]`}
  theme="auto"
/>

The practical model: explicit flag, explicit files, explicit hooks, explicit task generation.