claude-code - 💡(How to fix) Fix Mobile UI: 'Diff' counter accumulates per-tool-call instead of reflecting git state [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#54228Fetched 2026-04-29 06:32:52
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×3commented ×2closed ×1

The 'Diff +X -Y' badge shown above the response/PR-create area in Claude Code on iPhone counts the cumulative insertions/deletions of every Edit / Write tool call in the session, not the actual current git diff state.

Root Cause

The 'Diff +X -Y' badge shown above the response/PR-create area in Claude Code on iPhone counts the cumulative insertions/deletions of every Edit / Write tool call in the session, not the actual current git diff state.

Fix Action

Fix / Workaround

Workarounds

RAW_BUFFERClick to expand / collapse

Summary

The 'Diff +X -Y' badge shown above the response/PR-create area in Claude Code on iPhone counts the cumulative insertions/deletions of every Edit / Write tool call in the session, not the actual current git diff state.

Repro

  1. Edit a small file via Edit (e.g. add 1 line)
  2. Programmatically rewrite a large file via Write (1000 changed lines), then Bash: git restore <file> to revert
  3. Final git diff --stat shows only the small file changed (+1/-0)
  4. Mobile 'Diff' badge still shows +1001/-1000

Why it bites

In session, when Claude reverts an over-eager edit (common pattern: rewrite a JSON file, realize the formatter clobbered everything, restore + rewrite minimally), the counter still claims thousands of changes. Misleads the user into thinking the PR will be huge.

Expected

Counter should reflect the current working-tree diff against HEAD (git diff totals), not session-cumulative tool-call edits. That's what the user actually wants to know before committing/creating a PR.

Workarounds

  • Start a fresh session (/clear or app restart)
  • Run git diff --stat in the conversation manually

Environment

Claude Code mobile (iPhone), session in a git worktree.

Cross-reference

Reported via Claude Code session 2026-04-28.

extent analysis

TL;DR

Update the 'Diff +X -Y' badge to reflect the current git diff state instead of cumulative session edits.

Guidance

  • Investigate the current implementation of the 'Diff +X -Y' badge to understand how it calculates the cumulative insertions/deletions.
  • Consider using the git diff --stat command to get the actual current diff state and update the badge accordingly.
  • Review the session management to determine why the badge is not reset when a file is reverted using git restore.
  • Explore the possibility of adding an option to reset the badge when a revert operation is performed.

Example

No code example is provided as the issue does not contain sufficient information about the implementation details.

Notes

The current implementation of the 'Diff +X -Y' badge seems to be misleading, and updating it to reflect the current git diff state would provide a more accurate representation of the changes.

Recommendation

Apply a workaround, such as starting a fresh session or running git diff --stat manually, until a permanent fix can be implemented to update the 'Diff +X -Y' badge to reflect the current git diff state.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING