modscode JA

modscode / Gallery / convo-diff

convo-diff

只看這個對話改過、還沒 commit 的檔案 diff:每個檔案跟它在這個對話第一次被改之前的內容比,commit 過就改跟那次 commit 比,不混進別的對話或手動的修改,PowerShell 改的也算;也能切到「整段對話」只看不還原;每個檔案可以一鍵請 Claude 在對話裡解釋改動,或還原(不會倒掉已經 commit 的);桌面版在輸入框上方有按鈕直接打開

Code you can checkTerminal + desktopPaneBandStatus lineToastBoxButtonCodeText

What it does

  • Draws a pane, a band above the prompt, toasts in the desktop app
  • Watches Bash, PowerShell calls and can refuse them
  • Hooks session.end, session.start, turn.complete, turn.start and 1 more
  • Keeps its own state between turns
  • Starts processes

Good points

  • No network calls
  • Written in TypeScript
  • Has a desktop-specific branch
  • Handles errors

Code to start from

Two kinds: a starter modscode writes from the design above, and the lines of the mod's own code that draw it.

Starter (register.tsx)

register.tsx
import type { Register } from 'claude-code'

// Drawn like convo-diff by Open01277 (pane, band, status, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/open01277-convo-diff/
// Written by modscode from that reading, not copied from the mod: use it as you like.
// Each value below stands for one the mod works out at run time; put in your own.
export const register: Register = on => {
  // the pane: open it with $.ui.open({ id: 'my-pane', title: "對話 diff" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Button, Code } = $.ui.resolve(e)
    const title = '…'
    const length = '…'
    const map = '…'
    const arrow = '…'
    const rel = '…'
    const STATUS_LABEL = '…'
    const added = '…'
    const removed = '…'
    const question = '…'
    const note = '…'
    const piece = '…'
    const hiddenLines = '…'
    const STATUS_LABEL2 = '…'
    const question2 = '…'
    const note2 = '…'
    const STATUS_LABEL3 = '…'
    const question3 = '…'
    const note3 = '…'
    return (
      <Box flexDirection="column">
        <Box flexDirection="row" flexWrap="wrap" columnGap={1}>
          <Text bold>
            {title}
          </Text>
          <Text color="success">
            +0
          </Text>
          <Text color="error">
            -0
          </Text>
          <Button label="只看還沒 commit 的" />
          <Button label="重新整理" />
          <Button label="全部收合" />
          <Button role="dismiss" label="關閉" />
        </Box>
        <Text dimColor>
          整段對話:每個檔案跟這個對話第一次改它之前比,commit 過的也算。這裡只能看,要還原請切回「只看還沒 commit 的」。
        </Text>
        <Text dimColor wrap="truncate-end">
          {`已經 commit、之後沒再改(${length}):${map}`}
        </Text>
        <Box flexDirection="column" marginTop={1}>
          <Box flexDirection="row" flexWrap="wrap" columnGap={1}>
            <Button plain label={`${arrow} ${rel}`} />
            <Text>
              {STATUS_LABEL}
            </Text>
            <Text color="success">
              {`+${added}`}
            </Text>
            <Text color="error">
              {`-${removed}`}
            </Text>
            <Text dimColor>
              (跟上次 commit 比)
            </Text>
            <Button label="解釋" />
            <Button label="還原" />
            <Button label="復原" />
          </Box>
          <Box flexDirection="row" flexWrap="wrap" columnGap={1}>
            <Text color="warning">
              {question}
            </Text>
            <Button variant="primary" label="確定刪除" />
            <Button label="取消" />
          </Box>
          <Text dimColor>
            {note}
          </Text>
          <Box flexDirection="column">
            <Text dimColor wrap="truncate-end">
              {`${arrow} ${rel}(續)`}
            </Text>
            <Code source={`${piece}`} format="diff" />
          </Box>
          <Box flexDirection="column">
            <Text dimColor wrap="truncate-end">
              {`${arrow} ${rel}(續)`}
            </Text>
            <Code source={`${piece}`} format="diff" />
          </Box>
          <Box flexDirection="column">
            <Text dimColor wrap="truncate-end">
              {`${arrow} ${rel}(續)`}
            </Text>
            <Code source={`${piece}`} format="diff" />
          </Box>
          <Text dimColor>
            {`… 還有 ${hiddenLines} 行 diff 太長沒顯示`}
          </Text>
          <Text dimColor>
            (這個檔案的 diff 太長,先收合上面幾個檔案再看它)
          </Text>
        </Box>
        <Box flexDirection="column" marginTop={1}>
          <Box flexDirection="row" flexWrap="wrap" columnGap={1}>
            <Button plain label={`${arrow} ${rel}`} />
            <Text>
              {STATUS_LABEL2}
            </Text>
            <Text color="success">
              {`+${added}`}
            </Text>
            <Text color="error">
              {`-${removed}`}
            </Text>
            <Text dimColor>
              (跟上次 commit 比)
            </Text>
            <Button label="解釋" />
            <Button label="還原" />
            <Button label="復原" />
          </Box>
          <Box flexDirection="row" flexWrap="wrap" columnGap={1}>
            <Text color="warning">
              {question2}
            </Text>
            <Button variant="primary" label="確定刪除" />
            <Button label="取消" />
          </Box>
          <Text dimColor>
            {note2}
          </Text>
          <Box flexDirection="column">
            <Text dimColor wrap="truncate-end">
              {`${arrow} ${rel}(續)`}
            </Text>
            <Code source={`${piece}`} format="diff" />
          </Box>
          <Box flexDirection="column">
            <Text dimColor wrap="truncate-end">
              {`${arrow} ${rel}(續)`}
            </Text>
            <Code source={`${piece}`} format="diff" />
          </Box>
          <Box flexDirection="column">
            <Text dimColor wrap="truncate-end">
              {`${arrow} ${rel}(續)`}
            </Text>
            <Code source={`${piece}`} format="diff" />
          </Box>
          <Text dimColor>
            {`… 還有 ${hiddenLines} 行 diff 太長沒顯示`}
          </Text>
          <Text dimColor>
            (這個檔案的 diff 太長,先收合上面幾個檔案再看它)
          </Text>
        </Box>
        <Box flexDirection="column" marginTop={1}>
          <Box flexDirection="row" flexWrap="wrap" columnGap={1}>
            <Button plain label={`${arrow} ${rel}`} />
            <Text>
              {STATUS_LABEL3}
            </Text>
            <Text color="success">
              {`+${added}`}
            </Text>
            <Text color="error">
              {`-${removed}`}
            </Text>
            <Text dimColor>
              (跟上次 commit 比)
            </Text>
            <Button label="解釋" />
            <Button label="還原" />
            <Button label="復原" />
          </Box>
          <Box flexDirection="row" flexWrap="wrap" columnGap={1}>
            <Text color="warning">
              {question3}
            </Text>
            <Button variant="primary" label="確定刪除" />
            <Button label="取消" />
          </Box>
          <Text dimColor>
            {note3}
          </Text>
          <Box flexDirection="column">
            <Text dimColor wrap="truncate-end">
              {`${arrow} ${rel}(續)`}
            </Text>
            <Code source={`${piece}`} format="diff" />
          </Box>
          <Box flexDirection="column">
            <Text dimColor wrap="truncate-end">
              {`${arrow} ${rel}(續)`}
            </Text>
            <Code source={`${piece}`} format="diff" />
          </Box>
          <Box flexDirection="column">
            <Text dimColor wrap="truncate-end">
              {`${arrow} ${rel}(續)`}
            </Text>
            <Code source={`${piece}`} format="diff" />
          </Box>
          <Text dimColor>
            {`… 還有 ${hiddenLines} 行 diff 太長沒顯示`}
          </Text>
          <Text dimColor>
            (這個檔案的 diff 太長,先收合上面幾個檔案再看它)
          </Text>
        </Box>
        <Text dimColor>
          {`… 還有 ${length} 個檔案沒列出來`}
        </Text>
      </Box>
    )
  })

  // the band above the prompt; what else goes there is drawn under it
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    const { Box, Button } = $.ui.resolve(e)
    return (
      <Box flexDirection="column">
        <Box flexDirection="row" alignItems="flex-start" columnGap={2}>
          <Box flexDirection="column" flexGrow={1} flexShrink={1} />
          <Button label="對話 diff(都 commit 了)" />
        </Box>
        {await next(e)}
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    const rel = '…'
    const reasonOf = '…'
    await $.ui.toast(`Claude 這回合結束後會解釋 ${rel}`)
    await $.ui.toast(`沒辦法送出解釋的問題:${reasonOf}`)
    return next(e)
  })
}

The mod's own code

Its licence text was not found at the commit read, so only the places in the source are linked.

What its code calls

runs programswrites filesdrives Claudetool callsremembers

The design, read from code

Drawn from the mod's source at the commit read, not from a run: a list is drawn three times, a condition takes its first branch that draws in the desktop app, and a value only the run time knows is shown as a made-up sample (dotted underline) or left out. Colours and type are this site's.

What its code shows

Read from the source at commit 349a00e7a2ba on 2026-10-06. The first group decides whether a mod is listed; the rest is for you to weigh. A later commit is not read until the next crawl.

Decides the listing: code you can check
Entry readEvery module hooks/hooks.json names was read.plugins/convo-diff/hooks/register.tsx
ParsesEvery file parses as TypeScript or JavaScript.3 files parsed
All its code is in the modEvery import is a file of the mod or the engine's own module; no packages, no require.all its code is in the mod
ReadableNo minified lines, no eval or new Function, no import of a computed path, no encoded blobs.no minified code, no eval, no encoded blobs
Calls in the openNetwork and programs are reached as $.http.fetch and $.process.run in place, never passed around.every call outside goes through $ in the open
For you to weigh before installing
Where it drawsThe terminal, the desktop app, both, or nothing (hooks only: a guard or a prompt rewriter), as its code says. Shown, never a reason to leave a mod out.draws in the terminal and the desktop app, the same in both
Install lineWhether its repository's own .claude-plugin/marketplace.json lists it, so it installs from that marketplace with the lines on its page.listed in its repository's .claude-plugin/marketplace.json: installs from there
Programs on WindowsWhether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).runs no program a Windows PC lacks
NetworkWhether every fetch names its https host in the code.no network
ProgramsWhether every program it starts is named in the code and is not a shell, an interpreter or a network tool.plugins/convo-diff/hooks/register.tsx:389 a program named at run time; plugins/convo-diff/hooks/register.tsx:688 a program named at run time; plugins/convo-diff/hooks/register.tsx:695 a program named at run time
Reads and sendsWhether it both reads files or environment variables and reaches the network.reads files and reaches the network
Keys in the sourceWhether the source holds what looks like an API key or a private key.no keys in the source
LicenceAn open licence (MIT, Apache-2.0, BSD, ISC, Unlicense, 0BSD, CC0) with its text lets modscode show its code; otherwise the code is linked.no licence

This is a reading of the code text, not a security review: it does not run the mod, and it cannot see what a program the mod starts does. The check before installing is yours. How mods are chosen

Install it

Check it yourself before you install it. Mods run unsandboxed, with your permissions, and modscode does not vouch for what this code does. Read the code below (or run claude plugin validate . in its folder), weigh what it reaches, and install the commit you read.

Its repository is its marketplace. Add that marketplace (in the terminal with these commands, or in the desktop app's plugin settings) and install the mod from it:

/plugin marketplace add Open01277/claude-mods
/plugin install convo-diff@claude-mods

This installs the marketplace's latest commit, which may not be the one read here (349a00e7a2ba). Compare them before you install.

Ask Claude about it

With the modscode connector added, Claude can read this design, what its code reaches and its code, and build on them. Ask it like this:

Read the modscode design "open01277-convo-diff" with its code and make me a pane like it

Search them from Claude: the MCP connector

Similar designs