
我打造了一個類似 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]
