claude-code - 💡(How to fix) Fix [FEATURE] Handle non-gitignored files in `.worktreeinclude`

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

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?

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • 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?

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING