R129 Keep worktrees under a root of their own, outside every repository’s directory

On by default

Superseded by R309 Keep worktrees under the directory for worktrees, outside every repository's directory.

Put each worktree of a repository at <root>/<repo>/<slug>/, under the root the jurisdiction designates for worktrees, never inside a repository’s directory.

Reason

With a root of their own, worktrees leave the root of main checkouts (rule 288) to main checkouts alone (Art. III §4). A worktree put inside a repository’s directory (for example <repo>/.worktrees/<slug>) sits inside the main checkout, and an agent tool that reads instruction files up the parent directories, as Claude Code reads CLAUDE.md, lays the main checkout’s instructions over the worktree’s.

Verification

<slug> is the worktree’s name, for example the task’s. The jurisdiction designates the root, for example in a rule of a lower layer.

Every path that git -C <main checkout> worktree list lists, except the main checkout’s own line, starts with <root>/<repo>/.

Violated when a worktree’s path is not under <root>/<repo>/.

Provisions of the constitution it cites

Relations

Parent
R127 Machines and Working Directories
Requires
none
Conflicts with
none

Metadata

ID
129
Revision
4
Kind
rule
Status
superseded
Slug
worktrees-root
Default level
user
Constitution revisions
>=1
Check
none
Default
on
Uses
Instructions instructions
Original language
English en
Translations
Chinese zh