ClaudeMods
☰
ZH-CN
● 0 人在线 · 浏览 0 次
赞助提交作品
Reddit 帖子 · 发布者 Weary-Net1650

我制作了一个支持多仓库、感知工作树的 diff 查看器作为 Claude Code mod,因为 /diff 总是漏掉改动

一个名为 Repo(MIT)的 Claude Code mod,增加 /multi-diff 面板,用于跨多个仓库和工作树查看 diff,提供五种比较模式、会话开始时的 git 快照,以及文件树和高亮 diff 查看器。

已翻译

关于这个 mod

作者发现 /diff 会漏掉 Python 或 shell 脚本产生的改动,在非 git 文件夹中也什么都不显示,于是制作了一个支持多仓库、感知工作树的 diff 查看器作为 Claude Code mod。

功能:

  • /multi-diff 打开一个面板,显示基于 Git 的 diff,并保存会话开始时(或执行 /clear 时)每个仓库的快照,因此 "changes since session started" 会覆盖所有工具,而且重启或恢复后仍然有效,不会触碰文件、分支或暂存区。
  • 自动检测打开文件夹内直接包含的每个仓库。
  • 每个仓库都有工作树选择器;除非主动请求,否则隐藏 detached scratch checkout。
  • 五种比较模式:未提交 vs HEAD、未暂存 vs 已暂存、已暂存 vs HEAD、分支 vs base(PR 视图),以及会话开始以来的改动。
  • 带改动和词语高亮的文件树与 diff,支持浅色和深色主题。

安装:克隆 https://github.com/nvsravank/multirepo-diff-mod 然后运行 claude --plugin-dir /path/to/multirepo-diff-mod 和 /multi-diff。对于 Desktop 应用,将文件夹添加到 ~/.claude/settings.json 的 env 区块中的 CLAUDE_CODE_PLUGIN_DIRS。已在 macOS 上测试;Windows 尚未测试。

给 mod 作者的备注(Desktop 应用,engine 2.1.286):Desktop 上的 format 'diff' 代码块会显示为纯文本;超过约 300 行的大面板可能冻结按钮或下拉菜单(用 150 行分页可以绕开);代码块上限为 10,000 个字符,因此大型 diff 必须拆分;面板作为单页滚动,没有独立滚动区域或固定标题;mod 无法读取应用主题,因此面板使用手动浅色/深色切换。希望提供的 API 功能:可滚动区域、固定顶部区域和主题暴露。

安装

安装方法请查看原始来源。

原文 / README

Claude Code Mod for Diffs I kept VS Code open just to check diffs, and /diff didn't fix it for me: it misses changes Claude makes with Python or shell scripts, and it shows nothing when the folder I open isn't a git repo. I keep backend and frontend repos side by side in one project folder. So I built a mod. /multi-diff opens a pane with: Git-based diffs. A git snapshot of every repo when the session starts (or on /clear ), so "changes since this session started" shows everything, by Claude or anyone, by any tool, and survives a restart and resume. Your files, branches and staging area are never touched. Automatic repo detection. Every repo in the folders directly inside the one you open. Worktrees. Each repo's worktrees in a picker; detached scratch checkouts are hidden until you ask. Five compare modes. Uncommitted vs HEAD, unstaged vs staged, staged vs HEAD, branch vs base (the PR view, without opening a PR), and changes since the session started. A file tree and a diff with change and word highlighting, in light and dark themes. All the ways to see Diffs Repo (MIT): https://github.com/nvsravank/multirepo-diff-mod To try it: clone it, then claude --plugin-dir /path/to/multirepo-diff-mod and run /multi-diff . For the Desktop app, add the folder to CLAUDE_CODE_PLUGIN_DIRS in the env block of ~/.claude/settings.json . Tested on macOS; Windows should work but is untested, so reports are welcome. Things I ran into, if you're building mods (Desktop app on engine 2.1.286): Code with format: 'diff' draws as plain text on Desktop. It's fine in the terminal. Reported as anthropics/claude-code#99535 . I draw my own rows on Desktop. Large panes go dead on Desktop. Past about 300 rows in one drawing, buttons and dropdowns stop working, with only ui_press not handled in ~/Library/Logs/Claude/main.log . Paging (150 rows) fixed it. Code blocks hold at most 10,000 characters , so big diffs need splitting into valid hunks. Panes scroll as one page. No independent scroll areas, and no fixed header. Mods aren't told the app's theme , so the pane has a light/dark toggle. What I'd like to see in the mods API: scrollable areas inside a pane, a fixed area at the top, and the app's theme exposed to mods. Bug reports and ideas welcome as GitHub issues. submitted by /u/Weary-Net1650 [link] [comments]

更多类似作品