[FEATURE] Group diff files by directory with collapse-by-default option (Desktop)

Resolved 💬 1 comment Opened Apr 29, 2026 by myBingk Closed May 31, 2026

Problem

In Claude Code Desktop, the "working tree" diff panel displays all changed files as a flat, fully-expanded list. For sessions that touch many files across several modules, this makes it hard to:

  • Grasp the structural scope of a change at a glance
  • Navigate to the directory I actually want to review
  • Skim a large changeset without scrolling through every diff body

Use Case

I work in a multi-module Java/Maven project. A typical Claude Code session might modify 15–30 files across 5+ modules (e.g. order/, payment/, marketing/, common/). The current flat list with every diff expanded forces a lot of scrolling before I can understand what areas changed.

Proposed Solution

Two related improvements to the Desktop diff view:

  1. Group by directory — render changed files in a collapsible tree keyed on parent directory, e.g.

``
▸ order/ (4 files)
▸ payment/ (2 files)
▸ common/util/ (1 file)
``
Clicking a group toggles its children.

  1. Collapse by default — a setting (e.g. diff.collapseByDefault: true) so file diffs start collapsed and expand on click. Pairs naturally with directory grouping: open a folder, then open the file you care about.

Alternatives Considered

  • A flat list with a "collapse all" button — works, but requires an extra click on every session.
  • Sorting by path without grouping — partial improvement; doesn't reduce visual noise.
  • Filter-by-prefix — discoverable only if you know what to type.

Related Issues

  • #37584 (collapse diffs by default — closed as duplicate)
  • #52179 (Desktop diff uncommitted changes — closed as duplicate)

Combining grouping + collapse in one setting feels like the natural place both threads were pointing at.

Environment

  • Claude Code Desktop (macOS 14.5)
  • Claude Code version: 2.1.119

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗