Worktree
Simple Definition
A worktree is a separate working copy of a code project that lets developers or AI agents work on different tasks without overwriting each other.
It is like giving each coding agent its own safe workspace.
Why It Matters
When several agents work at once, they can collide, editing the same files and undoing each other’s changes. Worktrees keep each task isolated on its own branch, which makes parallel work safer and review cleaner.
Example
One AI agent fixes a bug in one worktree while another agent builds a new feature in a separate worktree. Neither overwrites the other’s work, and you can review each change on its own.
Related Terms
- AI Coding Agent, the kind of AI that benefits from isolated worktrees
- CLAUDE.md, project rules that guide agents working in a worktree
- Vibe Coding, building with AI agents, where worktrees help avoid conflicts
- AI Workflow, parallel agent work is part of larger coding workflows
- Subagent, focused agents that may each work in their own worktree
- Related guide: Setting up Claude Code agents
Continue learning
Explore related guides, tools, workflows, and prompts that help you go deeper into this topic.
Browse all AI terms.
Learn termSee these concepts in practice.
Open workflowA simple explanation of this AI concept.
Learn termA simple explanation of this AI concept.
Learn termA simple explanation of this AI concept.
Learn termA simple explanation of this AI concept.
Learn termSee AI terms in action
Browse practical AI workflows that use the concepts in this glossary.
Last updated: