ClaudeMods
☰
EN
● 0 online · Views 0 times
SponsorsSubmit a project
GitHub repositories · by Tatendaz

fold-edits

Claude Code patch that folds Edit, Write and NotebookEdit diffs into one line with show/hide buttons, theme-aware colors, and split handling for diffs over 10,000 characters.

Tatendaz@Tatendaz

Tatendaz/T-mods/tree/main/fold-edits

Translated

About this mod

fold-edits replaces the full diff printed under every Edit and Write call with a single summary line and a show diff button that opens it, with hide buttons above and below long diffs. It affects Edit, Write and NotebookEdit results (failed edits are left untouched) and edit-only groups such as scratchpad edits, while mixed groups with reads or shell commands are left alone. Diffs longer than 10,000 characters split into several blocks with correct line numbers. Button text color is chosen from the theme (dark green #116329 on dark themes, light green #aceebb on light themes), falling back to dark green. The repo includes Python scripts to generate the README theme images and a test command: claude plugin test ~/.claude/mods/fold-edits.

Installation

Check the author's README for the marketplace and plugin name first. Commands may change as the repository evolves.

claude plugin marketplace add Tatendaz/T-mods
claude plugin install fold-edits
Original text / README

fold-edits

Claude Code prints the full diff under every Edit and Write call. A long session fills the screen with code you did not ask to read.

This mod replaces each diff with one line and a button that opens it:

<picture> <source media="(prefers-color-scheme: dark)" srcset="docs/fold-edits-dark.svg"> <img alt="fold-edits: an edit folded to one line with a green show diff button, then opened with hide buttons above and below the diff" src="docs/fold-edits-light.svg"> </picture>

Click show diff to open the diff. Click hide to fold it again. When the diff is open, a hide button sits at both the top and the bottom, so you do not have to scroll back up on a long diff.

What it changes

  • Edit, Write and NotebookEdit results. A failed edit is left as Claude Code draws it.
  • Groups that hold only edits, such as Claude Code's "Made 1 scratchpad edit" line. A group that mixes edits with reads or shell commands is left alone.

A diff longer than 10,000 characters, the limit for one code block, is split into several blocks. Line numbers stay correct across the split.

Button color

A plugin cannot set a button's text color, so the mod picks the green behind the text from your theme:

  • Dark themes get #116329, with light text on top.
  • Light themes get #aceebb, with dark text on top.

If the mod cannot read the theme setting, it uses the dark green.

Images

docs/make_svgs.py draws the two README images, one per theme. GitHub shows the one that matches the reader's theme. Run it again after a change to how the mod looks.

Tests

claude plugin test ~/.claude/mods/fold-edits

The tests cover the summary line, opening and closing the diff, both button colors, diff splitting, edit-only groups, and leaving other tools alone.

Similar projects