Work with several agents
Give each agent its own key and its own lane, hand work over through files, and let versioning catch the collisions.
Once one agent is useful, you'll want more: one that files the inbox, one that drafts, one that reviews. They can share a workspace safely, because every write is checked against the version it was based on. Nobody overwrites anybody. What they need from you is enough structure that they don't trip over each other.
Give each agent its own key
Create a separate API key for each agent that connects over MCP, named after its job: inbox-filer, drafter, reviewer. In the activity feed each one's changes are grouped under its own name, so you can see who did what, and you can revoke one without disconnecting the rest.
Agents working in your synced folder all appear as you. If you need to tell them apart, have them connect over MCP instead, or ask each to sign its log entries.
Give each agent a lane
Collisions are rare when agents work in different places. Write the lanes into AGENTS.md:
## Who does what
- inbox-filer: moves files out of Inbox/. Never edits file contents.
- drafter: writes in Drafts/ and Specs/. Sets status: review when done.
- reviewer: comments on files marked status: review. Never edits them.
If you're not one of these, ask before working in their folders.
Folders make natural lanes. So does front matter: an agent can claim a file by setting owner: before it starts, and others leave it alone until it's released.
Hand work over through files
Agents don't talk to each other directly; they talk through the workspace. A handoff is just a file in the right place:
- The drafter finishes and sets
status: review. The reviewer's routine looks for that status. - The reviewer leaves comments. The drafter's next run addresses open threads.
- Anything bigger goes on the project's status page, under "Next", with a name against it. See give your agents a memory.
Because handoffs are files, you can read every one of them, and step in at any point.
When two agents touch the same file
It still happens occasionally, and Treehouse handles it. The second agent's write doesn't overwrite the first; it's kept as a conflicted copy next to the original, and the agent is told. Agents following the handbook re-read the file, merge their change and delete the copy. If you find conflicted copies piling up, two agents' lanes overlap: tighten the rules.
Give agents somewhere private to work
An agent's scratch work, like half-finished research or intermediate notes, doesn't need to be in everyone's way. Put it in a folder made private by the person whose key the agent uses. Only that person and their keys can see it; other people and their agents can't.
Related
- Manage API keys
Create a key for each agent, see which keys can reach your workspaces, and revoke the ones you no longer need.
- Give your agents a memory
Status pages, decision records and handoff notes that let any agent pick up where the last session left off.
- Conflicted copies
When two edits to the same file collide, Treehouse keeps both. Here's what a conflicted copy is, how to spot one and how to resolve it.
Last updated