Use
Workspace and changes
Your project is copied into the sandbox, not mounted. The agent works on the copy, on a branch of its own with your history behind it. When it is done, its commits come back into your repository with the same ids, you read the diff, and your branch moves only when you apply.
What goes in
fenzi run copies the folder you run it from to /sandbox/<folder>, and the agent starts there. It refuses your home folder, /, and any folder that holds your home folder.
- Files matched by
.gitignoreare left out. So are build output and dependencies, if your.gitignorelists them. - Your
.gitfolder is never copied. In a git repository, the history goes in beside the copy as a bundle of git objects, and the copy is made a repository again inside the sandbox. The repository itself sits outside the project folder there, so it never comes back as files. Your remotes, hooks, config and credentials are not in a bundle, so the sandbox has none of them. - If the copy includes files that look like secrets, such as
.envor a private key,runnames them before it creates anything. In a terminal it asks whether to copy them, and stops unless you say yes.--allow-secretsskips the question. Add them to.gitignoreif the agent should not see them. The full list of names is underrun.
Before the copy, Fenzi records a fingerprint of every file it sends, and in a repository the branch and commit you are on. The git line of the run shows them.
upload project copied to /sandbox/web, .gitignore respected, .git left out
your home directory is not copied
git michael/bol-293 at 6ed1603; your uncommitted changes become the first commit on the agent's branch
the agent works on fenzi/web-4f2a (history 2 MiB); its commits come back with the same idsThe agent is checked out on a branch named after the sandbox, fenzi/<sandbox>, at the commit you were on. Your own branch is not in the sandbox by name, so nothing the agent does can be mistaken for a change to it. If your folder had uncommitted edits, they become one commit at the base of the agent's branch, authored by you with the date of your last commit, so the agent starts from exactly what you had on disk. Your index and your folder are not touched: the commit is built from a temporary index. Untracked files that .gitignore does not match are in it, because they are in the copy the agent sees; add them to .gitignore to keep them out.
The agent is told what the folder is: a copy of your repository on its own branch, with no remote. It commits as <Agent> (fenzi sandbox), never as you. It cannot push: the sandbox has no git host in its policy and no token.
Some repositories get the files only, and the git line says why: a shallow clone, a sparse checkout, submodules, a rebase or merge in progress, a folder inside a repository rather than its root, or a history over 64 MiB. Then the sandbox has no history, the agent is told so, and the changes come back as files, as described under Files only.
To start with an empty folder instead, use fenzi run --no-upload claude. Fenzi's own flags go before the agent's name.
What comes back
When the agent exits, or when you run fenzi stop, Fenzi first brings its commits back, then copies the project folder out to ~/.cache/fenzi/staging/<sandbox> for the diff. run then shows the changes and asks what to do with them. The sandbox stays running, so fenzi connect can resume the agent; run --rm deletes it instead. If any step fails, the sandbox is kept, so nothing is lost.
agent exited
log saved, fenzi log
git 3 commits by Claude Code on claude/bol-293-fix, now in your repository
the last one holds what Claude Code left uncommitted
michael/bol-293 is unchanged until fenzi apply
changes 4 files staged, not appliedWhat crosses back is one bundle: git objects and branch names, nothing else. No config, hooks or index travel in a bundle. Fenzi fetches it with git's own integrity checks on, and with the check for a .git inside a tree forced to an error whatever your own git config says, so a hostile tree refuses the whole bundle before any ref is written. Tags stay in the sandbox and are listed. Submodules are not fetched.
- Anything the agent left uncommitted is committed for it first, as one checkpoint on its branch, so nothing is measured against the wrong base.
- The branch the agent was on lands under its own name, as
claude/bol-293-fixabove. If your repository already has a branch of that name, yours is never moved, whatever its relation to the agent's commits: they land asfenzi/<sandbox>/<name>instead, and the line says so. Only a branch Fenzi made, one namedfenzi/…, is fast-forwarded. The branch you started on, and the one you have checked out, are never written here. - If the agent made other branches, their commits are fetched but not landed; the line names them. If it made no commit, the line says so.
- If the agent replaced the repository in the sandbox, with
git initfor instance, its commits are not brought back, the line says so, and the changes come back as files. - If it left a rebase or merge unfinished, nothing is collected; the sandbox is kept and the error names it.
fenzi connectopens the agent again to finish or abort it.
Only the project folder is copied out. The agent's own settings live in its home folder, /sandbox, outside the project, so they stay out of the diff.
Read the diff
fenzi diff■ 3 files changed in 3 commits by Claude Code on claude/bol-293-fix not merged yet
deleted src/legacy-router.ts −31
new src/routes.test.ts +18
edited src/routes.ts +2 −1
+20 −32 in total
── src/routes.ts edited +2 −1
12 import { Router } from "./router";
13 - import { legacy } from "./legacy-router";
13 + import { health } from "./health";
14 + import { users } from "./users";
15
16 export const routes = new Router();
michael/bol-293 is unchanged; the commits are on claude/bol-293-fix. fenzi apply fast-forwards michael/bol-293 to them.Added, edited, and deleted files are all listed with their line counts, then each file's changed lines with three lines around them. Removed lines are marked -, added lines +. Long output opens in your pager. Binary files and very large rewrites show their counts only. --stat prints the list without the lines. The comparison is built in and reads the staged copy; git log claude/bol-293-fix shows the commits themselves.
Apply
fenzi applyShows the list, then asks: merge the branch, show the changes, or keep them for later. Keeping them changes nothing; the commits stay on their branch in your repository until you merge. --yes merges without asking.
Merging fast-forwards the branch you started on to the agent's commits, so the commits keep their ids and the change exists once. It does that only when nothing in between has changed: the same branch is checked out at the same commit as at start, the agent did not rewrite the commits that were there, and your folder is clean or still holds exactly the edits it had at start, which are inside the agent's history. Then your index and folder are moved to the agent's tree without running any hook, and the branch is moved with a compare-and-swap.
Any other case is a refusal that says why and names the merge to run by hand. Your branch, index and folder are left as they were.
! Not merged the sandbox started on michael/bol-293 and you are on main now
Nothing was changed. The commits are on claude/bol-293-fix. Next: git switch michael/bol-293, then fenzi apply again; or git merge claude/bol-293-fix.- You switched branches: switch back and apply again, or merge the branch into the one you want.
- Your branch moved, because you committed while the agent worked:
git mergeorgit rebasethe agent's branch yourself. - Your folder has edits since the start: commit or stash them, then apply again.
- You already merged the branch yourself, or applied once: apply finds the commits on your branch and writes nothing. Files are never copied on top of committed work, which is where a second copy of a change would come from.
Then push as you normally would, with your own credentials. The agent never pushes, and no git token enters the sandbox.
A change the agent made to fenzi.yaml is not flagged. The diff shows it like any other file, and the merge brings it in like any other file, so read it there. On Free, the next run in that folder uses the file you merged, and the policy check does not catch a host the agent added, because on Free the boundary comes from the same file. On a machine signed in to a team, the project file is not used. See The check before start.
Files only
In a folder with no git history, or a repository that got the files only, the changes come back as a copy of the files, and apply writes them into your folder. It refuses if any of those files changed on your side since the agent started, and lists them, so you never lose your own edits to the agent's. Resolve them and run it again.
- Git internals are never written: a
.gitfolder or file at any depth, in any case, is left out of the diff, and apply refuses a change list that names one. - Symbolic links and special files are not applied. A link could point outside the project.
- Nothing is written outside the project folder, whatever path the staged copy names.
- Each file is written in full and moved into place, so an interrupted apply does not leave half a file.
Then commit as you normally would. The changes arrive as files in your working tree, and your Git history is yours.
Several runs on one project
Each sandbox has its own staging folder. diff and apply pick the latest sandbox for the folder you are in; pass --sandbox <name> for an earlier one. fenzi ps --all lists finished sandboxes whose changes you can still read.
On Team
The workspace never reaches our cloud. The control plane receives decision records and requests, not files. The model vendor still receives what the agent sends it: the files it read, command output, and your instructions. See What our cloud receives.
A team policy cannot forbid --allow-secrets today. The policy file has no setting for it, and the flag works the same on a machine signed in to a team. The warning that names the files is still printed, and the files are copied only into the sandbox on that developer's machine.