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

jinglebox

セッションで何かが起きたとき、Jinglebox ワークスペースのサウンドを再生する Claude Code プラグイン。

lamberttraccard@lamberttraccard

lamberttraccard/jinglebox-marketplace/tree/main/plugins/jinglebox

翻訳済み

この mod について

Claude Code 用 Jinglebox

セッションで何かが起きたとき、Jinglebox ワークスペースのサウンドを再生する Claude Code プラグインです。

| イベント | 再生されるタイミング | |---|---| | turn-done | Claude が処理を終え、回答があなたを待っている | | needs-answer | Claude があなたを待っている:質問、承認待ちのプラン、権限プロンプト、または質問で終わる回答 | | long-turn | 60 s を超えるターンが終わった(turn-done の代わり) | | tests-passed / tests-failed | Claude が実行したテストコマンドが成功または失敗した(artisan test、pest、phpunit、pytest、jest、vitest、go test、cargo test、npm test…) | | pr-created | glab mr create または gh pr create が成功した |

初期状態では、すべてのイベントでワークスペースからランダムな短いサウンドを再生します。/jinglebox set で自分のサウンドを設定できます。

このプラグインに音声は含まれません。各マシンがそれぞれの Jinglebox MCP 接続とアカウントを使ってサウンドをダウンロードし、ローカルにキャッシュします(最大 40 サウンド)。

インストール

  1. Jinglebox MCP サーバーに接続する(マシンごとに 1 回):

    claude mcp add --transport http --scope user jinglebox https://jinglebox.app/mcp
    

    続けてインタラクティブな claude ターミナルで /mcp を実行し、jinglebox を選んで認証します。

  2. 読み取り専用ツールを許可すると、自動モードでもプラグインの呼び出しが拒否されません。~/.claude/settings.json に次を追加します。

    "permissions": {
      "allow": [
        "mcp__jinglebox__get-sound",
        "mcp__jinglebox__search-sounds",
        "mcp__jinglebox__get-workspace",
        "mcp__jinglebox__list-workspaces"
      ]
    }
    
  3. プラグインをインストールする:

    claude plugin marketplace add lamberttraccard/jinglebox-marketplace
    claude plugin install jinglebox@jinglebox
    

    インストールせずに試す場合は claude --plugin-dir ./plugins/jinglebox を実行します。

  4. 新しいセッションを開始します。アカウントに複数のワークスペースがある場合は、/jinglebox workspace <slug> で 1 つ選びます。

コマンド

/jinglebox                                       current sounds
/jinglebox workspace [slug]                      list or pick the workspace
/jinglebox set <event> 329 | #329 | <sound URL>  a fixed sound
/jinglebox set <event> 21,349,336                random among these
/jinglebox set <event> random [tag]              random short sound of the workspace, or of one tag
/jinglebox set <event> default                   back to the default (random from the workspace)
/jinglebox search <words>                        find sounds and their IDs
/jinglebox test <event>                          play an event's sound now
/jinglebox mute | unmute
/jinglebox export                                your setup as one /jinglebox import line
/jinglebox import <workspace> <event>=<choice>…  apply a shared setup
/jinglebox debug                                 check the MCP call, the playback and the cache

選択はマシンごと、ワークスペースごとに保持され、セッションをまたいで残ります。ランダム選択で同じサウンドが 2 回続けて再生されることはありません。次のサウンドも先にダウンロードするため、すぐに再生が始まります。トーストには再生したサウンド名が表示されるので、気に入ったランダムサウンドは /jinglebox set で固定できます。

設定を共有する

/jinglebox export は設定を 1 行で出力します。例:

/jinglebox import my-team turn-done=random:fun needs-answer=177 long-turn=339 tests-passed=325 tests-failed=329 pr-created=344

チームで話す場所に貼り付けてください。実行した人は同じワークスペースとサウンドを受け取り、その後 /jinglebox set でどれでも変更できます。選択肢はサウンド ID(177)、選択リスト(21,349,336)、random、random:<tag> のいずれかです。ホストされるものはありません。この行が設定そのものです。

複数のワークスペースがあるアカウントでワークスペースを選ぶ(またはインポートする)までは、サウンドは再生されません。プラグインは他の失敗と同じようにトーストで知らせますが、10 分に 1 回までです。

設定

| 設定 | デフォルト | 意味 | |---|---|---| | workspace | empty | ワークスペースの slug。空なら /jinglebox workspace で選択 | | mcp_server | jinglebox | /mcp に表示される Jinglebox MCP サーバー名 | | long_turn_seconds | 60 | これより長いターンで long-turn を再生 | | random_max_seconds | 4 | ランダム選択ではこの長さ以下のサウンドだけを使用 |

仕組み

これは Claude Code のfunction hooks プラグイン(plugins/jinglebox/hooks/register.ts)です。早期アクセス API のため、対応する Claude Code ビルドが必要です。

  • turn.complete:メインループのターン終了時、回答の最後の段落が質問なら needs-answer、それ以外は long-turn または turn-done。
  • classic.PermissionRequest と、AskUserQuestion および ExitPlanMode の tool.call:needs-answer。3 s に 1 回までです。
  • Bash の tool.call:tests-passed、tests-failed、pr-created。
  • プラグインはマニフェストで Jinglebox MCP サーバーを宣言し、最初の呼び出し前に $.mcp.connect で接続します。そのため、セッションがまだサーバーのツールを読み込んでいなくても動作します。セッションが同じサーバー(手順 1)をすでに実行している場合は、その接続を再利用します。
  • サウンドは MCP の get-sound から取得し、プラグインのストアにキャッシュして $.audio.play で再生します。ランダム選択の候補は search-sounds から取得し、1 日に 1 回更新します。

トラブルシューティング

/jinglebox debug は各ステップを実行し、どこで失敗したかを示します。

  • 「MCP server is not connected」:プラグインが Jinglebox MCP サーバーに接続できませんでした(ネットワークの問題、または起動時のタイムアウト)。/mcp を実行して jinglebox に再接続し、もう一度試してください。
  • 「call refused」:手順 2 の権限が不足しています。

ライセンス

MIT。詳しくは LICENSE を参照してください。

インストール

まず作者の README で marketplace とプラグイン名を確認してください。コマンドはリポジトリの構成によって変わる場合があります。

claude plugin marketplace add lamberttraccard/jinglebox-marketplace
claude plugin install jinglebox
原文 / README

Jinglebox for Claude Code

A Claude Code plugin that plays sounds from your Jinglebox workspace when something happens in a session.

| Event | When it plays | |---|---| | turn-done | Claude finished and its answer waits for you | | needs-answer | Claude waits on you: a question, a plan to approve, a permission prompt, or an answer that ends on a question | | long-turn | a turn longer than 60 s finished (instead of turn-done) | | tests-passed / tests-failed | a test command run by Claude passed or failed (artisan test, pest, phpunit, pytest, jest, vitest, go test, cargo test, npm test…) | | pr-created | glab mr create or gh pr create succeeded |

Out of the box every event plays a random short sound of your workspace; set your own with /jinglebox set.

The plugin ships no audio. Each machine downloads its sounds through its own Jinglebox MCP connection, with its own account, and caches them locally (40 sounds at most).

Install

  1. Connect the Jinglebox MCP server (once per machine):

    claude mcp add --transport http --scope user jinglebox https://jinglebox.app/mcp
    

    then run /mcp in an interactive claude terminal, pick jinglebox and authenticate.

  2. Allow its read-only tools, so the plugin's calls are not refused in auto mode. In ~/.claude/settings.json:

    "permissions": {
      "allow": [
        "mcp__jinglebox__get-sound",
        "mcp__jinglebox__search-sounds",
        "mcp__jinglebox__get-workspace",
        "mcp__jinglebox__list-workspaces"
      ]
    }
    
  3. Install the plugin:

    claude plugin marketplace add lamberttraccard/jinglebox-marketplace
    claude plugin install jinglebox@jinglebox
    

    Or try it without installing: claude --plugin-dir ./plugins/jinglebox.

  4. Start a new session. If your account has several workspaces, pick one with /jinglebox workspace <slug>.

Commands

/jinglebox                                       current sounds
/jinglebox workspace [slug]                      list or pick the workspace
/jinglebox set <event> 329 | #329 | <sound URL>  a fixed sound
/jinglebox set <event> 21,349,336                random among these
/jinglebox set <event> random [tag]              random short sound of the workspace, or of one tag
/jinglebox set <event> default                   back to the default (random from the workspace)
/jinglebox search <words>                        find sounds and their IDs
/jinglebox test <event>                          play an event's sound now
/jinglebox mute | unmute
/jinglebox export                                your setup as one /jinglebox import line
/jinglebox import <workspace> <event>=<choice>…  apply a shared setup
/jinglebox debug                                 check the MCP call, the playback and the cache

Choices are kept per machine and per workspace, across sessions. A random pick never plays the same sound twice in a row, and the next sound is downloaded ahead so it starts at once. The toast names each sound played, so a random one you like can be pinned with /jinglebox set.

Share a setup

/jinglebox export prints your setup as a single line, for instance:

/jinglebox import my-team turn-done=random:fun needs-answer=177 long-turn=339 tests-passed=325 tests-failed=329 pr-created=344

Paste it wherever your team talks; whoever runs it gets the same workspace and sounds, then can change any of them with /jinglebox set. A choice is a sound ID (177), a list to pick from (21,349,336), random, or random:<tag>. Nothing is hosted: the line is the setup.

Until a workspace is picked (or imported) on an account with several, no sound plays; the plugin says so in a toast, at most once every 10 minutes, like any other failure.

Settings

| Setting | Default | Meaning | |---|---|---| | workspace | empty | the workspace slug; empty to pick it with /jinglebox workspace | | mcp_server | jinglebox | the Jinglebox MCP server's name, as /mcp lists it | | long_turn_seconds | 60 | a turn longer than this plays long-turn | | random_max_seconds | 4 | a random pick only takes sounds this short |

How it works

It is a plugin of Claude Code function hooks (plugins/jinglebox/hooks/register.ts), an early-access API: it needs a Claude Code build that supports it.

  • turn.complete, at the end of a main-loop turn: needs-answer when the answer's last paragraph asks a question, else long-turn or turn-done.
  • classic.PermissionRequest, and tool.call on AskUserQuestion and ExitPlanMode: needs-answer, at most once every 3 s.
  • tool.call on Bash: tests-passed, tests-failed, pr-created.
  • The plugin declares the Jinglebox MCP server in its manifest and connects it with $.mcp.connect before its first call, so it works even when the session has not loaded the server's tools yet; when the session already runs the same server (step 1), that connection is reused.
  • Sounds come from the MCP's get-sound, are cached in the plugin's store and played with $.audio.play. Random picks draw from search-sounds, refreshed once a day.

Troubleshooting

/jinglebox debug runs each step and says which one fails.

  • "MCP server is not connected": the plugin could not connect the Jinglebox MCP server (network, or the server timed out at startup). Run /mcp, reconnect jinglebox, and try again.
  • "call refused": the permissions of step 2 are missing.

License

MIT, see LICENSE.

関連作品