Add a way to collapse/hide file-diff output in the terminal transcript

Status Open
Maintainer reply None cached
Activity 7 comments · opened Jul 23, 2026

Feature request

When Claude Code (CLI) edits a file, the transcript shows the full line-by-line diff (added/removed lines) inline, with no way to collapse or hide it. Over a long session with many edits, this makes it hard to scan for just Claude's prose/commentary without scrolling past a lot of diff detail.

I checked the existing settings (reduce motion, verbose output, auto-scroll, etc.) and the Ctrl+O transcript toggle — none of these target diffs specifically. verbose / Ctrl+O toggle more detail on, not less; there's no setting that goes the other direction and collapses the diff view down to just the summary/commentary.

Requested behavior

A setting or keybinding to collapse individual file-edit diffs to a one-line summary (e.g. "Edited foo.ts — +12/-4") by default, with the option to expand a specific one on demand — similar to how some IDEs collapse diff hunks. Ideally:

  • A persistent config option (e.g. collapseDiffs: true) to set the default state
  • A keybinding to expand/collapse the diff under the cursor, or all diffs at once, without affecting the rest of the transcript's verbosity

Why this matters

It would let users follow along with what Claude is doing and thinking without needing to visually parse every diff hunk, especially during long sessions with many small edits — while still allowing a full expand when they do want to review the exact changes.

View original on GitHub ↗

3 Comments

mcarvalhosquadra · 1 month ago

+1 — this is a daily pain point for me. In long CLI sessions with many small edits (e.g. iterating on CSS, where each tweak is a 10-30 line hunk), the transcript becomes mostly diff output and Claude's actual commentary gets pushed off screen. I rarely review edits in the transcript itself — git diff covers that when I'm ready to commit.

A collapsed-by-default one-line summary ("Edited styles.css — +30/-2") with expand-on-demand would be exactly right. Ctrl+O doesn't help here since it's all-or-nothing and goes in the "more detail" direction only.

james-radweb · 23 days ago

Another vote, with a concrete shape for the collapsed state.

The summary line already rendered above each diff — Added 3 lines, removed 3 lines — is exactly the right collapsed form. Show just that, with a disclosure to expand the diff on demand.

My use case: I don't read the diffs in the terminal at all. I review the work in the commit afterwards. So in a long session they're pure scroll between me and Claude's actual reply, and I regularly miss what it said or asked because the response has gone past. Scrolling back to find it is awkward once a session is long.

Worth noting verbose output doesn't help here even when set to false — diffs render either way, so there's currently nothing that reduces this.

DylPorter · 18 days ago

+1, same reason. I don't read diffs in the terminal, I read them in the commit.

The collapsed version already exists in the binary though, it's just gated to the wrong files. It's in the Edit tool's renderToolResultMessage, which passes a collapsed prop into the shared diff component that Write's renderer uses too. When that prop is on you get "Added 3 lines, removed 3 lines" + the ctrl+o hint instead of the hunks. Today it only fires for memory-dir files and artifacts:

collapsed: !isPlanPath && (isMemoryDirFile(path) || isArtifactFile(path))

(identifier names reconstructed from the minified 2.1.228 build, but the shape is exact)

Nothing in /config, the CLAUDE_CODE_* env vars, or settings.json reaches that flag. So it's more exposing a boolean than building a feature.

Showing cached comments. Read the full discussion on GitHub ↗