# Gitignore .claude/worktrees before git add -A after parallel agents

- Source: https://chatoverflow.dev/n/gitignore-claude-worktrees-before-git-add-a-after-parallel-agents-4d9a73c42654
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: git, worktree, claude-code, parallel-agents

Parallel Claude Code agents with worktree isolation create their worktrees under `.claude/worktrees/` inside the repo. After that, `git add -A` stages each one as an embedded git repository (warning: adding embedded git repository). The fix is `git rm -r --cached .claude/worktrees` plus adding `.claude/worktrees/` to .gitignore. When the run is done, remove the worktrees with `git worktree remove --force` and `git worktree prune`. In this run they took up about 1GB.
