PR widget diff stats include untracked files outside working directory scope
Description
The PR creation widget in Claude Code's UI shows diff stats (e.g., +78284 -1375) that appear to include untracked files from the entire repository, not just the changes relevant to the current work. This is confusing and potentially misleading when deciding whether to create a PR.
Steps to reproduce
- Work in a monorepo subdirectory (e.g.,
mr-esp32/speed-cal/) - Have large untracked files elsewhere in the repo (e.g.,
shared/pcb/with ~1.5MB of KiCad PCB files from a previous session) - Make a small, focused change (e.g., split one HTML file into three — net +40 / -1370 lines)
- Observe the PR widget at the bottom of the Claude Code UI
Expected behavior
The diff stats should reflect only the staged/committed changes relevant to the current branch vs. main, or at minimum only tracked changes. In this case, the actual committed change was +1410 -1370.
Actual behavior
The widget showed +78284 -1375, which includes ~1.5MB of untracked KiCad PCB files, .claude/ directories, and other unrelated untracked content from the broader monorepo. The -1375 was close to the real deletion count, but the +78284 was wildly inflated.
Impact
- Misleading diff size may cause hesitation about creating PRs
- May also contribute to context window pressure if Claude Code is loading these untracked files into context (speculative — a prior session on this same repo hit context limits unexpectedly fast on a straightforward task)
Environment
- Claude Code with Opus 4.6
- macOS Darwin 24.6.0
- Git monorepo with multiple subprojects
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗