[Bug] Claude reads from main repo path instead of git worktree when memory namespace matches main repo

Status Closed — duplicate
Reported on v2.1.92
Maintainer reply None cached
Activity 3 comments · opened Apr 14, 2026 · closed Apr 18, 2026

Bug Description
Claude reads from main repo path instead of git worktree when memory namespace matches main repo

When Claude Code is launched from a git worktree (e.g. ~/code/starburst-enterprise/tmp-cli), the session's Primary working directory correctly reflects the worktree path. However, the memory namespace is named after the main repo root (e.g. -starburst-enterprise), and Claude
incorrectly uses the memory namespace path to infer file locations rather than the Primary working directory from the session context.

Steps to reproduce:

  1. Have a git repo at ~/repos/main-repo
  2. Create a worktree at ~/repos/main-repo-worktree
  3. Launch claude from within the worktree
  4. Ask Claude to read a file — it attempts to read from ~/repos/main-repo instead

Expected: Claude uses Primary working directory (the worktree path) for all file operations.

Actual: Claude uses the memory directory name (derived from the main repo path) to construct file paths.

Workaround: User must explicitly correct Claude; it then works correctly for the rest of the session.

Environment Info

  • Platform: darwin
  • Terminal: tmux
  • Version: 2.1.92
  • Feedback ID: 816e00ab-5100-444e-8b51-78af20b0bba2

Errors

<i scrubbed this manually since there was no relevant content here>

Note: Content was truncated.

View original on GitHub ↗

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