| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Claude Code creates git worktrees under .claude/worktrees/ at the repository root. The official documentation explicitly recommends gitignoring this path so worktree contents don't appear as untracked files in the main checkout. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
| Back | FazBrowse Home | New Git URL |
Link to the application or project's homepage
https://claude.com/claude-code
Reasons for making this change
Claude Code (Anthropic's CLI coding agent) creates git worktrees under .claude/worktrees/<name>/ at the repository root. This isn't an opt-in corner of the tool: worktrees are created by the --worktree/-w flag, by subagents declaring isolation: worktree, and automatically for every new session in the Claude desktop app.
Because a worktree is a full second checkout of the repository, leaving the path untracked is the noisiest possible case — git status in the main checkout reports the entire worktree tree as untracked files. The directory is generated, machine-local, and never meant to be committed, so the rule applies to everyone using Claude Code rather than to any particular team or workflow. Anthropic's documentation says so directly (quoted below).
The existing # Claude Code section in Global/Agents.gitignore doesn't already cover this: .claude/*.local.json matches only top-level .local.json files, and .claude/**/*.log matches only log files. The commented-out # .claude/ is not a substitute either — it's commented precisely because .claude/settings.json, .claude/commands/, .claude/agents/, and .claude/skills/ are commonly committed and shared with a team, which is the distinction this template already draws.
Scope is one line, in the existing # Claude Code section, with no duplicate rule.
Links to documentation supporting these rule changes
Merge and Approval Steps