# .worktreeinclude

> The list of files a new worktree needs, like .env.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** .worktreeinclude file

## Think of it like

It is like a packing list for a trip. It says which things to bring along.

## Definition

.worktreeinclude is a file in a repo's root that lists the files to copy into a new worktree. Claude Code copies them each time it makes one. A worktree is a fresh copy of the repo, so files git skips, such as .env, are not in it. The file uses the same rules as .gitignore. Only files that match it and that git skips are copied.

## Example

Lucy's app will not start in a worktree, because .env is missing. She lists .env in .worktreeinclude, and new worktrees start fine.

## Example code

```console
.env
.env.local
config/secrets.json
```

Copy these three into each new worktree.

## Why it matters

Without it, each new worktree starts broken, since its secrets are not there.

## Common mistake

Listing a file git tracks. Tracked files are already in the worktree, so they are skipped.

## Three principles

- **Project root.** One file.
- **gitignore syntax.** Patterns.
- **Ignored files only.** Tracked are skipped.

## Related terms

- [Worktree Isolation](https://learn.benibix.com/term/ai/worktree-isolation)
- [Worktree Tools](https://learn.benibix.com/term/ai/worktree-tools)
- [.claude Directory](https://learn.benibix.com/term/ai/claude-directory)

---

Source: https://learn.benibix.com/term/ai/worktreeinclude-file
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
