← All posts

How to save a multi-agent setup so you're not rebuilding it every time

The first time you build a Watcher that hands work to an Addresser, or an Engineer paired with a Reviewer, you're wiring together workspaces, agents, and hand-off prompts by hand — deciding who gets their own worktree, writing each prompt, connecting them so one knows to message the other. It works. It also took an afternoon.

Do it again for a second repo, or a different pair of roles, and you're not saving any of that afternoon back. You're rebuilding the same shape from nothing, with a quiet risk attached: the second build drifts from the first in some small way neither of you notices until it matters.

A Strategy is what you build instead of rebuilding: a named, reusable definition of a set of roles, saved once in the Strategies view rather than assembled by hand inside a live workspace. Each role carries a name, a description, a trigger — react to new messages, keep nudging regardless, or go find its own work on a schedule — a poll interval, and a prompt template. Write it once, and it stops being something you remember how to rebuild.

One thing still has to be decided per role, and it's the same judgment call whether you're hand-wiring a pair or defining a Strategy: does this role need a place of its own. A role scoped `root` attaches straight onto wherever the Strategy gets instantiated — right for a scheduled Watcher with nothing of its own to hold onto. A role scoped `own` gets a dedicated child workspace, its own worktree and thread history — right for an Engineer that needs to keep its changes separate from whatever its Reviewer is checking.

Roles also need to talk about each other before either of them exists yet. A prompt template can reference a sibling role by name with `{{ROLE:<name>}}`, or the strategy's own root workspace with `{{ROOT_WORKSPACE}}` — both resolve to the real, bound workspace slugs the moment the Strategy is instantiated, even though you wrote the prompt long before any of those workspaces were created.

DF Code ships with two Strategies already filled in — Watcher/Addresser and Engineer/Reviewer — pulled directly from real hand-built pairs, meant to be forked rather than started from a blank list of roles. Pick one, give the instantiation a root workspace, and hit Instantiate: every workspace and every agent gets created in a single pass, and you land straight in the new root workspace, already wired end to end.

The pattern you spent an afternoon discovering the first time becomes something you can hand to a new repo in the time it takes to click a button. That's the difference between building a thing once and building it well enough to mean it every time after.