Search the documentation
50 pages for worktree.
Titles and paths first, then pages whose text carries it. Each row opens that page as this site last read it. Cut at 50, so a narrower query shows the rest.
Run parallel sessions with worktrees
Claude Code CLI · title
worktrees
Intercept and control agent behavior with hooks
Claude Code CLI · in the page
agent-sdk/hooks
…| | `WorktreeCreate` | No | Yes | Git worktree created…
Agent SDK reference - Python
Claude Code CLI · in the page
agent-sdk/python
…None, limit: int | None = None, offset: int = 0, include_worktrees: bool = True ) -> list[SDKSessionInfo] ``` #### Parameters | Parameter | Type | Default | Descripti…
Work with sessions
Claude Code CLI · in the page
agent-sdk/sessions
…3, the lookup was scoped to the current project directory and its git worktrees; SDK versions that bundle an older CLI still behave this way. </Tip> To resume sessions across machines or in serverles…
Agent SDK reference - TypeScript
Claude Code CLI · in the page
agent-sdk/typescript
…urn | | `options.includeWorktrees` | `boolean` | `true` | When `dir` is inside a git repository, include sessions from all worktree paths | ####…
Orchestrate teams of Claude Code sessions
Claude Code CLI · in the page
agent-teams
…en the sessions you run yourself * **Manual parallel sessions**: [Git worktrees](/docs/en/worktrees) 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
…conversation. To compare agent view with subagents, agent teams, and worktrees, see [Run agents in parallel](/docs/en/agents). <Note> Agent view is in research preview. The interface and keyboard…
Run agents in parallel
Claude Code CLI · in the page
agents
…s support this work without being a way to run agents themselves: * [Worktrees](/docs/en/worktrees) give each session a separate git checkout, so parallel sessions never edit the same files. Use them…
Best practices for Claude Code
Claude Code CLI · in the page
best-practices
…d messaging when the sessions need to pass findings between them: * [Worktrees](/docs/en/worktrees): run separate CLI sessions in isolated git checkouts so edits don't collide * [Cross-session messag…
Claude Code changelog
Claude Code CLI · in the page
changelog
…elete a session ("has commits that are not pushed anywhere") when its worktree branch was already merged into your checked-out default branch (e.g. local `main`) but not yet pushed * Fixed backgroun…
Explore the .claude directory
Claude Code CLI · in the page
claude-directory
…} } } }`, docsLink: '/en/mcp' }, { id: 'worktreeinclude', label: '.worktreeinclude', type: 'file', icon: 'md', color: '#8FA876', b…
CLI reference
Claude Code CLI · in the page
cli-reference
…on ID, Claude Code searches the current project directory and its git worktrees, then every other project on this machine. Before v2.1.223, the ID search covered only the current project directory and…
Commands
Claude Code CLI · in the page
commands
…batch` decomposes 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.*…
Common workflows
Claude Code CLI · in the page
common-workflows
…s) so a task can span multiple sittings * [Run parallel sessions with worktrees](#run-parallel-sessions-with-worktrees) so concurrent edits don't collide * [Plan before editing](#plan-before-editing)…
Run Claude Code behind a corporate launcher
Claude Code CLI · in the page
corporate-launcher
…ith the `disableDeepLinkRegistration` setting. * The relaunch that `--worktree` combined with `--tmux` performs: the terminal multiplexer starts that pane, not Claude Code's binary. * The native-messa…
Message your other Claude Code sessions
Claude Code CLI · in the page
cross-session-messaging
…area, instead of you re-explaining it there. * **Coordinate parallel worktrees**: when sessions work the same repository in separate [worktrees](/docs/en/worktrees), Claude can tell the other session…
Launch sessions from links
Claude Code CLI · in the page
deep-links
…) for how the local path is selected when you have multiple clones or worktrees. ### Choose between `cwd` and `repo` Use `cwd` when everyone who clicks the link has the project at the same absolute…
Desktop application
Claude Code CLI · in the page
desktop
…s, each session gets its own isolated copy of your project using [Git worktrees](/docs/en/worktrees), so changes in one session don't affect other sessions until you commit them. To view two sessions…
Get started with the desktop app
Claude Code CLI · in the page
desktop-quickstart
…om the sidebar to work on multiple tasks at once, each in its own Git worktree, and open the [tasks pane](/docs/en/desktop#watch-background-tasks) to watch the subagents and background commands a sess…
Schedule recurring tasks in Claude Code Desktop
Claude Code CLI · in the page
desktop-scheduled-tasks
…ur working directory is in, including uncommitted changes. Enable the worktree toggle when creating the task to give each run its own isolated Git worktree, the same way [parallel sessions](/docs/en/d…
Claude Code Desktop in WSL
Claude Code CLI · in the page
desktop-wsl
…, side chats, visual diff review, branch and pull request status, and worktrees all work, backed by the git and toolchain inside the distribution. "Open in editor" opens VS Code connected to the distr…
Error reference
Claude Code CLI · in the page
errors
…r-on-disk) | | `kept <id> — worktree has commits that are not pushed anywhere`…
Glossary
Claude Code CLI · in the page
glossary
…eferences, stored per git repository under `~/.claude/projects/`. All worktrees of the same repository share one auto memory directory. The first 200 lines or 25 KB of the `MEMORY.md` index loads at t…
Run Claude Code programmatically
Claude Code CLI · in the page
headless
…e looked for the ID only in the current project directory and its git worktrees, so you had to run both commands from the same directory. ## Next steps * [Agent SDK quickstart](/docs/en/agent-sdk/qu…
Hooks reference
Claude Code CLI · in the page
hooks
…Denied as a side branch from PermissionRequest for auto-mode denials, WorktreeCreate, WorktreeRemove, Notification, ConfigChange, InstructionsLoaded, CwdChanged, FileChanged, and DirectoryAdded as sta…
Automate actions with hooks
Claude Code CLI · in the page
hooks-guide
…| | `WorktreeCreate` | When a worktree is being created via `--worktree`, `isolation: "worktree"`, or for a background session. Re…
How Claude Code works
Claude Code CLI · in the page
how-claude-code-works
…rrent directory. The `/resume` picker shows sessions from the current worktree by default, with keyboard shortcuts to widen the list to other worktrees or projects. See [Manage sessions](/docs/en/sess…
Set up Claude Code in a monorepo or large codebase
Claude Code CLI · in the page
large-codebases
…s and large single-tree codebases with nested CLAUDE.md files, sparse worktrees, code intelligence, and per-package skills so Claude stays focused on the code you're working in. A large codebase can…
How Claude remembers your project
Claude Code CLI · in the page
memory
…r, or org | Per repository, shared across worktrees | | **Loaded into** | Every session…
Choose a permission mode
Claude Code CLI · in the page
permission-modes
…* `.devcontainer` * `.yarn` * `.mvn` * `.claude`, except for `.claude/worktrees` where Claude stores its own git worktrees Protected files: * `.gitconfig`, `.gitmodules` * `.bashrc`, `.bash_profile`…
Configure permissions
Claude Code CLI · in the page
permissions
…ings.local.json` at the root of the git repository, resolved through [worktrees](/docs/en/worktrees) to the main checkout. The rule applies to future sessions anywhere in that repository, including se…
Create and distribute a plugin marketplace
Claude Code CLI · in the page
plugin-marketplaces
…your repository's main checkout. When you run Claude Code from a git worktree, the path still points at the main checkout, so all worktrees share the same marketplace location. Marketplace state is s…
Plugins reference
Claude Code CLI · in the page
plugins-reference
…`isolation` frontmatter fields. The only valid `isolation` value is `"worktree"`. For security reasons, `hooks`, `mcpServers`, and `permissionMode` are not supported for plugin-shipped agents. Claude…
How Claude Code uses prompt caching
Claude Code CLI · in the page
prompt-caching
…s build different prefixes and miss each other's cache. That includes worktrees of the same repository, since each worktree has its own working directory. Sessions you run in parallel in the same dir…
Continue local sessions from any device with Remote Control
Claude Code CLI · in the page
remote-control
…ng directory, so they can conflict if editing the same files.<br />• `worktree`: each on-demand session gets its own [git worktree](/docs/en/worktrees). Requires a git repository.<br />• `session`: si…
Configure the sandboxed Bash tool
Claude Code CLI · in the page
sandboxing
…tion files such as `~/.bashrc` and system binaries in `/bin/` * **Git worktrees**: when the working directory is a [linked git worktree](/docs/en/worktrees), the sandbox also allows writes to the main…
Customize sessions in self-hosted environments
Claude Code CLI · in the page
self-hosted-environments-configuration
…itted work: at `--capacity` above one, the runner deletes per-session worktrees right after the hook returns, and at `--capacity 1` the reused [canonical clone](/docs/en/self-hosted-environments-deplo…
Deploy self-hosted environments to production
Claude Code CLI · in the page
self-hosted-environments-deploy
…tly under `--base-dir`, and a `--capacity` above `1` uses per-session worktrees instead. When runners in the same environment use different values for either flag, the resumed session's working direct…
Manage sessions
Claude Code CLI · in the page
sessions
…de Code looks for the ID in the current project directory and its git worktrees first, then in every other project on this machine, so it finds a session that started elsewhere or moved with [`/cd`](/…
Claude Code settings
Claude Code CLI · in the page
settings
…writes this file at 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 re…
Claude Code settings reference
Claude Code CLI · in the page
settings-reference
…| Agents, sessions, and worktrees | Any file | | [`agentPushNotifEnabled`](#agentpushnotifenabled)…
Customize your status line
Claude Code CLI · in the page
statusline
…| | `workspace.git_worktree` | Git worktree name when the current directory is inside a linke…
Create custom subagents
Claude Code CLI · in the page
sub-agents
…subagent an isolated copy of the repository instead, set [`isolation: worktree`](#supported-frontmatter-fields). A subagent with `isolation: worktree` runs its Bash and PowerShell commands inside its…
Tools reference
Claude Code CLI · in the page
tools-reference
…| No | | `EnterWorktree` | Creates an isolated [git worktree](/docs/en/worktrees) and switches into it. Pass a `path` to switch into an ex…
Use Claude Code in VS Code
Claude Code CLI · in the page
vs-code
…ull requests, or work across branches. To start Claude in an isolated worktree with its own files and branch, see [Run parallel sessions with worktrees](/docs/en/worktrees). ### Create commits and pu…
Get started with Claude Code on the web
Claude Code CLI · in the page
web-quickstart
…t once, each in its own session and branch, without managing multiple worktrees * **Repos you don't have locally**: Claude clones the repo fresh every session, so you don't need it checked out * **Tas…
Week 15 · April 6–10, 2026
Claude Code CLI · in the page
whats-new/2026-w15
…setting re-runs the command every N seconds, and <code>workspace.git\_worktree</code> in the JSON input</div> <div><code>CLAUDE\_CODE\_PERFORCE\_MODE</code>: Edit/Write fail on read-only files wit…
Week 19 · May 4–8, 2026
Claude Code CLI · in the page
whats-new/2026-w19
…, search command history across every project with Ctrl+R, branch new worktrees from local HEAD or the remote default, and block actions unconditionally with auto mode hard deny rules. <div className…
Week 21 · May 18–22, 2026
Claude Code CLI · in the page
whats-new/2026-w21
…oks, and MCP/LSP servers before installation</div> <div>New <code>worktree.bgIsolation: "none"</code> setting lets background sessions edit the working copy directly without <code>EnterWorktree</c…
Week 27 · June 29 – July 3, 2026
Claude Code CLI · in the page
whats-new/2026-w27
…now commit, push, and open a draft PR when they finish code work in a worktree, instead of stopping to ask</div> <div>Hook matchers with hyphenated identifiers like <code>code-reviewer</code> now…