ClaudeMods
☰
JA
● 0 人がオンライン ・閲覧 0 回
スポンサー作品を投稿
GitHub リポジトリ · 投稿者 0xGondarxyz

snap

Claude Code mod です。`/snap` と入力して画面上で範囲をドラッグすると、スクリーンショットが次のメッセージに入ります。

0xGondarxyz@0xGondarxyz

0xGondarxyz/claude-code-mods/tree/main/snap

翻訳済み

この mod について

snap

Claude Code mod です。/snap と入力して画面上で範囲をドラッグすると、スクリーンショットが次のメッセージに入ります。

仕組み

  1. /snap は Spectacle を範囲モードで実行します:spectacle --region --background --nonotify --output <file>。
  2. ファイルは ~/.cache/claude-snaps/snap-<YYYYMMDD-HHMMSS>.png に保存されます。
  3. mod はプロンプトボックスのカーソル位置に @<path> を挿入します。Claude Code は @ で指定された画像ファイルを読み取ります。
  4. Escape、ファイルがない場合、または終了コードが非ゼロの場合は、トースト Snap cancelled を表示して何も変更しません。Spectacle がない場合は Snap needs Spectacle (KDE) を表示します。

プラグインは下書きそのものに画像を添付できません(型が記述するのは送信済みプロンプトの添付だけです)。そのため mod は @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

  1. /snap runs Spectacle in region mode: spectacle --region --background --nonotify --output <file>.
  2. The file lands in ~/.cache/claude-snaps/snap-<YYYYMMDD-HHMMSS>.png.
  3. The mod inserts @<path> at the cursor in your prompt box. Claude Code reads an @-mentioned image file.
  4. Escape, no file, or a non-zero exit shows the toast Snap cancelled and changes nothing. A missing Spectacle shows Snap 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 .

関連作品