[BUG] Worktree isolation fails with "Background full checkout failed: git-crypt-locked" in git-crypt repos
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When starting a new Claude Code Desktop session with worktree isolation enabled, the session creation fails with:
Background full checkout failed: git-crypt-locked
This happens in any repository that uses git-crypt to encrypt files via .gitattributes filter rules, e.g.:
conf/** filter=git-crypt diff=git-crypt
certificates/** filter=git-crypt diff=git-crypt
Steps to reproduce:
- Clone a repository that uses git-crypt with files matching
.gitattributesfilter rules - Open Claude Code Desktop and start a new session with "worktree" isolation checked
- Observe the error
Expected behavior: The worktree is created successfully. Encrypted files remain encrypted (locked) in the new worktree — that is acceptable.
Actual behavior: git worktree add fails because git invokes the git-crypt smudge filter during checkout, which exits non-zero when the repo is locked, and since filter.git-crypt.required=true by default, the entire checkout aborts.
Additional context:
- Running
git-crypt unlockbefore creating the session does not resolve the issue. - Other AI coding tools (e.g. Codex) handle this without error, likely by using
--no-checkoutor by passing-c filter.git-crypt.required=falsetogit worktree add.
Suggested fix:
When creating a worktree, pass the following git config overrides to bypass the smudge filter:
git \
-c filter.git-crypt.smudge=cat \
-c filter.git-crypt.clean=cat \
-c filter.git-crypt.required=false \
worktree add <path> <branch>
This allows the checkout to succeed with encrypted files remaining as encrypted bytes — which is the correct behavior for a locked worktree.
Environment:
- OS: macOS 15.3
- git-crypt: 0.7.0
- git: 2.47.0
What Should Happen?
A new worktree should be created.
Error Messages/Logs
Background full checkout failed: git-crypt-locked
Steps to Reproduce
For me, this happens (all the time) when starting a new session as a worktree in a repo that has git-crypt configured after upgrading to the latest version of claude code desktop (Claude 1.7196.0 (2dbd78) 2026-05-12T05:34:40.000Z).
However, colleagues of mine have ran into this on older versions. Some have given up on using worktrees altogether while for others it has magically started working again after a while.
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
Claude 1.7196.0 (2dbd78) 2026-05-12T05:34:40.000Z
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Warp
Additional Information
I'm using claude code desktop
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗