{"version":"2.1.203","anchor":"worktree-improved-lock-safety-and-error-reporting","canonical_anchor":"worktree-improved-lock-safety-and-error-reporting","heading":"Worktree: Improved Lock Safety and Error Reporting","tier":null,"area":null,"scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.203\/e\/worktree-improved-lock-safety-and-error-reporting","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.203","markdown":"### Worktree: Improved Lock Safety and Error Reporting\n\nSeveral worktree operations now handle lock-state edge cases more carefully:\n\n- Stale-lock self-heal failures are now logged: `[worktree] skipped the stale-lock self-heal for <path>: <reason>`\n- When the worktree registry is unreadable, operations log `[worktree] left the lock on <path> \u2014 cannot read the worktree registry to verify ownership`\n- `cleanupWorktree` logs when it keeps a worktree because the registry is unreadable, instead of silently skipping cleanup\n- `cleanupStaleAgentWorktrees` logs each kept worktree with the lock reason\n\n**Evidence**\n\nWorktree lock diagnostics (search for `\"cannot read the worktree registry to verify lock ownership\"`)"}