Apply to main workspace
Merges this conversation’s work back into the main workspace, and tells you how many files landed. If the same files changed in both places, it names them instead of forcing a merge.
An agent that can edit files needs an undo that works. In the sandbox, every change the agent makes through its file editing is recorded with the version that was there before — so you can put it back.
Expand a file-change card in the conversation and it has Undo, beside Copy patch and View file. It asks once, naming the file and the lines it would put back, and then does it.
Two things are deliberately not undoable this way:
Hover any of your messages and select Undo files back to here (shown when files changed after it) — putting the files back the way they were when you sent it. The confirmation tells you exactly what that means: how many files, across how many runs.
If some of the changes in that window were made by a command and can’t be individually reversed, it says so and offers Restore checkpoint… instead, which resets the whole workspace to a known state.
An agent has one sandbox, and one run uses it at a time. When another conversation is holding it, the workspace says which one, by name:
Computer in use by “Fix the login bug” · expires in 4 m
You can keep typing and sending regardless; anything that needs the sandbox simply waits its turn, and the lock expires on its own. Undo, and restoring or deleting a checkpoint, are disabled while someone else holds it — each says which conversation has it, so you know who to ask or which run to stop.
For agents that work in a code repository, you can give each conversation its own branch. Then two people — or you, in two conversations — can have the same agent working on the same repository without stepping on each other.
When it’s on, the sandbox panel has a tab named after this conversation’s branch, with two actions:
Apply to main workspace
Merges this conversation’s work back into the main workspace, and tells you how many files landed. If the same files changed in both places, it names them instead of forcing a merge.
Discard branch
Throws the branch away, after confirming that its changes are not merged. Useful when the experiment didn’t work out.
Helpers can work on their own branches too, so several helpers editing at once never overwrite each other. A helper working that way says which branch it used and what it left there.
Turn it on in the Console. Under the agent’s Coding capability, open Advanced and turn on Git worktrees, then Worktree per chat. The same block also has the Helpers and Repository map switches.
Sandboxes can be restored from a snapshot after a restart, or when a paused sandbox cannot resume with its open apps (see Pause and resume). When that happens you get a card saying exactly what came back and what didn’t:
Restored your files. Open apps restarted. · 2 files were not saved · 3 secret variables dropped · 1 background command stopped
That matters, because the things a snapshot deliberately leaves out are exactly the things you’d otherwise chase for twenty minutes: local environment files, secrets, and anything that was running at the time. Cards for commands that were running show stopped on resume rather than vanishing, and your agent is told the same thing, so it knows to restart the server rather than assuming it’s still up.
When a paused sandbox resumes with its open apps, the workspace says it was restored as you left it, and commands that were running are still running.