Follow Discord
Sweep 25 Sep 2026 · 19:33Z Build v2.1.283 504 read Stable v2.1.274 Latest v2.1.283 Next v2.1.283 Feeds RSS JSON llms.txt llms-full.txt Unofficial
HomeDocsSearch
Search the documentation

33 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 …es it. If Claude Code [kept the subagent's isolated worktree](/docs/en/worktrees#isolate-subagents-with-worktrees), `worktreePath` on the `completed` variant is where to find it, and `worktreeBranch`… Agent SDK reference - TypeScript Claude Code CLI · in the page agent-sdk/typescript …e stops because it [can't return the session to its worktree](/docs/en/worktrees#the-session-resumes-outside-its-worktree), with `worktree_unverified` or `worktree_resume_refused`. That section says w… Orchestrate teams of Claude Code sessions Claude Code CLI · in the page agent-teams …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 …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 …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 for sessions you r… Best practices for Claude Code Claude Code CLI · in the page best-practices …e 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 messaging](/docs/en/cross… 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 …and give it its task yourself. * **Worktrees**: a [worktree](/docs/en/worktrees) gives each local session its own working copy of a repository so parallel sessions on your machine don't overwrite eac… CLI reference Claude Code CLI · in the page cli-reference …| Start Claude in an isolated [git worktree](/docs/en/worktrees) at `<repo>/.claude/worktrees/<name>`. If you don't give a name, Claude Code generates one. Pass `#<number>`, a GitHub… 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 …ve base branch "HEAD": git rev-parse failed`. See [Worktrees](/docs/en/worktrees) for cleanup, `.worktreeinclude`, and non-git VCS support. To monitor parallel sessions from one screen instead of sepa… Message your other Claude Code sessions Claude Code CLI · in the page cross-session-messaging …hen sessions work the same repository in separate [worktrees](/docs/en/worktrees), Claude can tell the other sessions what landed. * **Get status from long-running work**: have a migration or test run… Desktop application Claude Code CLI · in the page desktop …n 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 at once, hold **Cm… 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 …**Worktrees are different.** If Claude enters a [worktree](/docs/en/worktrees) during the session, Claude Code keeps `${CLAUDE_PROJECT_DIR}` where it was and passes the worktree path to your hooks… How Claude Code works Claude Code CLI · in the page how-claude-code-works …you can run parallel Claude sessions by using [git worktrees](/docs/en/worktrees), which create separate directories for individual branches. ### Resume or fork sessions Resuming a session with `cla… Set up Claude Code in a monorepo or large codebase Claude Code CLI · in the page large-codebases …This is particularly useful for [subagent worktree isolation](/docs/en/worktrees#isolate-subagents-with-worktrees). Subagents are parallel Claude instances spawned for subtasks, and each one that runs… 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 …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 sessions started in s… Continue local sessions from any device with Remote Control Claude Code CLI · in the page remote-control …worktree`: each on-demand session gets its own [git worktree](/docs/en/worktrees). Requires a git repository.<br />• `session`: single-session mode. Serves exactly one session and rejects additional c… Configure the sandboxed Bash tool Claude Code CLI · in the page sandboxing …rees**: when the working directory is a [linked git worktree](/docs/en/worktrees), the sandbox also allows writes to the main repository's shared `.git` directory so commands such as `git commit` can… Manage sessions Claude Code CLI · in the page sessions …er exists, Claude Code [resumes it in your current directory](/docs/en/worktrees#resume-a-worktree-session). When you select a session from an unrelated project, Claude Code copies a `cd` and resume c… 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 …| Configure how Claude Code creates git [worktrees](/docs/en/worktrees)… Extend Claude with skills Claude Code CLI · in the page skills …ject skills. In a session running in a linked [git worktree](/docs/en/worktrees), Claude Code searches parent directories only up to the worktree root. On Claude Code v2.1.277 or later, when the work… Customize your status line Claude Code CLI · in the page statusline …is present only while the session is in a [worktree session](/docs/en/worktrees)… Create custom subagents Claude Code CLI · in the page sub-agents …aude Code from. When your session runs in a linked [worktree](/docs/en/worktrees) of its own, the check also covers the main checkout that worktree is linked from. Before v2.1.210, the check covered o… Tools reference Claude Code CLI · in the page tools-reference …| `EnterWorktree` | Creates an isolated [git worktree](/docs/en/worktrees) and switches into it. Pass a `path` to switch into an existing worktree instead of creating a new one. On first entry… Use Claude Code in VS Code Claude Code CLI · in the page vs-code …files and branch, see [Run parallel sessions with worktrees](/docs/en/worktrees). ### Create commits and pull requests Claude can stage changes, write commit messages, and create pull requests base… Week 28 · July 6–10, 2026 Claude Code CLI · in the page whats-new/2026-w28 …ion before entering a git worktree outside the project's <code>.claude/worktrees/</code> directory</div> <div>Background agents upgrade to a new version in the background right after a Claude Code… Week 32 · August 3–7, 2026 Claude Code CLI · in the page whats-new/2026-w32 …d local settings can only turn it off</div> <div><a href="/docs/en/worktrees#how-claude-code-enforces-isolation">Worktree isolation</a> now blocks not only file edits but also Bash commands and gi… Week 33 · August 10–14, 2026 Claude Code CLI · in the page whats-new/2026-w33 …own worktree.</p> <a className="digest-feature-link" href="/docs/en/worktrees#branch-from-a-pull-request">Branch a worktree from a pull or merge request</a> </div> <div className="digest-wins">… 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…
Feedback