Summary
The git diff / "Create PR" panel computes its +/− against origin/main but labels the base as main → working tree, and it silently sums three distinct git states into one number. A clean working tree (with one unpushed commit + some untracked files) reads as a large pile of uncommitted changes, which looks like bogus data.
Environment
- Claude Desktop app: 1.11187.1
- macOS: 15.6.1 (build 24G90)
- Surface: Claude Code git panel inside the Claude Desktop app
Repro
- On a branch where local
main is ahead of origin/main by ≥1 committed-but-unpushed commit.
- Have a few untracked files in the working tree.
- Open the git/diff panel.
Actual
- Banner showed
+1,067 −507 with a diff panel listing files that were already committed locally.
git status was clean of tracked changes, so the panel appeared to show phantom edits.
- Breakdown of that number:
+6 −507 from the unpushed commit, +1,061 from untracked files — i.e. the diff base was origin/main, not the working tree.
Root-cause UX problems
- Undisclosed diff base. Header says
main → working tree, but the real base is origin/main. Diffing local HEAD→working tree would be empty. Calling the remote tracking branch just "main" is ambiguous when local main is ahead.
- Local-vs-remote state is never surfaced. Ahead/behind (
main...origin/main [ahead N]) — the key fact for reading the panel — isn't shown anywhere.
- Three states collapsed into one count: unpushed commits + staged + unstaged + untracked are summed under a single
+/−.
- Untracked files inflate the count with no visual indication they're untracked.
Suggested fixes
- Show and allow customizing the diff base (e.g.
origin/main → working tree).
- Surface ahead/behind status (
↑1 ↓0).
- Break the
+/− into unpushed commits / staged / unstaged / untracked sections, like git status.
- Visually distinguish untracked files from edits.
Summary
The git diff / "Create PR" panel computes its
+/−againstorigin/mainbut labels the base asmain → working tree, and it silently sums three distinct git states into one number. A clean working tree (with one unpushed commit + some untracked files) reads as a large pile of uncommitted changes, which looks like bogus data.Environment
Repro
mainis ahead oforigin/mainby ≥1 committed-but-unpushed commit.Actual
+1,067 −507with a diff panel listing files that were already committed locally.git statuswas clean of tracked changes, so the panel appeared to show phantom edits.+6 −507from the unpushed commit,+1,061from untracked files — i.e. the diff base wasorigin/main, not the working tree.Root-cause UX problems
main → working tree, but the real base isorigin/main. Diffing localHEAD→working tree would be empty. Calling the remote tracking branch just "main" is ambiguous when localmainis ahead.main...origin/main [ahead N]) — the key fact for reading the panel — isn't shown anywhere.+/−.Suggested fixes
origin/main → working tree).↑1 ↓0).+/−into unpushed commits / staged / unstaged / untracked sections, likegit status.