Skip to content

Instantly share code, notes, and snippets.

@fadhlirahim
Created August 14, 2026 05:19
Show Gist options
  • Select an option

  • Save fadhlirahim/901fc0f5a33c229dc9cf453325d032a8 to your computer and use it in GitHub Desktop.

Select an option

Save fadhlirahim/901fc0f5a33c229dc9cf453325d032a8 to your computer and use it in GitHub Desktop.
When you have a directory created by a git worktree and you start the claude session on that directory, Claude code agent would not have memory of the main branch. Place this file inside ~/.claude/hooks/ and then update your ~/.claude/settings.json to use this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment