Skip to content
Start here

POPULAR GUIDES

    FROM THE DOCUMENTATION

    Open this guide ↗
    ↑ ↓ select ↵ open esc closeV3Code Docs
    The editoreditor

    Worktrees and isolated changes

    ↗ View as Markdown

    Use separate Git checkouts for parallel or risky changes.

    A Git worktree gives a task its own working directory and branch. It is useful for parallel changes or experiments that should not touch your current checkout.

    Subagents alone do not provide this isolation. Workers can edit the same files unless their tasks and workspaces are explicitly separated.

    Inspect git status and existing worktrees. Create a separate worktree for this fix, keep the current checkout untouched, and report the branch and commit after testing. Do not merge, push, or remove anything without asking.

    Choose names and locations that make sense for the repository. A fresh worktree may not contain ignored dependencies or generated files; account for those before testing.

    Check the diff and test results in the worktree, then deliberately merge or cherry-pick the approved change. Keep unrelated user work intact. Report the exact branch and commit so the handoff can be verified.

    The native repository hygiene tool can plan cleanup and perform targeted push, remove, or prune actions behind terminal approval. Review its plan first. Do not remove a checkout with uncommitted or unpreserved work.

    Worktrees isolate files; they are not security sandboxes and do not isolate all external services or credentials.