[BUG] `post-checkout` git hook does not fire when Claude creates a worktree

Resolved 💬 2 comments Opened May 10, 2026 by noheltcj Closed May 21, 2026

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 Claude Desktop creates a worktree, the git post-checkout hook does not fire. The same hook fires correctly when a worktree is created via claude --worktree in the CLI.

This is distinct from existing issues calling out that WorktreeCreate / Remove are not firing as it's referring to native worktree hooks supported by the CLI.

What Should Happen?

Git post-checkout should fire after Desktop creates a worktree, consistent with CLI behavior and with what native git worktree add and claude --worktree does.

Error Messages/Logs

(no error — the hook is silently skipped; the worktree is created without a post-checkout invocation)

Steps to Reproduce

  1. In a project with a post-checkout hook configured (e.g., via core.hooksPath = .githooks), executing something like touch post-checkout-executed so invocations are observable via the presence of the file at the root of the worktree.
  2. Confirm the hook fires via CLI: run claude --worktree <name> and observe the file exists.
  3. Open the same project in Claude Desktop and create a new worktree session.
  4. Observe that no file was written and post-checkout was never called.

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.126 (Claude Code) and Claude 1.6608.2 (ebf1a1) 2026-05-08T23:17:27.000Z

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

I ran into this while building noheltcj/loadout, a tool that manages composable agent guidance. A post-checkout hook (via core.hooksPath) is required whenever a branch switch or worktree creation occurs so the tool can sync. Because Desktop-created worktrees never trigger native hooks, the agent starts without a CLAUDE.md file in memory.

noheltcj/loadout#33 was planned, but given the existing issues related to WorktreeCreate not firing, this likely won't suffice as a workaround.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗