Skip to content

fix: support git worktree by using --git-common-dir for storage path#16

Closed
ushmz wants to merge 1 commit into
mainfrom
claude/fix-worktree-plugin-loading-d2Y3L
Closed

fix: support git worktree by using --git-common-dir for storage path#16
ushmz wants to merge 1 commit into
mainfrom
claude/fix-worktree-plugin-loading-d2Y3L

Conversation

@ushmz

@ushmz ushmz commented Feb 24, 2026

Copy link
Copy Markdown
Owner

In a git worktree, .git is a file (gitfile) pointing to the actual git
directory, not a directory itself. The previous implementation built the
storage path as git_root/.git/tabi, which tried to create a
subdirectory inside a file and caused an error on plugin load.

Fix by adding utils.get_git_common_dir() that calls
git rev-parse --git-common-dir, which correctly resolves both normal
repos (returns .git) and worktrees (returns the main repo's .git
directory as an absolute path). The storage path is now computed as
git_common_dir/tabi so worktrees share session data with the main
repository's .git directory.

https://claude.ai/code/session_01KDTT5rt4gAzW8BkPFmvA9G

In a git worktree, .git is a file (gitfile) pointing to the actual git
directory, not a directory itself. The previous implementation built the
storage path as `git_root/.git/tabi`, which tried to create a
subdirectory inside a file and caused an error on plugin load.

Fix by adding `utils.get_git_common_dir()` that calls
`git rev-parse --git-common-dir`, which correctly resolves both normal
repos (returns `.git`) and worktrees (returns the main repo's .git
directory as an absolute path). The storage path is now computed as
`git_common_dir/tabi` so worktrees share session data with the main
repository's .git directory.

https://claude.ai/code/session_01KDTT5rt4gAzW8BkPFmvA9G
@ushmz ushmz closed this Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants