One file, you and your agents
How you in the app and Claude Code can change the same file at once: one lock, patch-style edits, and a revision history that says who changed what.
Arya Nugroho
Staff Editorial
Open a design in Wonderblok, ask Claude Code to redraw a screen, and keep working while it does. Now two writers are changing one file, and neither knows when the other will save. The problem is not that both want to write. It is what the file does when they write at nearly the same moment.
A note on scope before the mechanics. Today the writers are you in the app and your agents, on one computer, because a Wonderblok file lives on one device. Real-time editing with other people is not built yet, and Team is still coming soon. What follows is what we have, which is narrower than the title might suggest and, we think, worth knowing precisely.
Every write takes the same road
Your edits in the app and an agent's edits over MCP go through the same function. Each agent connects through its own copy of the MCP server, and the app is a separate process again, so the file on disk is the one thing they share. A write does this, in order:
- Take an exclusive lock on a small file that sits next to the design file.
- Read the design file from disk, as it is at that moment.
- Apply the edit. If it fails, stop here and write nothing.
- Write the result to a temporary file and rename it over the original.
Because the lock is held from the read to the rename, two writers take turns instead of overwriting each other, and anyone reading the file sees either the old version or the new one, never half of a save. We test this by starting eight writers at once, each adding a layer to the same frame. All eight layers are there afterwards. It is also why our guide tells agents never to write the file directly: a direct write skips the lock and can race with the app.
Patches, not snapshots
The lock would not be enough if each writer sent back the whole layer it had read earlier. Then the second save would quietly undo the first. Edits here are patches. When you change a button's fill in the Inspector, the app sends the fill. When your agent changes the same button's label, it sends the label. Each patch is applied to the layer as it is on disk when the lock is taken, so both changes survive, in either order.
You may see this described as per-property merge. For different properties that describes the result, but the mechanism is closer to taking turns than to merging. If you and an agent change the same property of the same layer, the one that saves last wins. There is no screen for choosing between the two versions. We have designed one, and it is not connected to anything yet.
Different properties of one layer both land. The same property is last write wins.
Knowing who changed what
Every save that changes the file adds one to its revision. Next to the file, Wonderblok keeps a short history: the revision, who made the change (you, or the agent's name from its MCP handshake) and which top-level layers it touched. The last 200 changes are kept.
That history is how an agent finds out about you. After you have edited, an agent can be told. If its very next call is a write, the reply carries a warning naming the frames you changed. If it is get_view, the reply reports how many edits you made since its last call. Three limits are worth saying out loud. The notice is given once, and only to that next call. The warning arrives with the reply to a write that has already been saved, so it is a prompt to look, not a gate. And agents hear about your edits, not about each other's.
// In the reply to an agent's writethe person changed 01 Welcome in Wonderblok (revision 4) since your last call; read it before writing over it
When an agent needs the stricter version, apply_ops takes an if_revision: the revision it last read. If the file has moved on, the batch is refused, and the refusal lists what changed and who changed it.
// apply_ops with if_revision: 3, when the file is at 5 (names are examples)the file changed since revision 3, it is at 5 (4: 01 Welcome by the person in Wonderblok; 5: 02 Pricing by Claude Code); read it again before writing
Undo covers everyone
The app records every version of an open file, whoever wrote it, so undo also reverts an agent's work. An apply_ops batch is one undo step. The one case where undo refuses is the interesting one: if an agent has saved something the app has not recorded yet, undo stops with a message that the file just changed on disk, and leaves the agent's edit in place. A test covers exactly that, because the alternative is an undo that silently erases work nobody has seen.
What you can do with this now
Open a file with a button in it. Ask your agent to change the button's fill to another of your tokens, and while it works, change the button's label in the Inspector. Both changes will be there. Then ask the agent to apply its next batch with if_revision set to the revision it last read, and see the refusal when you have edited in between.
If you run more than one agent on a file, ask each to pass if_revision on large batches, since they will not be told what the others did. A flow from Universe, such as Platform › Dashboard, makes a good shared job to split between agents.