When 10nx creates a worktree, it copies gitignored files you name from the main checkout into it, so the worktree has your .env and other local config without you copying them by hand. Committed files are already there, from git.
Use this page when a new worktree is missing a local file, or when you want to copy more than .env files.
Choosing the files
Two places, and the first one found wins:
.worktreeincludeat the main checkout's root, one pattern per line. If the file exists it's used, even if it's empty. It's the same file Claude Code reads, so one list serves both.files_to_copyin the settings files. Default:[".env*"].
files_to_copy = [".env*", "config/local.yml", "certs/"]
# .worktreeinclude
.env*
config/local.yml
certs/
The rules
- Patterns use
.gitignoresyntax:*and**, a leading/to anchor to the root, a trailing/for a folder. - Only gitignored files are candidates. A committed file is never copied, since git already put it in the worktree.
- Nothing in the worktree is overwritten. A file that's already there is left as it is.
- Heavy folders aren't searched:
.git,node_modules,.venv,venv,__pycache__and cache folders. A pattern that names one of them on purpose (node_modules/) copies the whole folder. .claude/worktrees/itself is never copied.
When it runs
Right after the worktree is created and before the setup script, so the script can rely on the files. Run setup on an existing worktree copies whatever's missing.
Next steps
- Scripts: the setup script that runs next
- Set up a repo for worktrees
- Settings reference