[BUG] Diff panel (2.1.260) lists sandbox-unreadable files as changed, showing text files as "Binary file - cannot display diff"

Status Open
Reported on v2.1.260
Maintainer reply None cached
Activity 2 comments · opened Sep 4, 2026

Environment

  • Claude Code v2.1.260 (terminal, fullscreen mode with the new diff panel)
  • macOS (Darwin 25.6.0)

Description

The new diff panel added in 2.1.260 lists every tracked file in a directory the sandboxed Claude Code process cannot read as "changed", and renders each one as "Binary file - cannot display diff" — including plain .md and .json files. None of the files are actually modified: git status / git diff in a regular terminal show a clean tree.

In my repo, one tracked directory holds exactly 170 markdown/JSON files that sandboxing blocks Claude Code from reading — every access from inside the session, even a plain stat, fails with Operation not permitted (EPERM). The panel header reads "170 files changed", matching that directory's tracked-file count exactly. The rest of the repo reads fine and does not appear in the panel.

Steps to reproduce

  1. Have a repo with a tracked directory that the Claude Code process cannot read (EPERM on stat/open due to sandboxing), while the working tree is clean.
  2. Start a session in that repo in fullscreen mode so the diff panel opens.
  3. The panel lists every tracked file in the unreadable directory as changed, each shown as "Binary file - cannot display diff".

Expected

Files that are unreadable but unmodified should not be listed as changed. If the panel cannot read a file to diff it, it should show a read-error state (e.g. "cannot read file") rather than reporting it as a changed binary file.

Actual

  • Panel header: "170 files changed" on a clean working tree.
  • Every listed file (plain .md/.json) renders as "Binary file - cannot display diff".

Additional notes

  • Inside the session, git status --porcelain -- <dir>/ prints Operation not permitted for every file, while git ls-files <dir>/ (index-only) works and returns exactly 170 paths — the same count the panel reports.
  • The EPERM persists even when running the Bash tool with sandbox disabled for the command.
  • git status in a regular terminal (outside Claude Code) reports the tree clean and reads the same files without error.
  • Distinct from #89395 (panel git cwd) and #81310 (TCC-protected session roots): here the session root is readable and only one tracked subdirectory is blocked, and the symptom is false "changed"/"binary" entries rather than a failure to read the worktree.

View original on GitHub ↗

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