skills/use-slicer-worktrees/SKILL.md
Move a git worktree or repository into a Slicer microVM with a working, self-contained .git — push code in with `slicer wt push`, let a VM or coding agent work, then pull commits back. The recommended way to put a git project into an agent sandbox.
npx skillsauth add slicervm/agent-skills use-slicer-worktreesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
slicer wt moves a git worktree (or a whole repository) into a Slicer microVM with a working, self-contained .git, lets the VM — or a coding agent running in it — do the work, then pulls the commits back. The host repository is never mounted and its hooks never run inside the VM.
This skill assumes a running Slicer daemon — see the use-slicer skill for connecting to one.
slicer wt (and not a plain copy)A git worktree's .git is a file, not a directory:
gitdir: /home/you/src/project/.git/worktrees/feature-x
That is an absolute host path. Tar-copying the worktree directory into a VM leaves the pointer dangling — every git command in the VM fails with fatal: not a git repository. And even for a normal repo, copying .git wholesale drags host hooks and config along.
slicer wt push stages a fresh, sanitised .git instead, so git works correctly in the VM and the host repo stays untouchable.
slicer wt push --launch . # launch a VM and push the current worktree in
slicer vm shell <vm> # work in it — or point a coding agent at it
slicer wt pull <vm> . # commits + files back, your branch fast-forwarded
git push # from the host, under your own identity
<vm> is the VM name printed by wt push --launch.
| Command | Purpose |
|---------|---------|
| slicer wt push [vm] [path] | Push the worktree at path into an existing VM |
| slicer wt push --launch [path] | Launch a fresh VM, then push |
| slicer wt pull <vm> [path] | Import the VM's commits (auto fast-forward) and files |
| slicer wt list | List worktree VMs (* marks the current directory's VM) |
path defaults to . (the current directory).
Useful flags on wt push:
| Flag | Purpose |
|------|---------|
| --launch | Provision a fresh VM before pushing |
| --depth N | Shallow clone — much faster for large repos |
| --force / -f | Re-push into a VM that already has the worktree (wipes the VM-side copy first) |
| --hostgroup NAME | Host group for --launch |
| --tag key=value | Extra tags on the launched VM |
wt push does for you.git — empty hooks, no foreign config — so the VM cannot reach or corrupt the host repo..slicerignore).origin at the https upstream (rewriting git@… SSH remotes) so the VM can git push — including through Slicer Proxy in isolated-network VMs.user.name / user.email) and safe preferences. Credentials are never copied in.wt pull does for yourefs/slicer/<vm>/* — your own branches and refs are never clobbered.Don't edit the host worktree while a VM holds it. wt pull overwrites host files with the VM's copy — anything you changed on the host since the push is lost. Push it, let the VM/agent work, pull it back. Treat the host worktree as "checked out to the VM".
The agent sandbox commands (slicer codex, slicer amp, slicer claude, slicer copilot, slicer opencode — see the use-slicer skill) run provision-only when given no positional argument: they create a VM with the agent installed but copy nothing in. That is the intended entry point for slicer wt:
slicer codex # provision a clean codex VM (no workspace copied)
slicer wt push codex-1 . # push your worktree in, with a working .git
slicer codex codex-1 # attach; let the agent work and commit
slicer wt pull codex-1 . # bring the commits back, host branch fast-forwarded
git push
cd ~/src/myrepo
git worktree add ../myrepo-feature -b feature
cd ../myrepo-feature
slicer wt push --launch . # note the VM name it prints
# ...work, or run an agent, in the VM and commit there...
slicer wt pull <vm> .
git push
slicer wt is a recent addition. Run slicer wt --help to confirm it is present in your build, and update Slicer if the command is missing.
development
Use Slicer to launch Linux microVMs for sandboxed builds, E2E tests, Docker, CI, and isolated dev environments — works from macOS and Linux hosts
development
Filter, audit, and inject secrets into HTTP(S) egress from Slicer microVMs with Slicer Proxy — default-deny allow rules, credential injection (Bearer, Basic, OAuth for Claude/Codex/Copilot/xAI), audit and passthrough modes — on Linux and macOS.
tools
Install and run RustFS (S3-compatible object storage in Rust) in a Slicer VM, and talk to it with any S3 client (boto3, aws-cli, mc)
tools
Provision K3s clusters with k3sup and k3sup-pro on local, Slicer, and remote VMs.