[FEATURE] Handle non-gitignored files in `.worktreeinclude`

Open 💬 2 comments Opened Jun 27, 2026 by mkantor

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

I sometimes have untracked files in projects (e.g. work-in-progress modules) that aren't in my .gitignore, but I still want Claude to be able to see when using claude --worktree.

Proposed Solution

When creating the worktree directory, copy all files mentioned in .worktreeinclude to the new directory. Currently only files which match patterns in .gitignore are considered.

Alternative Solutions

I could manually copy such files myself, or write a script to automate that. Alternatively, I could commit them before creating the worktree (but they aren't always things I intend to commit).

Priority

Medium - Would be very helpful

Feature Category

File operations

Use Case Example

  1. I'm debugging a problem and have created a temporary debug.ts script to dig into it.
  2. I want Claude to help me investigate, but I want to continue my own research concurrently.
  3. With this feature, I could have a line matching debug.ts in my .worktreeinclude, then simply run claude --worktree and be sure that Claude can see/use debug.ts during its own investigation.

Additional Context

I suspect Claude Code is currently going out of its way to intersect .worktreeinclude with .gitignore. If that's true then implementing this feature would merely involve removing/simplifying existing code.

I haven't been able to come up with any positive reason why the current behavior is desirable, but perhaps I'm overlooking something. Is there a problem that could be caused by copying not-explicitly-ignored files?

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗