[Bug] /diff command incompatible with worktrees

Status Open
Reported on v2.1.280
Maintainer reply None cached
Activity 3 comments · opened Sep 23, 2026

Bug Description
/diff doesn't work with worktrees.

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 2.1.280
  • Feedback ID: 7d40f0e5-53c2-4b97-8b4f-87ef860fd6e9

Errors

[]

View original on GitHub ↗

3 Comments

asazernik · 17 days ago

Repro steps that worked for me:

  1. Create a secondary worktree git worktree add
  2. Run claude in the secondary worktree
  3. Edit some file
  4. run /diff in the Claude Code instance.

The diff pane should open, with a message:

Diff unavailable Couldn't read the git diff - it will retry on the next change
gscokart · 6 days ago

It is not specific to macos. I have the same issue on linux ubuntu. It looks like the /diff show the diff of the master worktree in my case.

gscokart · 6 days ago

My case is maybe more related to https://github.com/anthropics/claude-code/issues/89395.

I launch claude agents from the root worktree, from there I launched a separate agents with its own worktree. When attaching terminal to this agent (enter on the session from the sessions view), the /diff view stay on the root worktree.

Running a separate claude from the worktree dir, or even claude --worktree from the root show the diff