Problem/Motivation
.gitignore excludes .claude/worktrees/, and the comment above it explains why in terms of agent worktrees living inside the project root: ddev symlink-project links every non-excluded top-level entry into web/modules/custom/, and each worktree carries its own web/ that links back, so an unignored worktree recurses infinitely for phpstan, phpcs and phpunit.
Worktrees are no longer kept inside the repository, so the comment describes an arrangement that is not in use. As written it reads as a description of current practice rather than as a guard, and the next reader cannot tell whether the rule is still live or is leftover from an abandoned setup.
The rule itself should stay. The failure it prevents is real and unchanged: a worktree created inside the repository — which tooling can still do — would recurse exactly as the comment describes.
Proposed resolution
Keep the pattern; rewrite only the comment so it reads as a guard against a situation rather than an account of the current layout:
# Guard against a worktree being created inside the repository. Worktrees # normally live outside it; one created here would be linked into # web/modules/custom/ by ddev symlink-project and recurse through its own # web/, breaking phpstan, phpcs and phpunit. .claude/worktrees/
Remaining tasks
None.
User interface changes
None.
API changes
None. Comment text only; the ignore pattern is unchanged.
Data model changes
None.
Issue fork entity_segment-3612929
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
jdleonard