64 pages for worktree.
Titles and paths first, then pages whose text carries it. Each row opens that page as this site last read it.
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
…file is loaded into context | Audit which instruction files load | | `WorktreeCreate` | No | Yes | Git worktree created | Track isolated workspaces | | `WorktreeRemove` | No | Yes | A worktree created…
Connect to external tools with MCP
Claude Code CLI · in the page
agent-sdk/mcp
…mpt-submission, tool-use, permission, subagent, task, elicitation, or worktree event. Before v2.1.284, naming a server had no effect on the first-turn wait. ### Set the first-turn wait yourself To c…
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 | Description | | :- | :- | :-…
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. To resume sessions across machines or in serverless envir…
Agent SDK reference - TypeScript
Claude Code CLI · in the page
agent-sdk/typescript
…undefined` | Maximum number of sessions to return | | `options.includeWorktrees` | `boolean` | `true` | When `dir` is inside a git repository, include sessions from all worktree paths | #### Return t…
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). Agent view runs sessions on your machine and you dispatch each one; to h…
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 each edit their own copy of the fil…
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
…m a `modelOverrides` value by letter case or a `[1m]` tag * Fixed new worktrees in a bare repository sometimes starting from local HEAD instead of the default branch, and unchanged subagent worktrees…
Use Claude Code in the cloud
Claude Code CLI · in the page
claude-code-on-the-web
…rate-git-dir`, `--shared`, or `--reference`, in a checkout with `core.worktree` set, or in a repository that keeps its refs in the reftable format. Start from the main checkout of a clone made with a…
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…
Let Claude coordinate ongoing work with Projects
Claude Code CLI · in the page
claude-projects
…in the folder and leave it running. In a git repository, add `--spawn worktree` to give each thread there its own [worktree](/docs/en/worktrees) instead of the folder itself. **2. Ask for the task wi…
CLI reference
Claude Code CLI · in the page
cli-reference
…shell) from the list. When the removal is [refused over the session's worktree](/docs/en/agent-view#what-deleting-a-session-removes) and a second `claude rm` can resolve it, the refusal prints the exa…
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
…on macOS or **Ctrl+Alt+W** on Windows. #### Run a session in its own worktree In a project that's a Git repository, turn on **Worktree** before you start a session to run it in its own [Git worktree…
Test iOS apps in the simulator
Claude Code CLI · in the page
desktop-ios-simulator
…e): how the CLI reaches the iOS Simulator * [Run a session in its own worktree](/docs/en/desktop#run-a-session-in-its-own-worktree): how sessions isolate changes * [Get started with Claude Code Deskto…
Get started with the desktop app
Claude Code CLI · in the page
desktop-quickstart
…bar to work on multiple tasks at once, optionally 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
…including uncommitted changes. To give each run its own [isolated Git worktree](/docs/en/desktop#run-a-session-in-its-own-worktree) instead, select **Worktree** in the task's [**Edit** form](#manage-s…
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
…ed-because-the-path-names-a-network-location) | | `is isolated in the worktree <path>, but this command <reason>. Refusing to run it` | [Background session errors](#command-blocked-by-the-worktree-iso…
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…
Set up Claude Code (local mode) for a HIPAA-ready organization
Claude Code CLI · in the page
hipaa-setup
…m only while it's running. Claude Desktop handles a deleted session's worktree in one of these ways: * **No uncommitted changes, the session isn't starred or pinned, and no other session is using th…
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
…on disk. The `matcher` field specifies which filenames to watch | | `WorktreeCreate` | When a worktree is being created via `--worktree`, `isolation: "worktree"`, or for a background session. Replace…
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…
Deploy managed settings
Claude Code CLI · in the page
managed-settings
…drop the quotes. Claude Code repairs the `permissions`, `autoMode`, `worktree`, and `attribution` blocks per field instead of dropping them whole: * A lock inside one, such as `permissions.disableBy…
How Claude remembers your project
Claude Code CLI · in the page
memory
…| | **Scope** | Project, user, or org | Per repository, shared across worktrees | | **Loaded into** | Every session | Every session (first 200 lines or 25KB) | | **Use for** | Coding standards, workfl…
Choose a permission mode
Claude Code CLI · in the page
permission-modes
…vn` * `.claude`, with a 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`](…
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…
Add components to a plugin
Claude Code CLI · in the page
plugins/components
…acheTtl` key of `experimental`. The only valid `isolation` value is `"worktree"`. See [supported frontmatter fields](/docs/en/sub-agents#supported-frontmatter-fields) for what each one does * **Ignore…
Plugin loading reference
Claude Code CLI · in the page
plugins/loading
…nother-directory) on v2.1.246 or later * **From the desktop app, in a worktree**: the plugin loads from the main checkout's `.claude/skills/` rather than the worktree's. See [What worktrees share with…
Manage Claude Code plugins for your organization
Claude Code CLI · in the page
plugins/org
…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. To roll out a bundle…
Continue local sessions from any device with Remote Control
Claude Code CLI · in the page
remote-control
…working directory, so they can conflict if editing the same files. • `worktree`: each on-demand session gets its own [git worktree](/docs/en/worktrees). Requires a git repository or a [`WorktreeCreate…
Configure the sandboxed Bash tool
Claude Code CLI · in the page
sandboxing
…section also says when this part of the block doesn't apply. * **Git worktrees**: when the working directory is a [linked git worktree](/docs/en/worktrees), the sandbox also allows writes to the main…
Run prompts on a schedule
Claude Code CLI · in the page
scheduled-tasks
…u created it. If you copy the file into another folder, such as a new worktree, sessions there list the copied tasks but don't run them, so create the task again in that folder. For cron-driven autom…
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
…ry. By default the session picker shows: * Sessions from the current worktree, including [background sessions](/docs/en/agent-view), which are marked `bg` in the list * Sessions started elsewhere tha…
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…
All settings
Claude Code CLI · in the page
settings-reference
…sub-agents) with its prompt, tools, and model | Agents, sessions, and worktrees | Any file | | [`agentPushNotifEnabled`](#agentpushnotifenabled) | Let Claude send a [push notification to your phone](/…
Extend Claude with skills
Claude Code CLI · in the page
skills
…ew directory's project skills. In a session running in a linked [git worktree](/docs/en/worktrees) that you created with `--worktree` or `git worktree add`, Claude Code searches parent directories on…
Customize your status line
Claude Code CLI · in the page
statusline
…r `--add-dir`. Empty array if none have been added | | `workspace.git_worktree` | Git worktree name when the current directory is inside a linked worktree created with `git worktree add`. Absent in th…
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…