0xGondarxyz/claude-code-mods/tree/main/snap
0xGondarxyz@0xGondarxyz
關於這個 mod
snap
一個 Claude Code 外掛。輸入 /snap,在螢幕上拖出一個框,截圖就會放進下一則訊息。
運作方式
/snap以區域模式執行 Spectacle:spectacle --region --background --nonotify --output <file>。- 檔案會寫入
~/.cache/claude-snaps/snap-<YYYYMMDD-HHMMSS>.png。 - 外掛會在提示框的游標處插入
@<path>。Claude Code 會讀取以 @ 提及的影像檔案。 - 按 Escape、沒有檔案或結束碼非零時,會顯示通知
Snap cancelled,而且不做任何變更。找不到 Spectacle 時會顯示Snap needs Spectacle (KDE)。
外掛無法直接把影像附加到草稿(這些型別只描述已送出的提示所附的內容),所以這個外掛使用 @path 文字。
你有 2 分鐘可以拖出選取框。
需求
附有 Spectacle 的 KDE(/usr/bin/spectacle)。
開發
claude plugin validate .
tsc -p .
claude plugin test .
安裝
請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。
claude plugin marketplace add 0xGondarxyz/claude-code-mods claude plugin install snap
原文 / README
snap
A Claude Code mod. Type /snap, drag a box on the screen, and the screenshot goes into your next message.
How it works
/snapruns Spectacle in region mode:spectacle --region --background --nonotify --output <file>.- The file lands in
~/.cache/claude-snaps/snap-<YYYYMMDD-HHMMSS>.png. - The mod inserts
@<path>at the cursor in your prompt box. Claude Code reads an @-mentioned image file. - Escape, no file, or a non-zero exit shows the toast
Snap cancelledand changes nothing. A missing Spectacle showsSnap needs Spectacle (KDE).
A plugin cannot attach an image to the draft itself (the types only describe attachments of a prompt already sent), so the mod uses the @path text.
You have 2 minutes to drag the box.
Requirements
KDE with Spectacle (/usr/bin/spectacle).
Develop
claude plugin validate .
tsc -p .
claude plugin test .