[FEATURE] Handle non-gitignored files in `.worktreeinclude`
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
- I'm debugging a problem and have created a temporary
debug.tsscript to dig into it. - I want Claude to help me investigate, but I want to continue my own research concurrently.
- With this feature, I could have a line matching
debug.tsin my.worktreeinclude, then simply runclaude --worktreeand be sure that Claude can see/usedebug.tsduring 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?
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗