Skip to content
AI Skills Central

Type to search Agent Skills, workflows, tutorials, tools and the glossary.

Git worktree

Definition

An extra working directory attached to the same Git repository, with its own branch checked out, created with `git worktree add`.

In more detail

Worktrees let several coding agents work in parallel on separate branches without overwriting each other's files, and without cloning the repository again. For example, git worktree add -b fix-login ../app-fix-login creates a new branch in a sibling folder.

All worktrees share one .git object store, so creating one is fast and uses little disk. Each has its own checked-out files, so an agent running tests in one folder does not see half-finished edits from another. git worktree list shows them all and git worktree remove ../app-fix-login deletes one when its branch is merged.

Two worktrees cannot check out the same branch at once. Untracked files such as .env and installed dependencies are not copied, so each new worktree needs its own install step.

  • Dev container

    A container defined by a devcontainer.json file that gives a project a reproducible environment, often used to sandbox agents.

  • Headless mode

    Running a coding agent non-interactively from a script or CI job, passing the task as an argument and reading the result from output.

  • Multi-agent system

    An application in which several agents, often with different roles, tools or instructions, cooperate or hand work to each other.

  • Sandbox

    An isolated environment that limits what an agent or its code can read, write or reach on the network, so any mistakes stay contained.

  • Subagent

    A separate agent instance with its own context window, launched by a main agent to handle a focused task and report back a short result.