From b544303f29ea1f4f8f04106e28be00f624161daf Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Tue, 24 Feb 2026 11:37:37 +0100 Subject: [PATCH] docs(meta): allow removing own worktree index.lock in CLAUDE.md Adds explicit exception to worktree boundary rules: agents may remove their own worktree's stale index.lock file from the shared .git directory, but never another worktree's lock. Co-Authored-By: Claude Opus 4.6 --- CLAUDE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CLAUDE.md b/CLAUDE.md index 9f5bba849..d5da811d5 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -63,6 +63,7 @@ Unless there is a direct instruction or a functional need (e.g. accessing the sh - All file paths are relative to the worktree/git root (e.g. `server/src/bridge/types.rs`, `client/scripts/rendering/fog.gd`). - Do not navigate to or access sibling worktrees in the parent directory (`../client/`, `../copy/`, etc.) unless explicitly instructed. - Do not navigate above the git root unless explicitly instructed. +- **Exception — stale git lock files:** Worktree index locks live in the shared `.git` directory (e.g. `main/.git/worktrees/copy/index.lock`). If a `git` command fails with `index.lock: File exists`, you may remove the lock file for **your own worktree only** (e.g. `copy` may remove `worktrees/copy/index.lock`). Never touch lock files belonging to other worktrees. ### Database