[BUG] Diff panel counts gitignored files, shows inflated line count

Resolved 💬 2 comments Opened Apr 6, 2026 by hunterthis Closed May 16, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Claude Code version: 2.1.87
Platform: Windows 11 Pro (10.0.26200)
Interface: Claude Code Web (claude.ai/code)
Node: v24.14.1

The diff panel in Claude Code's web UI shows files that are excluded by both .gitignore and ~/.gitignore_global. Git itself correctly ignores these files (git status reports a clean working tree, git check-ignore -v confirms all rules match), but the diff panel still counts them toward the "+N lines" indicator and lists them in "Files Changed."

Steps to reproduce:

Have files ignored via .gitignore or ~/.gitignore_global (e.g., .claude/, CLAUDE.md)
Confirm git status shows nothing to commit, working tree clean
Confirm git check-ignore -v matches all files to their ignore rules
Open the Diff panel in Claude Code web UI
The ignored files still appear in the file list and their lines are counted in the +N indicator

What Should Happen?

The diff panel should respect .gitignore and global gitignore rules. Files excluded by these rules should not appear in the diff panel or contribute to the line count.

Actual behavior:
The diff panel shows all files on disk that aren't committed to the current branch, regardless of gitignore rules. In this case, 3 ignored files (.claude/launch.json +11, .claude/settings.local.json +18, CLAUDE.md +6) are counted, inflating the diff. The "Review code" button also fails when the diff includes binary files (.docx) or too many files.

Additional context:

git ls-files --others --exclude-standard returns empty (correctly)
git ls-files --others returns the 3 files (confirming they exist on disk but are properly ignored)
Restarting Claude Code and rebooting the PC did not resolve the issue

Error Messages/Logs

Steps to Reproduce

Have files ignored via .gitignore or ~/.gitignore_global (e.g., .claude/, CLAUDE.md)
Confirm git status shows nothing to commit, working tree clean
Confirm git check-ignore -v matches all files to their ignore rules
Open the Diff panel in Claude Code web UI
The ignored files still appear in the file list and their lines are counted in the +N indicator

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.87

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗