R309 Keep worktrees under the directory for worktrees, outside every repository’s directory

Off by default

Put each worktree of a repository at ~/worktrees/<repo>/<slug>/, never inside a repository’s directory.

Reason

With a directory of their own, worktrees leave the directory for 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.

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

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

Provisions of the constitution it cites

Relations

Parent
R127 Machines and Working Directories
Requires
none
Conflicts with
none

Metadata

ID
309
Revision
1
Kind
rule
Status
trial
Slug
worktrees-dir
Default level
user
Constitution revisions
>=1
Check
none
Default
off
Uses
Instructions instructions
Original language
English en
Translations
Chinese zh