extensions.worktreeConfig left in .git/config after worktree-isolation cleanup (Windows; follow-up to #34225)

Open 💬 0 comments Opened Jul 8, 2026 by haikom-ola

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 set
extensions.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

  1. Claude Code's own go-git lifecycle hooks fail on later runs (per #34225).
  2. 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

  1. Run a Claude Code agent with worktree isolation; let it finish.
  2. git config --local --get extensions.worktreeConfigtrue

(git config --worktree --list fails; .git/config.worktree was never created — flag set but empty)

  1. 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.

View original on GitHub ↗