ccdwyer/transit-map

一個 Claude Code 外掛,以 Vignelli 風格的地鐵圖繪製 git 歷程:分支是彩色路線、提交是車站、工作樹是列車;透過外掛市集安裝。
ccdwyer/transit-map

Transit Map 會在 Claude Code 中把你的儲存庫 git 歷程繪製成 Vignelli 風格的地鐵圖。分支變成醒目的純色路線(主幹 main/master 一律為紅色),提交顯示為 ○ 車站,合併顯示為 ◎ 轉乘站,標籤顯示為 ▣ 終點站並標在上方。只有遠端存在的分支會以虛線繪製;工作樹是一列位於 HEAD 稍後位置的列車,每個尚未提交的檔案對應一節車廂(最多 60 節),Claude 編輯檔案時車廂會亮黃。地圖是即時的:Claude 提交時新車站會出現,切換分支時列車會滑到另一條路線。/metro 會在窗格中開啟地圖,提供平移、逐站瀏覽、捲動路線、提交詳細資料與跟隨列車控制,也有滑鼠移入提示。首次開啟後,提示列上方會出現一行條帶,顯示目前路線、列車以及 ahead/behind 數量;/metro strip off 可將它隱藏。它會顯示所有分支中最新的 120 個提交,把重疊的尖端折疊成車站旁標籤,將超過 10 條的路線分組到灰色的 +N more lines 車道,每回合重新整理(包括子代理提交),並在行動版等不可互動介面上退回純文字時刻表。使用 /plugin marketplace add ccdwyer/claude-mods、/plugin install transit-map@ccdwyer-mods,接著執行 /reload-plugins 安裝。它掛接 session.start、command.run{command=metro}、tool.call、turn.complete、ui.message,以及用於 Pane 和 AbovePrompt 的 ui.render,並呼叫引擎函式完成命令註冊、git 程序執行、工作階段 cwd、狀態讀寫和 UI 開啟/解析。tool.call hook 只觀察結果,讓它能在 git 命令和編輯後重繪。它完全在本機使用 git 執行,不會透過網路傳送任何內容(見 PRIVACY.md)。採用 MIT 授權。
請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。
claude plugin marketplace add ccdwyer/transit-map claude plugin install transit-map

/metro draws the repo as a subway map with tags and four lines; after Claude commits, a new station appears and the train runs empty. Watch the MP4
A Claude Code mod that draws your git history as a Vignelli-style subway map.
main, master) is always red.○ stations, merges are ◎ interchanges, and tags are ▣ termini with their name above.╍.▶▶▶ past HEAD on your current line, with one car ▮ per uncommitted file (up to 60). Cars light up yellow when Claude edits that file./metro opens the map in a pane:
| Key | Action |
|---|---|
| ← →, or drag | pan |
| ↑ ↓ | walk the stations |
| PgUp PgDn | scroll lines into view |
| click or Enter | show a commit's hash, author, subject and files |
| f | follow the train |
Hover over a station to see its subject.
After you open the map once, a one-row strip above the prompt shows the line you're on, your train and ahead/behind counts. /metro strip off hides it.
The map shows the newest 120 commits across all branches, plus HEAD's own history if you've checked out something older. A branch that shares another's tip (one you just created, or a merged remote) has no line of its own; its name rides beside the station. Past 10 lines, the rest share a grey +N more lines lane. The map refreshes after each turn, so commits a subagent made appear too. Surfaces without interactive regions, such as mobile, get a plain timetable instead.
/plugin marketplace add ccdwyer/claude-mods
/plugin install transit-map@ccdwyer-mods
/reload-plugins
Events this mod hooks, as claude plugin validate reads the module:
session.startcommand.run{command=metro}tool.callturn.completeui.messageui.render{component=Pane, requestId=transit-map}ui.render{component=AbovePrompt}Engine calls it makes: $.command.register, $.process.run (via git), $.session.cwd (via repoRoot), $.state.get, $.state.set, $.ui.open, $.ui.resolve.
A tool.call hook sits in the middle of every tool call: it can see the call, refuse it, or add context to its result. This mod only observes the result, to redraw the map after git commands and edits.
It runs entirely on your machine, using local git only. It sends nothing over the network. Full policy: PRIVACY.md.
MIT