[FEATURE] CLI support for .worktreeinclude file (parity with desktop app)
Problem Statement
The Claude Code desktop app documents and supports .worktreeinclude files—when creating worktrees through the GUI, it automatically copies files matching the patterns in .worktreeinclude to the new worktree.
However, the CLI has no awareness of .worktreeinclude. When using Claude Code CLI to create git worktrees, users have to manually instruct Claude to copy these files, or create custom slash commands to handle it (which is what I've done as a workaround).
This is a gap in feature parity between the desktop and CLI experiences.
Proposed Solution
When Claude Code CLI detects a .worktreeinclude file in the repository root, it should automatically add context/instructions so that when Claude creates worktrees, it copies files matching those patterns to the new worktree (preserving directory structure).
This could be implemented as:
- Detecting
.worktreeincludeat repo root during session init - Adding a system instruction like: "When creating git worktrees, copy files matching patterns in
.worktreeincludeto the new worktree, preserving directory structure"
Alternative Solutions
Currently I work around this with a custom slash command that:
- Creates the worktree
- Reads
.worktreeincludepatterns - Copies matching files to the new worktree
This works but shouldn't be necessary since the desktop app already supports this natively.
Use Case Example
- I have a monorepo with local environment files, IDE settings, and config that aren't committed
-
.worktreeincludecontains patterns like.env.local,.vscode/,CLAUDE.local.md - When I ask Claude to create a worktree for parallel work, I expect these files to come along
- With desktop app: works automatically
- With CLI: need to manually tell Claude to copy them or use a custom command
Is there any update related to this, or any proposed workaround at the moment?