modscode / Gallery / convo-diff
convo-diff
只看這個對話改過、還沒 commit 的檔案 diff:每個檔案跟它在這個對話第一次被改之前的內容比,commit 過就改跟那次 commit 比,不混進別的對話或手動的修改,PowerShell 改的也算;也能切到「整段對話」只看不還原;每個檔案可以一鍵請 Claude 在對話裡解釋改動,或還原(不會倒掉已經 commit 的);桌面版在輸入框上方有按鈕直接打開
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)
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.
plugins/convo-diff/hooks/register.tsxlines 1117–1268plugins/convo-diff/hooks/register.tsxlines 1272–1290
What its code calls
runs programswrites filesdrives Claudetool callsremembers
The design, read from code
BashBashBashBashBashBashBashBashBashDrawn 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 read | Every module hooks/hooks.json names was read.plugins/convo-diff/hooks/register.tsx |
| Parses | Every file parses as TypeScript or JavaScript.3 files parsed |
| All its code is in the mod | Every import is a file of the mod or the engine's own module; no packages, no require.all its code is in the mod |
| Readable | No 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 open | Network 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 draws | The 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 line | Whether 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 Windows | Whether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).runs no program a Windows PC lacks |
| Network | Whether every fetch names its https host in the code.no network |
| Programs | Whether 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 sends | Whether it both reads files or environment variables and reaches the network.reads files and reaches the network |
| Keys in the source | Whether the source holds what looks like an API key or a private key.no keys in the source |
| Licence | An 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-modsThis 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 itSearch them from Claude: the MCP connector
Similar designs
-
Ask Claude…AttemptsPlain3 attempts from src/ · nothing is applied until you press AdoptDiff of StealthHide+ src/app.ts
Footer label+ src/app.tsFooter label+ src/app.tsClassic more files not shown: open the worktree to see them.Footer labelClose x -
Ask Claude…CIcross Bash · Classicmain · a1b2c3d · failed at 14:32Open the run on GitHubFix it fClose x
(no log available)
-
Ask Claude…Gitbranch main · Pinned notice · 0, 0 untracked, 0 staged× git failed► Hint lineRefresh rStage all aCommit Ghost cClose xWorking tree clean.Fix loginMonoGenerate gCommitTop rowHint linesrc/app.tsbinDiffStageUnstageRevertTop rowHint linesrc/app.tsbinDiffStageUnstageRevertTop rowHint line… 3 moresrc/app.tsbinDiffStageUnstageRevertsrc/app.tsClosebuild (cut to fit)
Plainbuild (cut to fit)Plainbuild (cut to fit)MinimalMinimalMinimalPlain -
Ask Claude…Night shiftNight shiftEach task ran in its own worktree and branch; nothing is in your checkout until you press Adopt.Diff of Fix loginHide diff+ src/app.ts
Edit+ src/app.tsEdit+ src/app.tsAgent more files not shown: open the worktree to see them.EditClose x -
Ask Claude…⏱ time machine onHeatproject · Heat3 Claude turns since 2h 10m · size: lines changedUndo these 3Undo these 3Undo these 3↑ Up bOpen in browser oTime machine██Edit██Edit██Edit…and 3 moreWritesrc/app.ts×No closed Claude turn changed it in this window.EditEditEdit[Open the interactive map](src/app.ts)
-
Ask Claude…2h 10m · █████░░░✓ build ✓ build ✓ buildJavaKotlin3 Python■ ok 3 ■ ok 3 ■ ok 3 Razor proven 3 Razor proven 3 Razor proven 3Phases ──────── 3/3build Pythonbuild Pythonbuild Python… 3 more phasesLua ──────── 3/Kotlin■ the whole upgrade Ruby■ build build Ruby■ build build Ruby■ build build Ruby … 3 moreNext ──────── PythonRuby (by hand)Podsclick a button, or ctrl+x tab then Tab, EnterAttention ──────── 3! Scala ! Scala ! Scala … 3 moreSession ──────── okJava