SLOPSHOPPER

collapse-diffs

Hides the diff under successful Edit and Write tool rows

newrows
v0.1.0MITupdated 2026-10-09Zimoholdijk/collapse-diffs
A shopper browsing a rack in a slop shop
README

collapse-diffs

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:

  • a call that errored, with its error text
  • a change held for review instead of written
  • any result the mod doesn't recognise

Works in the terminal and in Claude Code for VS Code.

Install

/plugin install collapse-diffs --marketplace Zimoholdijk/collapse-diffs

Answer y to add the marketplace, then pick a scope.

Note

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.

Develop

claude plugin validate .
claude plugin test .
Source 1 files
hooks/register.tsx 21 lines
1import 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