Agent DingDingDing
A VS Code extension that rings when Claude Code finishes a turn ("done") or seems to be waiting for you ("waiting": permission prompt, AskUserQuestion, plan approval).
Works with the native Claude Code panel in VS Code and with the CLI in a terminal, on Windows, macOS and Linux. Zero config, zero runtime dependencies. It does not modify ~/.claude/settings.json.
Why it exists
In the VS Code extension, the Notification and PermissionRequest hooks don't fire. This has been reported many times, for example:
There is also no built-in sound (feature requests: #48654, #65242). So hook-based notifiers miss approval prompts in the panel.
This extension doesn't use hooks. It watches the session transcripts instead.
How it works
- It tails Claude Code transcripts at
~/.claude/projects/<project>/<session>.jsonl (respects CLAUDE_CONFIG_DIR).
- An assistant message with
stop_reason: end_turn means done. Stale lines (older than 30 s, e.g. history replay) are ignored.
- A
tool_use with no tool_result after N seconds means waiting. This is a heuristic (see Limitations). AskUserQuestion and ExitPlanMode ring immediately.
- Skipped: subagent (sidechain) transcripts, and headless/SDK sessions (entrypoint
sdk-*) unless includeHeadless is on.
- In permission modes that never show approval prompts (
bypassPermissions, dontAsk, auto), slow tools are not treated as waiting. Only questions and plan approval ring.
- With several VS Code windows open, each event rings once: windows claim it through an atomic marker file in the OS temp dir.
Limitations
- The waiting alert is a timeout heuristic. In
default / acceptEdits mode, a long-running command can ring falsely. Raise waitingDelaySeconds or add the tool to waitingIgnoreTools.
- The transcript format is not a public API and may change in a Claude Code update.
- Windows: sound starts about 1-2 s late because PowerShell has to start.
- Linux: needs
paplay (wav/ogg/flac) or ffplay / mpv for mp3. aplay is tried last.
- If no player is found, a short message appears in the status bar.
Install
- VS Code Marketplace / Open VSX: search "Agent DingDingDing" (coming soon).
- From a
.vsix:
code --install-extension agent-dingdingding-0.1.0.vsix
Requires VS Code 1.90 or newer. The extension runs on the UI side (extensionKind: ui), so it plays sound on the machine you are sitting at.
Custom sounds
Command Palette:
Agent DingDingDing: Choose "done" sound…
Agent DingDingDing: Choose "waiting for you" sound…
Agent DingDingDing: Preview "done" sound / Preview "waiting for you" sound
Agent DingDingDing: Restore default sounds
Agent DingDingDing: Mute / unmute
The chosen file is copied into the extension's storage, so moving or deleting the original does not break it. Files over 5 MB are rejected; use a short clip.
Formats depend on the OS player:
| OS |
Formats |
| Windows |
wav, mp3, wma (m4a/aac if the codec is present) |
| macOS |
wav, mp3, m4a, aiff |
| Linux |
wav, ogg, flac via paplay; mp3 etc. via ffplay / mpv |
Playback is capped at 10 seconds.
Settings
| Setting |
Default |
Description |
agentDingDingDing.enabled |
true |
Play sounds. |
agentDingDingDing.volume |
70 |
Volume, 0-100. |
agentDingDingDing.doneSound |
"" |
Audio file for "done". Empty = built-in chime. |
agentDingDingDing.waitingSound |
"" |
Audio file for "waiting". Empty = built-in ding-ding-ding. |
agentDingDingDing.waitingAlert |
true |
Also ring when Claude seems to be waiting mid-turn. |
agentDingDingDing.waitingDelaySeconds |
8 |
A tool call with no result after this many seconds counts as waiting for approval (min 1). |
agentDingDingDing.waitingIgnoreTools |
Agent, Task, TaskOutput, Monitor, Read, Glob, Grep, TodoWrite, ToolSearch, Skill |
Tools that never trigger the waiting sound. |
agentDingDingDing.waitingSkipModes |
bypassPermissions, dontAsk, auto |
Permission modes in which slow tools are never treated as waiting. Questions still ring. |
agentDingDingDing.scope |
all |
all: every interactive session on this computer. thisWindow: only sessions started in a folder open in this window. |
agentDingDingDing.onlyWhenUnfocused |
false |
Stay quiet while this VS Code window has focus. |
agentDingDingDing.includeHeadless |
false |
Also ring for headless / SDK runs (claude -p, scripts, CI). |
Development
npm test # node --test, no dependencies
npm run sounds # regenerate the synthesized default sounds
npm run package # build the .vsix
License
MIT. Not affiliated with Anthropic. "Claude" is a trademark of Anthropic.
中文说明
Claude Code 在 VS Code 面板里不触发 Notification / PermissionRequest hook,也没有内置提示音。这个扩展通过监听 ~/.claude/projects 下的会话记录,在 Claude 回合结束("done")或似乎在等你确认("waiting")时播放提示音。支持 VS Code 原生面板、终端 CLI,Windows / macOS / Linux,零配置、零依赖,不修改 ~/.claude/settings.json。
安装:从 .vsix 安装,code --install-extension agent-dingdingding-0.1.0.vsix(应用市场版本即将上线)。
自定义提示音:打开命令面板(Ctrl+Shift+P),运行 "Agent DingDingDing: Choose "done" sound…" 或 "Choose "waiting for you" sound…",选一个 5 MB 以内的音频文件即可(Windows 支持 wav/mp3/wma,macOS 支持 wav/mp3/m4a/aiff)。用 "Restore default sounds" 可恢复默认。
注意:"waiting" 是基于超时的推测,长时间运行的命令可能误响,可调大 waitingDelaySeconds 或把该工具加入 waitingIgnoreTools。