alex2481kobe/claude-mods/tree/main/plugins/link
alex2481kobe@alex2481kobe
關於這個 mod
Claude Code 會把檔案路徑以純文字列印出來。使用這個 mod 後,回覆中存在於磁碟的路徑會變成連結:按下連結會在 Finder 中開啟所在資料夾並選取檔案;如果路徑是資料夾,就直接開啟資料夾,並顯示通知說明開啟的項目。它會在助理訊息上使用 ui.render hook,找出類似路徑的文字,根據工作階段資料夾與家目錄解析路徑,再將存在的路徑轉成 file:// 連結。按下連結會執行 open -R <file> 或 open <folder>。需要在終端機支援 mod 的 Claude Code、macOS,以及支援超連結(OSC 8)的終端機,例如 Ghostty 或 iTerm2。透過 /plugin marketplace add alex2481kobe/claude-mods 和 /plugin install link@claude-mods 安裝。
安裝
請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。
claude plugin marketplace add alex2481kobe/claude-mods claude plugin install link
原文 / README
link
Click a file path in a reply and Finder opens with it selected.
Claude Code prints file paths as plain text. With this mod, a path in a reply that exists on disk becomes a link: pressing it shows a file selected in its folder in Finder, or opens a folder as itself, and a toast says which.
Requirements
- Claude Code with mods, in the terminal (the reply is only changed there)
- macOS: it runs
openandopen -R - A terminal with hyperlinks (OSC 8), such as Ghostty or iTerm2. Apple
Terminal has none: there Claude Code writes each link's
file://address after it, so a path shows twice, and pressing it does not always open it
Install
/plugin marketplace add alex2481kobe/claude-mods
/plugin install link@claude-mods
How it works
- A
ui.renderhook on assistant messages finds path-like text, resolves it against the session's folder and home, and keeps only paths that exist. - Those paths are turned into
file://links in the reply's Markdown. A folder's URL ends in a slash, which is how a press tells it from a file. - Pressing a link runs
open -R <file>oropen <folder>and toasts the result, or the error if it failed. - A reply longer than 10000 characters, or with no existing path, keeps the engine's own drawing.