# Working with agents

An agent writes your game's files; you see the result running and judge it. In the editor
an agent's change is **on trial** until you keep it, and you judge it by playing it beside
the game as it was.

![A change on trial: the game before and after on the two sides of a divider, with Keep and Not this one, and the conversation beside it](../files/editor/img/agents-trial.jpg)

## Before you start

The editor does not contain an agent. It runs a coding agent's command-line tool that you
installed and signed in to yourself, such as Claude Code or Codex; see
[agents and your game](../agents/harnesses.md). With none set up, the editor says **No
coding agent is set up** and offers **Set one up…**.

## Ask for a change

1. Optional: pick a thing in the game and press **Talk about it**. The thing, and the
   moment of a paused game, are added to your message as tags that carry their data.
2. Write what should change in the field at the right, **Say what should change**.
3. Choose how much it may do, beside the field: **Asks first**, **Plans only** (*Reads the
   game and plans. Changes nothing.*) or **Never asks**.
4. Send.

**How you know it worked.** The head of the conversation says **Working** and for how
long, then **Done**. On the timeline the agent has a lane with a mark at each change, and
in the picture its name stands on the thing it is working on.

Whatever the mode, a change to the game's files waits for your **Keep**.

## A change on trial

The change is already running: what you see and play is the game *with* it.

1. Play it.
2. Press **Compare**. The game as you kept it and the game with the change replay the
   same input side by side; drag the divider. Before is on the left, after on the right.
3. Read the test's line: **The run passes with the change on trial**, or **With the change
   on trial the run differs at step N**, with the value and the line that wrote it.
4. Press **Keep** or **Not this one**. The list of changes lets you decide file by file.

**How you know it worked.** After **Keep**, nothing is on trial and the game is the one
later changes are tried against. After **Not this one**, the files are as they were and
the game runs the old way. Both are steps of [undo](scene.md#undo-and-redo).

Your own saves in the editor are kept as you make them; only changes from elsewhere wait.

## Read what a turn did

1. When a turn ends, look under its last line: the steps it took, how long, and the moment
   of the game its change first shows at, for example *room1, playable from 0:06.4*.
2. Press **Play from** to go to that moment and play on.

**How you know it worked.** The game plays from where the change shows. **Undo** on the
turn takes back everything it changed, as one step, while nothing of it has been decided.

## Let an agent see the game

A new game comes with the engine's MCP server set up for agents, turned off.

1. Open **Agents › External MCP Servers** and turn it on.

**How you know it worked.** The agent can read the world, step the game, take pictures and
run the tests: the same protocol the editor uses, covered in
[For AI agents](../agents/index.md). **Party**, in the left column, lists everyone on the
game with what each last wrote, and the Inspector says **Changed by** whom on a thing.

## Several agents at once

![Three agents each in a copy of the game: the Copies group in Party with each copy's test and its buttons, one change landed with the stages of its test, and the Landing log in the dock](../files/editor/img/agents-copies.jpg)

Where the engine makes copies, each agent can work in its own copy of the game, and
nothing reaches your game until you land it.

1. Start a conversation and choose **In its own copy** under **Where it works**.
2. Watch **Copies** in **Party**: each row says the step it plays at, whose it is, what it
   changed, what the agent said it would change, and its last test.
3. Press **Test** on a copy, then **Land**.

**How you know it worked.** The **Landing** tab of the dock has a row for the change with
the stages of its test, ending **Landed**. A change lands only if the game differs **only
where the agent said it would**; one that fails is **Held**, and the row says at which
step, thing and value. Nothing lands by itself.

- **Undo** on the last landing takes it back: every file it wrote is as it was.
  [Undo an agent's change](../guides/undo-landing.md) covers the rest.
- **Rebase** puts a copy on top of what has landed since. **Park** and **Wake** set one
  aside and bring it back. **Hand over** gives it to another conversation. **Drop** lets
  it go.
- When two copies wait, the **Two hands** card tests them alone and together and offers
  to land one and build the other on it, to send one back, or **Hold both and look**.

## Good habits

- **Record a run first.** The test is what lets the editor say "the run still passes" of
  an agent's change.
- **Decide soon.** A change on trial stays on trial, and the next agent works on top of it.
- **Use Plans only to look.** The engine refuses every write from a planning agent.
