extensions.worktreeConfig left in .git/config after worktree-isolation cleanup (Windows; follow-up to #34225)
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?
Follow-up to #34225 (auto-closed for inactivity; bug appears unresolved).
Problem
Agents run with isolation: "worktree" cause git to setextensions.worktreeConfig=true in .git/config. On cleanup the worktree is
removed but this entry is left behind and never cleared.
Original report was macOS. Reproduced on Windows — not platform-specific.
Impact
- Claude Code's own go-git lifecycle hooks fail on later runs (per #34225).
- Any external go-git tool that opens the repo also fails.
tea(Gitea CLI)
breaks on every repo-aware command:
Error: core.repositoryformatversion does not support extension: worktreeconfig
The leftover flag poisons the repo for third-party tooling until manually unset.
What Should Happen?
Accessing Gitea using tea
Error Messages/Logs
Error: core.repositoryformatversion does not support extension: worktreeconfig
Steps to Reproduce
- Run a Claude Code agent with worktree isolation; let it finish.
git config --local --get extensions.worktreeConfig→true
(git config --worktree --list fails; .git/config.worktree was never created — flag set but empty)
- Run any go-git tool (e.g.
tea whoami) → fails with the error above.
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.204 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
Workaround
git config --local --unset extensions.worktreeConfig
Must be repeated after every worktree-isolation run.