Hides the diff under successful Edit and Write tool rows

A Claude Code mod that hides the diff under successful Edit and Write tool rows. The row itself (Update(src/auth.ts), Write(src/new.ts)) stays as it is.
Still shown as normal:
Works in the terminal and in Claude Code for VS Code.
/plugin install collapse-diffs --marketplace Zimoholdijk/collapse-diffs
Answer y to add the marketplace, then pick a scope.
This mod uses Claude Code's early-access plugin API, which can change between releases. If diffs start showing again after an update, the API has likely moved.
claude plugin validate .
claude plugin test .hooks/register.tsx 21 lines1import type { Register } from 'claude-code'
2
3// A written change: an object with a patch, not held for review.
4const isWritten = (output: unknown) =>
5 typeof output === 'object' &&
6 output !== null &&
7 Array.isArray((output as { structuredPatch?: unknown }).structuredPatch) &&
8 (output as { staged?: boolean }).staged !== true
9
10export const register: Register = on => {
11 for (const tool of ['Edit', 'Write']) {
12 on('ui.render', { component: 'ToolResult', props: { tool } }, async ($, e, next) => {
13 if (e.props.isErrored || !isWritten(e.props.output)) {
14 return next(e)
15 }
16 const { Box } = $.ui.resolve(e)
17 return <Box />
18 })
19 }
20}
21