35 pages for /worktree.
Titles and paths first, then pages whose text carries it. Each row opens that page as this site last read it.
Agent SDK reference - Python
Claude Code CLI · in the page
agent-sdk/python
…kept the subagent's isolated worktree](https://code.claude.com/docs/en/worktrees.md#isolate-subagents-with-worktrees), `worktreePath` on the `completed` variant is where to find it, and `worktreeBranc…
Agent SDK reference - TypeScript
Claude Code CLI · in the page
agent-sdk/typescript
…'t return the session to its worktree](https://code.claude.com/docs/en/worktrees.md#the-session-resumes-outside-its-worktree), with `worktree_unverified` or `worktree_resume_refused`. That section say…
Orchestrate teams of Claude Code sessions
Claude Code CLI · in the page
agent-teams
…l parallel sessions**: [Git worktrees](https://code.claude.com/docs/en/worktrees.md) let you run multiple Claude Code sessions yourself without automated team coordination
Manage multiple agents with agent view
Claude Code CLI · in the page
agent-view
…rktree](#how-file-edits-are-isolated) under `~/projects/my-app/.claude/worktrees/`. Interactive sessions you have open in other terminals don't appear until you [background them](#from-inside-a-sessi…
Run agents in parallel
Claude Code CLI · in the page
agents
…run agents themselves: * [Worktrees](https://code.claude.com/docs/en/worktrees.md) give each session a separate git checkout, so parallel sessions each edit their own copy of the files. Use them for…
Best practices for Claude Code
Claude Code CLI · in the page
best-practices
…'t collide. [`claude -w feature-auth`](https://code.claude.com/docs/en/worktrees#start-claude-in-a-worktree) starts a session in a new worktree, the [desktop app](https://code.claude.com/docs/en/deskt…
Claude Code changelog
Claude Code CLI · in the page
changelog
…checked * Fixed `--worktree` sessions leaving a folder behind in `.git/worktrees` in repositories using git's reftable ref storage * Fixed `claude self-hosted-runner` sessions using Anthropic-managed…
Explore the .claude directory
Claude Code CLI · in the page
claude-directory
….local # API credentials config/secrets.json`, docsLink: '/en/worktrees#copy-gitignored-files-into-worktrees' }, { id: 'dot-claude', label: '.claude/', type: 'fo…
Let Claude coordinate ongoing work with Projects
Claude Code CLI · in the page
claude-projects
…e each thread there its own [worktree](https://code.claude.com/docs/en/worktrees.md) instead of the folder itself. **2. Ask for the task with Work locally** In the project conversation, choose **Wor…
CLI reference
Claude Code CLI · in the page
cli-reference
…t Claude in an isolated [git worktree](https://code.claude.com/docs/en/worktrees.md) at `<repo>/.claude/worktrees/<name>`. If you don't give a name, Claude Code generates one. Pass `#<number>`, a GitH…
Commands
Claude Code CLI · in the page
commands
…it into independent units and runs each in its own [worktree](/docs/en/worktrees). See [Run agents in parallel](/docs/en/agents) for how these approaches relate. **Before you ship.** `/diff` shows wh…
Common workflows
Claude Code CLI · in the page
common-workflows
…ated parallel session. See [Worktrees](https://code.claude.com/docs/en/worktrees.md) for cleanup, `.worktreeinclude`, and non-git VCS support. To monitor parallel sessions from one screen instead of s…
Message your other Claude Code sessions
Claude Code CLI · in the page
cross-session-messaging
…ame repository in separate [worktrees](https://code.claude.com/docs/en/worktrees.md), Claude can tell the other sessions what landed. * **Get status from long-running work**: have a migration or test…
Desktop application
Claude Code CLI · in the page
desktop
…on to run it in its own [Git worktree](https://code.claude.com/docs/en/worktrees.md), an isolated copy of the project. By default, **Worktree** is off and Claude works in the project folder itself. On…
Glossary
Claude Code CLI · in the page
glossary
…lation mode that runs Claude in a separate git worktree under `.claude/worktrees/`, enabled with the `-w` flag or `isolation: worktree` in subagent config. Changes stay on a separate branch in a separ…
Hooks reference
Claude Code CLI · in the page
hooks
…orktrees share with the main checkout](https://code.claude.com/docs/en/worktrees.md#what-worktrees-share-with-the-main-checkout). The `$CLAUDE_CODE_REMOTE` environment variable is `"true"` in remote…
How Claude Code works
Claude Code CLI · in the page
how-claude-code-works
…aude sessions by using [git worktrees](https://code.claude.com/docs/en/worktrees.md), which create separate directories for individual branches. ### Resume or fork sessions Resuming a session with `…
Set up Claude Code in a monorepo or large codebase
Claude Code CLI · in the page
large-codebases
…eful for [subagent worktree isolation](https://code.claude.com/docs/en/worktrees.md#isolate-subagents-with-worktrees). Subagents are parallel Claude instances spawned for subtasks, and each one that r…
How Claude remembers your project
Claude Code CLI · in the page
memory
…or `head` on a single file. For files inside a worktree under `.claude/worktrees/`, see [Isolate subagents with worktrees](https://code.claude.com/docs/en/worktrees.md#isolate-subagents-with-worktrees…
Choose a permission mode
Claude Code CLI · in the page
permission-modes
…few exceptions, such as: * Claude's own git worktrees under `.claude/worktrees/` * The current session's own plan files in `~/.claude/plans/`, or in the [`plansDirectory`](https://code.claude.com/…
Configure permissions
Claude Code CLI · in the page
permissions
…pository, resolved through [worktrees](https://code.claude.com/docs/en/worktrees.md) to the main checkout. The rule applies to future sessions anywhere in that repository, including sessions started i…
Plugin loading reference
Claude Code CLI · in the page
plugins/loading
…orktrees share with the main checkout](https://code.claude.com/docs/en/worktrees.md#what-worktrees-share-with-the-main-checkout) * **In a folder you haven't trusted**: the plugin loads only after you…
Continue local sessions from any device with Remote Control
Claude Code CLI · in the page
remote-control
…nd session gets its own [git worktree](https://code.claude.com/docs/en/worktrees.md). Requires a git repository or a [`WorktreeCreate` hook](https://code.claude.com/docs/en/hooks#worktreecreate). • `s…
Configure the sandboxed Bash tool
Claude Code CLI · in the page
sandboxing
…g directory is a [linked git worktree](https://code.claude.com/docs/en/worktrees.md), the sandbox also allows writes to the main repository's shared `.git` directory so commands such as `git commit` c…
Manage sessions
Claude Code CLI · in the page
sessions
…[resumes it in your current directory](https://code.claude.com/docs/en/worktrees.md#resume-a-worktree-session). When you select a session from an unrelated project, Claude Code copies a `cd` and resum…
Claude Code settings
Claude Code CLI · in the page
settings
…the root of the git repository, resolved through [worktrees](/docs/en/worktrees) to the main checkout, so one file covers sessions started in any subdirectory or worktree of the repository. The file…
All settings
Claude Code CLI · in the page
settings-reference
…ow Claude Code creates git [worktrees](https://code.claude.com/docs/en/worktrees.md) | Agents, sessions, and worktrees | Any file | | [`worktree.baseRef`](#worktree-baseref) | Branch new [worktrees](h…
Extend Claude with skills
Claude Code CLI · in the page
skills
…ion running in a linked [git worktree](https://code.claude.com/docs/en/worktrees.md) that you created with `--worktree` or `git worktree add`, Claude Code searches parent directories only up to the wo…
Customize your status line
Claude Code CLI · in the page
statusline
…the session is in a [worktree session](https://code.claude.com/docs/en/worktrees.md) | | `workspace.repo.host`, `workspace.repo.owner`, `workspace.repo.name` | Repository identity parsed from the `ori…
Create custom subagents
Claude Code CLI · in the page
sub-agents
…ur session runs in a linked [worktree](https://code.claude.com/docs/en/worktrees.md) of its own, the check also covers the main checkout that worktree is linked from. For Bash commands, Claude Code a…
Tools reference
Claude Code CLI · in the page
tools-reference
…` | Creates an isolated [git worktree](https://code.claude.com/docs/en/worktrees.md) and switches into it, or switches into an existing worktree. See [EnterWorktree tool behavior](#enterworktree-tool-…
Use Claude Code in VS Code
Claude Code CLI · in the page
vs-code
…[Run parallel sessions with worktrees](https://code.claude.com/docs/en/worktrees.md). ### Create commits and pull requests Claude can stage changes, write commit messages, and create pull requests b…
Run parallel sessions with worktrees
Claude Code CLI · in the page
worktrees
…start Claude in it. By default, the worktree is created under `.claude/worktrees/<name>/` at your repository root, on a new branch named `worktree-<name>`: ```bash theme={null} claude --worktree feat…
Changelog
Claude Documentation · in the page
cowork/changelog
…long it sits idle, and worktrees you or the CLI create under `.claude/worktrees` are never removed by the app. * Fixed archiving a session deleting uncommitted work in a worktree created before the w…
User identity and local data
Claude Documentation · in the page
third-party/claude-desktop/data-storage
…o removes the session's [Git worktree](https://code.claude.com/docs/en/worktrees), except in some cases, such as when the worktree has uncommitted changes or the session is pinned. Other files in the…