lamberttraccard/jinglebox-marketplace/tree/main/plugins/jinglebox
關於這個 mod
Claude Code 的 Jinglebox
一個 Claude Code 外掛,工作階段發生事件時,會從 Jinglebox 工作區播放聲音。
| 事件 | 播放時機 |
|---|---|
| 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 個音效)。
安裝
-
連線 Jinglebox MCP 伺服器(每台機器一次):
claude mcp add --transport http --scope user jinglebox https://jinglebox.app/mcp接著在互動式
claude終端機執行/mcp,選取jinglebox並完成驗證。 -
允許唯讀工具,這樣外掛呼叫在自動模式下就不會被拒絕。在
~/.claude/settings.json中:"permissions": { "allow": [ "mcp__jinglebox__get-sound", "mcp__jinglebox__search-sounds", "mcp__jinglebox__get-workspace", "mcp__jinglebox__list-workspaces" ] } -
安裝外掛:
claude plugin marketplace add lamberttraccard/jinglebox-marketplace claude plugin install jinglebox@jinglebox或不安裝直接試用:
claude --plugin-dir ./plugins/jinglebox。 -
開始新的工作階段。如果帳號有多個工作區,使用
/jinglebox workspace <slug>選取一個。
指令
/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
選項會依機器、依工作區保存,並跨工作階段保留。隨機選取不會連續兩次播放同一個音效,而且會預先下載下一個音效,讓它立即開始播放。提示訊息會顯示每個已播放音效的名稱;喜歡某個隨機音效時,可以用 /jinglebox set 將它固定下來。
分享設定
/jinglebox export 會把設定印成單行,例如:
/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 分鐘最多一次,和其他錯誤相同。
設定
| 設定 | 預設值 | 意義 |
|---|---|---|
| workspace | empty | 工作區 slug;留空即可使用 /jinglebox workspace 選取 |
| mcp_server | jinglebox | Jinglebox MCP 伺服器名稱,和 /mcp 列出的名稱相同 |
| long_turn_seconds | 60 | 超過這個時間的工作回合會播放 long-turn |
| random_max_seconds | 4 | 隨機選取只會使用不超過這個時間的音效 |
運作方式
這是 Claude Code 的函式勾點外掛(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 最多一次。Bash上的tool.call:觸發tests-passed、tests-failed、pr-created。- 外掛在資訊清單中宣告 Jinglebox MCP 伺服器,並在第一次呼叫前透過
$.mcp.connect連線,所以即使工作階段尚未載入伺服器工具也能運作;如果工作階段已經執行同一台伺服器(步驟 1),就會重用該連線。 - 音效來自 MCP 的
get-sound,會快取在外掛儲存區,再以$.audio.play播放。隨機選取來自search-sounds,每天重新整理一次。
疑難排解
/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
-
Connect the Jinglebox MCP server (once per machine):
claude mcp add --transport http --scope user jinglebox https://jinglebox.app/mcpthen run
/mcpin an interactiveclaudeterminal, pickjingleboxand authenticate. -
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" ] } -
Install the plugin:
claude plugin marketplace add lamberttraccard/jinglebox-marketplace claude plugin install jinglebox@jingleboxOr try it without installing:
claude --plugin-dir ./plugins/jinglebox. -
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-answerwhen the answer's last paragraph asks a question, elselong-turnorturn-done.classic.PermissionRequest, andtool.callonAskUserQuestionandExitPlanMode:needs-answer, at most once every 3 s.tool.callonBash:tests-passed,tests-failed,pr-created.- The plugin declares the Jinglebox MCP server in its manifest and connects it with
$.mcp.connectbefore 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 fromsearch-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, reconnectjinglebox, and try again. - "call refused": the permissions of step 2 are missing.
License
MIT, see LICENSE.
