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

我构建了一个类似 VS Code 的 Claude Code 源代码管理面板,这是一个 Claude Code mod

一篇 Reddit 帖子展示了一个 Claude Code mod,它添加类似 VS Code 的源代码管理面板:聊天框上方的状态带显示分支、pull/push 数量和变更文件,并提供一个随上下文变化的操作按钮;侧边面板支持暂存、commit、历史图、分支、worktree 和 stash。合并冲突有专门区域,可交给 Claude 处理。通过 /plugin marketplace add manuel-will/cc-source-control 和 /plugin install source-control@cc-source-control 安装;需要 Claude Code 2.1.287+。MIT 授权,支持英语和德语,仓库链接据说在第一条评论中。

已翻译

关于这个 mod

作者介绍了从 Claude Code mods 指南和内置 /diff 插件开始构建这个 mod,并把它们作为设计参考:先写计划,再用 5 天完成 41 个 commit。测试通过 claude plugin test 和真实终端会话执行,覆盖冲突 pull、detached HEAD、离线状态和首次 commit;playground 脚本还生成了 15 种仓库状态,用于自动化桌面应用截图验证。重要发现包括:mod 只能在固定位置绘制,左侧边栏不可用;Claude Code 为 mod 执行 git 时会禁用仓库 hooks,因此 Husky 风格的 hooks 会被跳过,面板会明确显示这一点;桌面应用无法渲染 SVG <line> 和 CSS class 图,后来改用 path 和 circle;Chromium 不会重绘被覆盖的窗口,导致截图过期;每次状态轮询都重绘会破坏点击,直到 0.7.1 只在可见变化时重绘。提供的操作都不会破坏数据:没有 force push,也没有 reset。

安装

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

原文 / README

What it is Claude Code shows the chat, but not where your repo stands. I kept switching to a terminal just to see whether I had to pull or push. So I built a mod for Claude Code (desktop app and terminal, needs 2.1.287 or newer): A band above the chat box: branch, ↓ commits to pull, ↑ commits to push, changed files. One main button does what is due (Sync, Commit, Publish, Resolve). A panel beside the chat: stage and commit, a VS Code-style history graph, branches, worktrees, stashes. Merge conflicts get their own section, and one click hands them to Claude. Background fetch, and only non-destructive actions. No force push, no reset, nothing discarded. How Claude Code built it It started from the "Getting started with Claude Code mods" guide. The source of the built-in /diff mod served as the design reference, so the mod looks native. Plan first: Claude wrote a plan into the repo (states, buttons, what a mod can and can't draw), I decided the open questions, then it implemented. 41 commits from 0.1 to 0.7.1 in five days. Tests run with claude plugin test (git parsing, the history graph). On top of that Claude drove real terminal sessions through every state: pull with conflict, detached HEAD, offline, first commit. The desktop app was the hard part to verify. Claude wrote a playground script that puts a throwaway repo into 15 states (behind, diverged, conflict, worktrees and so on) and a screenshot tour that photographs the Claude Desktop window for each one. Claude then checked its own UI from the pictures. What I learned Mods draw only in fixed places. The left project sidebar of the desktop app is off limits, so the panel on the right replaces it. Claude Code runs git for mods with repo hooks turned off. If your repo uses Husky or similar, a commit from the mod skips them, and the panel says so. The first desktop screenshots showed an empty history. The graph SVG used <line> elements and CSS classes, and the desktop app didn't draw them. Rebuilt with paths and circles only, it showed up. Chromium doesn't repaint a covered window. The automated screenshots went stale until the script brought the window to the front before each shot. Redrawing on every status poll made clicks unreliable. 0.7.1 only redraws when something visible changes. Install /plugin marketplace add manuel-will/cc-source-control /plugin install source-control@cc-source-control English and German, MIT licensed. Repo with screenshots and a 30-second demo: link in the first comment. I'd like to hear what's missing, especially from people who juggle one repo across several machines. submitted by /u/mnfctrd [link] [comments]

更多类似作品