Tatendaz/T-mods/tree/main/fold-edits
fold-edits
Edit、Write、NotebookEdit の diff を表示/非表示ボタン付きの1行に折りたたみ、テーマ対応の色と 10,000 文字超の diff 分割を備えた Claude Code パッチ。
この mod について
fold-edits は、すべての Edit と Write 呼び出しの下に表示される完全な diff を、1行の概要と開くための show diff ボタンに置き換えます。長い diff の上下には hide ボタンを表示します。Edit、Write、NotebookEdit の結果に影響します(失敗した編集はそのまま)。scratchpad の編集のような編集だけのグループも対象ですが、読み取りや shell コマンドを含む混在グループは変更しません。10,000 文字を超える diff は正しい行番号を付けて複数のブロックに分割されます。ボタンの文字色はテーマから選び(暗いテーマでは濃い緑 #116329、明るいテーマでは明るい緑 #aceebb)、フォールバックは濃い緑です。リポジトリには README のテーマ画像を生成する Python スクリプトとテストコマンド `claude plugin test ~/.claude/mods/fold-edits が含まれます。
インストール
まず作者の README で marketplace とプラグイン名を確認してください。コマンドはリポジトリの構成によって変わる場合があります。
claude plugin marketplace add Tatendaz/T-mods claude plugin install fold-edits
原文 / 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.
