Worktrees
Also written: Worktree-isolated sessions, Working tree
Worktrees are separate folders linked to a single Git repository, letting developers work on different branches at once.
Imagine you have one main project folder for your code. A worktree lets you create another folder, also linked to that same main project, but set up to look at a different version or 'branch' of your code.
This is useful when you want to work on a new feature without messing up your main code, or when you need to fix a bug in an older version while still developing the new one. Each worktree acts like its own independent project folder, but they all share the same underlying code history.
Git worktrees allow multiple working directories to be checked out from a single repository. Each worktree can be associated with a different branch, enabling developers to work on multiple features, bug fixes, or versions concurrently without the need to constantly switch branches in a single directory. This feature is particularly useful for managing complex projects or when collaborating on different aspects of the codebase simultaneously.
Frontier AI labs are integrating worktrees to offer developers more control and flexibility. Features like persistent cloud environments and local sandboxing allow users to work on different branches or projects simultaneously without affecting the main codebase. This improves workflow management and security for AI-assisted coding.
- New controls and chat improvements in Copilot for JetBrainsMicrosoft · GitHub Changelog: Copilot ·
- OpenAI gives Codex reusable cloud environments that work across devicesOpenAI · TechCrunch AI ·
- Local sandboxing in the GitHub Copilot appMicrosoft · GitHub Changelog: Copilot ·
- Codex bootcamp 201: Team workflows - EventOpenAI · OpenAI Academy ·
- What's your favorite new GitHub Copilot feature?Microsoft · Microsoft Developer on YouTube ·
- What's your favorite new GitHub Copilot feature?Microsoft · Microsoft Developer on YouTube ·
- Mastering remote engineering work from your phoneOpenAI · OpenAI Developers Blog ·
- Claude Code Changelog 2.1.222Anthropic · Claude Code Changelog ·
- Introducing the Codex appOpenAI · OpenAI News ·
- Anthropic Claude
- Anthropic's Claude is improving session security and connectivity, which relates to the isolation and management of different working environments.
- Microsoft Copilot
- Microsoft Copilot and GitHub Copilot are using worktrees to enable local sandboxing, provide new controls in IDEs, and enhance agentic coding and workflow management.
- OpenAI ChatGPT
- OpenAI is using worktrees to provide persistent cloud environments for Codex, allowing users to code from anywhere and manage engineering work remotely.
- Monorepo
- A monorepo is a single repository containing multiple distinct project
- Forks
- A fork creates a separate copy of an entire repository, typically for ind
- Submodules
- Git submodules allow embedding one Git repository within another, us
Worktrees were introduced as a feature of the Git distributed version control system. The initial implementation and announcement aimed to provide a more efficient way to manage multiple working copies of a repository. Source ↗
If you use Git, you can create a worktree by navigating to your repository in the terminal and running 'git worktree add ../new-branch-folder branch-name'. Then, open the 'new-branch-folder' in your code editor and make changes. You can switch back to your main folder and see that your changes in the worktree did not affect it until you commit and merge.
The Playbook: reusable how-tos, prompts, configs and tips pulled out of the news.
- PromptRole-play a student struggling with math for AI tutor simulationSimulate a student's math struggles and uncertainty for AI tutor evaluation. · 5 min
- TemplateReusable workflow templates for healthcare teamsTeams can create and share templates for common workflows like documentation or prior authorizations. · 15 min
- TemplateTemplate for building an AI tool tailored to your workA structured approach to defining and building a custom AI tool for specific business needs. · 15 min
- TemplateEvals CSV prompt list for agent skillsA CSV file template for listing prompts used in evaluating agent skills. · 20 min
- HeuristicDouble coding agent task completion with docs linksProviding coding agents with a documentation link significantly increases their task completion rate. · 2 min
Questions people ask
- Can I have multiple worktrees for the same branch?
- Yes, you can create multiple worktrees pointing to the same branch, though the primary use case is for different branches to isolate development efforts.
- Do worktrees take up extra space?
- Worktrees share the underlying Git object database, so they only duplicate the files in the working directory, making them more space-efficient than cloning the repository multiple times.
First seen on Subvolts Feb 2, 2026. Updated Oct 17, 2026. Written by an AI model from the items above and reviewed against them weekly; report an error.

