{"version":"2.1.315","anchor":"worktree-lock-written-directly-under-tengu-mighty-sprout","canonical_anchor":"worktree-lock-written-directly-under-tengu-mighty-sprout","heading":"Worktree locks can be written without running git","tier":"internal","area":"Elsewhere","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.315\/e\/worktree-lock-written-directly-under-tengu-mighty-sprout","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.315","markdown":"### Worktree locks can be written without running git\n\nBehind a remote switch, Claude Code can lock a git worktree by writing git's lock file itself instead of running `git worktree lock`\n\n**What**\n\nA git worktree is an extra working copy of a repository, kept in its own folder. Locking a worktree tells git not to clean it up. Claude Code locks the worktrees it uses.\n\nClaude Code now has a second way to do this. It checks the worktree's `.git` files and then writes git's lock file directly, instead of running the `git worktree lock` command. It also records when a lock entry could not be written or did not pass its checks. A remotely controlled switch decides which way is used.\n\n**Why**\n\nWriting the file directly saves starting a separate git process every time a worktree is locked.\n\n- Area: Elsewhere\n- Tier: Under the hood\n- Useful: 2\/5\n- Signal: 2\/5\n- Scope: individual\n- Heads-up: no"}