ClaudeMods
☰
ZH-TW
● — 人在線上 · 瀏覽 — 次
贊助提交作品
GitHub 儲存庫 · 發布者 WaretaGarasu

我做了一個 Claude Code 模組,能顯示每一輪改了什麼,並讓你從中還原單一檔案

Reddit 上展示了 Changes,這是一個 Claude Code 模組,它新增了一個 /changes 窗格,按輪次顯示檔案編輯時間軸,包含每個檔案的差異以及一個需按兩次的 Revert,可將單一檔案還原到該輪之前的狀態;還有一個配套的 Receipts,用於在最後一次編輯後驗證聲稱的測試執行。兩者都是本機執行、MIT 授權,並可透過 /plugin 從 candygoogy/notary 市集安裝。

已翻譯

關於這個 mod

Changes 在對話記錄旁新增了一個窗格,按最新輪次優先列出工作階段時間軸,包括觸及檔案的 tool calls 和子代理,並顯示每個檔案的差異(包括新檔案)以及 Keep/Revert 控制項。Revert 會將單一檔案還原到該輪之前的狀態,需要按兩次,而且只有在檔案與 Claude 留下的內容相符時才會寫入;接著 Claude 會收到一則隱藏提示,讓它重新讀取該檔案。還原是依檔案而非依區塊,歷史記錄涵蓋一次對話,shell 命令的變更僅在 git 儲存庫內被追蹤。配套的 Receipts 會在 Claude 最後一次編輯後檢查實際執行了什麼,當它聲稱測試通過時,如果失敗會將其送回一次。在 Claude Code 2.1.287+ 上使用 /plugin install changes --marketplace candygoogy/notary 和 /plugin install receipts --marketplace candygoogy/notary 安裝。儲存庫:https://github.com/candygoogy/notary

安裝

安裝方式請查看原始來源。

原文 / README

When Claude works through a long task, I often want to answer "what did turn 12 change, and can I undo just that one file?" /diff shows the whole working tree, and /rewind goes back to an earlier point for every file at once. So I built Changes, a Claude Code mod. Not staged: ordinary prompts, one file reverted, and Claude notices. /changes opens a pane next to the transcript: - a timeline of the session, newest turn first, with the tool calls and subagents that changed files; - each file's diff, including new files' contents; - Keep and Revert per file. Revert puts the file back the way it was before that turn. It takes two presses, and it only writes if the file is exactly what Claude left, so it won't silently overwrite your own edits. Afterwards Claude gets a hidden note, so it re-reads the file instead of editing from memory. In the GIF, it notices the revert and points out that its test no longer matches. Nothing in that run is staged. Limits, up front: reverts are per file, not per hunk. The history covers one conversation (/clear starts it fresh). Changes made by shell commands are tracked only inside a git repo. It ships with a companion, Receipts. When Claude says "all tests pass", Receipts checks what it actually ran after its last edit, and sends it back once if the tests failed. It's quiet by default. On my 105 real sessions, it would have shown 5 warnings, no ❌, and never sent Claude back. Both are local only: no network, no telemetry, no model calls (Receipts has an opt-in "smart check" that asks a model; it's off by default). Built and used on Windows, with CI on Windows, macOS and Linux. MIT. Install (Claude Code 2.1.287+): /plugin install changes --marketplace candygoogy/notary /plugin install receipts --marketplace candygoogy/notary It's v0.1. The most useful bug report is a revert that wrote the wrong bytes, or a refusal whose reason didn't make sense. Repo: https://github.com/candygoogy/notary submitted by /u/WaretaGarasu to r/ClaudeAI [link] [comments]

更多類似作品