A new worktree is a clean checkout. That means the secrets file you never commit is missing, and the app will not start.
Put a .worktreeinclude file in the project root. It uses .gitignore syntax, and Claude Code copies matching files into every worktree it creates.
.env
.env.local
config/secrets.json
It applies to --worktree sessions and to subagent worktrees. One safety rule I like: only files that match a pattern and are also gitignored get copied. Tracked files are never duplicated, so the file cannot turn into a second copy of your source.
I would keep the list short and boring. Local env files, one config, done. Anything big or generated just makes every worktree slower to create.
Without it, every new session starts by failing on a missing variable, and then somebody copies the file by hand. Set it up once, commit the file, and the rest of the team gets the same behavior.
The caveat: if you replace worktree creation with a WorktreeCreate hook, .worktreeinclude is not processed at all. Then your hook script has to do the copying itself.
Further reading: Run parallel sessions with worktrees – Claude Code docs, On this site: claude -w gives every session its own git worktree, On this site: .claude/settings.local.json overrides the team file just for you