Isolated branches

Each agent on its own branch

Two agents in the same folder overwrite each other’s changes. With an isolated branch each one works in its own copy of the repo and you decide what gets in.

How an isolated branch is created

When you create a new agent you pick the project folder and turn on Isolate on its own branch. If another agent is already on that project, doki turns it on for you.

doki creates the worktree from the current commit, gives it a doki/<name> branch and tells the agent where it is: don’t touch the main folder, install whatever is missing there, and don’t push or merge.

  • Copy the project’s .env files gives the agent your .env files, which aren’t in git.
  • Each branch gets its own port for its dev server, so two agents don’t fight over the same one.
  • It works on your Mac and on machines over SSH.

Changes next to the chat

Under the agent’s header you get its branch card: the name, the base branch, how many files changed, lines added and removed, and commits.

View changes opens the full diff, file by file or with All files. You can also put it beside the conversation and read both at once.

If the agent works straight in your folder, with no isolated branch, doki still shows the files it left uncommitted and their diff.

The AI review before merging

The review reads the changes and returns a summary, a verdict (ready to merge, check it first or don’t merge yet), the risks with their file and line, missing tests, and any secrets that slipped in.

Send findings passes them to the agent so it fixes them on the same branch. If you turn on Review when done in Settings, the review runs by itself when the agent finishes.

If the verdict is don’t merge and you press Merge, doki warns you with the main risk before going on.

Merge, open a PR or discard

Merge commits the agent’s work and merges it into the base branch in your main folder. If there are conflicts, doki leaves everything as it was and offers to ask the agent to resolve them.

Create PR pushes the branch and opens the pull request with gh. If one already exists, the button becomes Update PR. Discard deletes the folder and the branch after you confirm.

The same actions are in doki in the browser.

How to start

  1. Create an isolated agent

    In New agent pick the project, turn on Isolate on its own branch and choose whether to copy the .env files.

  2. Review its changes

    Read the diff next to the chat and ask for the AI review when it finishes.

  3. Decide what gets in

    Merge into the base branch, open a PR or discard the branch.

Frequently asked questions

What is a git worktree?

A second folder of the same repository with another branch checked out. It shares history with your main folder, but the files are separate.

Where does doki keep isolated branches?

In ~/.doki/worktrees/<repo>/<name>, on the machine where the agent runs. The branch is called doki/<name>.

Which agents can work on an isolated branch?

The ones you create from doki in a folder with git: Claude Code, Codex, Cursor and the rest. The exceptions are Cursor Cloud and Cursor in API mode on your Mac.

What happens if merging hits conflicts?

doki cancels the merge without touching anything and offers to ask the agent to resolve them on its branch. Your main folder also needs to be on the base branch to merge.

Do I need `gh` to open the PR?

It’s best, because doki creates the PR with it. Without gh, doki pushes the branch and opens GitHub’s compare page so you create the PR yourself.

Does the AI review send my code anywhere?

It’s done by doki’s AI that you set up in Connections, or by a Grok Bot if you pick one. What usedoki.com stores is in Security.

Updated November 18, 2026

Never leave an agent waiting.

Claude Code, Codex, Cursor and the rest in one Inbox: on your Mac, the browser, your phone and your servers.

See pricing →