[FEATURE] Improve diff view to show session changes only (exclude read files)
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
The diff button in Claude Code CLI (e.g., Diff +7490 -6880) currently displays misleading statistics that include all files touched during a session, not just files that were actually modified. This makes it nearly impossible to understand what Claude actually changed.
Current Behavior
When using Claude Code CLI:
A new session starts and creates a worktree with a new branch
Claude reads/analyzes multiple files to understand the codebase and build context
The diff view shows ALL files that were read OR modified during the session
Result: Diff shows thousands of lines changed (+7490 -6880) even when only a single small file was actually edited
Example:
Claude creates one test.txt file with 11 lines
Actual git diff: +11 lines, 1 file changed
Diff button shows: +7490 -6880 (entire project included)
Why This Is Problematic
Misleading numbers: Users can't trust the diff statistics to understand what changed
Poor change review: Impossible to quickly see what was actually modified
Confusing workflow: Users expect git-like behavior (changes since last commit), not session activity tracking
Safety concerns: Users can't confidently review changes before committing
Every session creates confusion: The worktree + branch approach means every new session shows massive diffs
Proposed Solution
Option 1: Track write operations only
Monitor only Write and Edit tool calls, not Read tool calls
Show diff stats based on actual file modifications
Label: "Session Changes: +11 -0 (1 file)"
Option 2: Rename and clarify
Rename "Diff" to "Session Activity"
Add tooltip: "Shows all files touched (read + written) during this session"
Add a separate "Changes Only" view
Option 3: Add filtering
Keep current behavior as default
Add toggle: "Show modified files only" vs "Show all touched files"
Let users choose their preference
Option 4: Align with git behavior
Show git diff statistics relative to the last commit
Match what users see in VS Code Source Control panel
Make it consistent with standard git workflows
i'd recommend option 1
Alternative Solutions
_No response_
Priority
Medium - Would be very helpful
Feature Category
Interactive mode (TUI)
Use Case Example
Example:
Claude creates one test.txt file with 11 lines
Actual git diff: +11 lines, 1 file changed
Diff button shows: +7490 -6880 (entire project included)
Additional Context
_No response_
6 Comments
Wrote a simple python project to solve this annoying issue: https://github.com/rubmz/claudehist
It's for PyCharm users.
After setup you can just prompt
/lastand it opens all the changes made in the prompt. The plugin also lists the history of recent prompts and what changes where made in each - to open it you prompt/historyA
PostToolUsehook on Edit/Write can maintain a running diff log:View all session changes:
cat /tmp/cc-session-diffs.patchFor a summary view:
I built diffpane to solve this. It runs in a split pane next to Claude Code and shows only files the agent actually modified, not files it read.
On startup it snapshots your current HEAD as the baseline, so you see cumulative session changes only. It also auto-follows new changes as they happen, no manual refresh needed.
!demo
<img width="1607" height="789" alt="Image" src="https://github.com/user-attachments/assets/6e314d1b-2285-4c76-bca2-4b22f9a6a7ec" />
it works perfectly now, i think this ticket should be closed
I'm still seeing thousands of lines changed (added/removed) despite not having any un-committed changes, let alone in session changes..
This resonates — when the diff says +7490/-6880 but you actually changed 11 lines, the number stops being a signal and becomes noise. The whole point of a diff is "here's what changed and what to look at," and read-inflated stats break exactly that.
Genuinely curious (not pitching): when you sit down to a batch of agent changes, do you enjoy reading through everything line-by-line to work out what really changed — or do you mostly just want the noise stripped out so you can trust it and merge fast?
Reason I ask — I'm working on a layer that does exactly that stripping: separating "what the agent actually changed and why it's safe" from everything it merely touched, so review is minutes not hours. Would love to hear how you review agent diffs today if that's a pain you hit often.