Repository navigation
Feat: Add an optional beep when Claude finishes or needs input - #738
Merged
Merged
Conversation
Play a short sound on the Stop and Notification hooks. The sound is local and sends nothing anywhere. - Add scripts/beep.sh. It uses afplay, then paplay, then aplay, then a terminal bell, and always exits 0. - Add the beep plugin option, default on. CONTEXT_GURU_BEEP overrides it. - Document the option in the install page. Closes #737 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: DAVID BOAZ <[email protected]>
boazdavid
commented
Nov 1, 2026
boazdavid
left a comment
Collaborator
Author
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (claude, user of @boazdavid) | Claude Code 2.1.241, claude-sonnet-5-5 | offload-review skill, @boazdavid's session | fresh | 1 of 2 | 1 of 2 | 3069560db172 |
approve |
Verdict: approve
Findings
None.
Non-blocking
- Default is
on. Every existing user hears a sound after the update. The PR title says "optional". The docs and the option description state the default, so this is a product choice. Confirm it is wanted. scripts/beep.sh:30— stderr noise when no tty. Theprintf '\a' >/dev/tty 2>/dev/nullline prints/dev/tty: Device not configuredwhen the hook has no controlling terminal. I ran the script withPATH=/nonexistentand no tty and saw the message. The exit code stays 0, so fail-open holds. To silence it, write{ printf '\a' >/dev/tty; } 2>/dev/null.- Double sound is possible.
StopandNotification(idle prompt) can both fire for one wait. This is expected. Mention it in the docs if users report it. - Test gaps. The player tests run on macOS only. The
paplay/aplay/bell branches have no test.TestBeepWithNoPlayerExitsZerosetsPATHto an empty dir, socatis also missing. The test checks only exit 0. docs/data-dependence.mdhas no row for this feature. The feature reads no customer data and sends nothing (the script never reads stdin content). The PR description should say so: data dependence none at all three storage levels.- Mode values.
beep.shacceptsoff|0|false|no.signal.shacceptsoff|0|false. The difference is small. Align them if you want one rule.
What I checked
- Full diff of all 5 files:
plugin.json,hooks.json,beep.sh,beep_test.go,install-plugin.md. beep.shlogic: env var beats plugin option,offexits 0, the player runs detached, every path exits 0.- Ran
beep.shwith no player and no tty. Exit code 0. hooks.json: valid JSON.Notificationkeepssignal.shand addsbeep.sh.Stoprunsbeep.sh. Timeouts are 5 s.plugin.json:beepis a string option, defaulton. It matches theclient_signalspattern.- Script mode bit is 100755 in git.
- Fail-open rule: the hook cannot block or fail Claude Code, and it does not touch requests.
- I did not run Go tests (not approved).
boazdavid
commented
Nov 1, 2026
boazdavid
left a comment
Collaborator
Author
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (claude, user of @boazdavid) | Claude Code 2.1.241, claude-sonnet-5-5 | offload-review skill, @boazdavid's session | fresh | 2 of 2 | 1 of 2 | 3069560db172 |
blocking |
Verdict: blocking
Findings
- docs/data-dependence.md — the PR adds a feature but does not update the data-dependence page
- What fails:
CLAUDE.md("Metadata first") says every PR that adds a feature must state its data dependence. It must say what the feature does at each storage level (off, metadata only, everything). It must updatedocs/data-dependence.md. The diff touches 5 files anddocs/data-dependence.mdis not one of them. The page has rows for plugin features, for example "Wait-cause and lifecycle signals" (line 226) and "Costly settings check" (line 227). The beep has no row. - Proof:
git diff ad87e369..HEAD --statlistsplugin.json,beep_test.go,hooks.json,beep.sh,install-plugin.md.grep -in beep docs/data-dependence.mdfinds nothing. The data-dependence fact is true and easy to state:beep.shnever reads the hook payload (cat >/dev/null) and sends nothing. So the row is short, but the rule asks for it. - Fix: Add one row. Say it is no data: it reads no stored data and no payload. Say it works the same at all 3 storage levels. Put a "Decided by" name in it. State "no change in data dependence" in the PR description.
- What fails:
Non-blocking
scripts/beep.sh:17-19— Only lowercaseoff | 0 | false | nosilences the beep. Thebeepoption is free text. A user who typesOfforOFFin/plugin configurestill hears the sound. Consider${MODE,,}or a secondcasearm.scripts/beep.sh—Stopalso fires in non-interactiveclaude -pruns and in scripts. The default ison, so those runs beep on macOS. This is a behavior change for every existing user at update time. The description and docs sayonis the default, but the docs do not say that scripted runs beep. Consider one sentence.scripts/beep.sh:30— The terminal-bell fallback writes to/dev/tty. Claude Code may draw a TUI on that terminal. A bell byte is harmless, but nothing tests this branch.TestBeepWithNoPlayerExitsZerochecks only the exit code. It does not check that nothing was printed to stdout.beep_test.go— 4 of the 6 tests callskipUnlessMac. On Linux CI only the wiring and manifest tests run. Thepaplayandaplaybranches have no test. A fakepaplayplus a sound-file path override would test them.docs/how-to/install-plugin.md— The table says Client signals default isoff, butplugin.jsonsaysauto. This was wrong before this PR. Do not fix it here, but it may deserve its own issue.
What I checked
- Read the full diff of all 5 files, and the whole of
beep.sh,hooks.jsonandbeep_test.go. beep.shfail-open path:set -uo pipefailwithout-e. Every exit is 0.cat >/dev/nullfailing (nocaton PATH) does not stop it. The player runs in a detached subshell with all output redirected, so the hook returns at once. A missing player or sound file reaches the bell branch, thenexit 0.- Switch order:
CONTEXT_GURU_BEEPwins overCLAUDE_PLUGIN_OPTION_BEEP. The script, the tests and the docs agree. An emptyCONTEXT_GURU_BEEPfalls back to the option (:-), which is fine. hooks.json:Notificationkeepssignal.shand addsbeep.shin one group. Hooks in a group run in parallel, sobeep.shcannot delaysignal.sh.Stopis new. The JSON is valid.signal_test.gochecks onlySessionStart, so it is not broken.plugin.json: newbeepoption is a string, defaulton. It matchesbeep.sh. The docs table has 7 rows, which matches "seven options".- Security: no user text reaches a shell. The player and sound paths are fixed strings. The payload is not read, so nothing leaks.
- Did not run tests. Go is not installed and live tests are not approved. I read the test code and traced it by hand: the fake-player tests use a
PATHof the temp dir plus/usr/bin:/bin, which hides any real player.
…ep switch Add the beep to docs/data-dependence.md (no data at any level), make the beep option case-insensitive, silence the /dev/tty and tr stderr noise when there is no terminal or no tr, and note that scripted claude -p runs beep too. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: DAVID BOAZ <[email protected]>
Collaborator
Author
|
Fixed in 2fdaeff. Reviewer 2, finding 1 (data-dependence row): fixed. Data dependence of this PR: no change. The beep reads no stored data. Non-blocking items:
|
boazdavid
commented
Nov 1, 2026
boazdavid
left a comment
Collaborator
Author
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (claude, user of @boazdavid) | Claude Code 2.1.241, claude-sonnet-5-5 | offload-review skill, @boazdavid's session | resumed | 1 of 2 | 2 of 2 | 2fdaeff05993 |
approve |
Verdict: approve
Findings
None.
Non-blocking
- No test covers the
paplay,aplayand bell branches. The author declined this and gave a reason (a sound-file path override is needed). I accept it. - The "Client signals" row in
docs/how-to/install-plugin.mdsays defaultoff, butplugin.jsonsaysauto. This was wrong before the PR. The author left it. Open a separate issue.
What I checked
- Last review: round 1, 3069560, 2026-11-01T09:02:08Z
- New commits read: 1 (2fdaeff docs(plugin): Add the beep data-dependence row; ignore case in the beep switch)
- Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files)
- New items since my last review:
- Reviewer 2 round-1 review (blocking: missing data-dependence row). Fixed:
docs/data-dependence.md:228now has a Beep row, kindnone, same at all 3 levels. I checked the claim:beep.shnever reads the payload and sends nothing. - Author comment with replies to both reviews. I checked each reply against the diff.
- Reviewer 2 round-1 review (blocking: missing data-dependence row). Fixed:
- My round-1 non-blocking items:
/dev/ttystderr noise: fixed.{ printf '\a' >/dev/tty; } 2>/dev/nullhides the redirect error.- Data-dependence row: fixed.
- Mode values differ from
signal.sh: left as is. Fine. - Default
onand double sound: kept by the author. Documented. - Test gaps: declined with a reason (see Non-blocking).
- Reviewer 2 items: case-insensitive value fixed with
tr '[:upper:]' '[:lower:]'. Iftris missing, the output is empty and the script beeps, which is the default, so fail-open holds and exit stays 0. Theclaude -psentence is added to the docs. - Read the whole diff
3069560d..HEAD(3 files). Onlybeep.shhas code changes. Every path still exits 0. - The new docs row sits in the "Features outside the pipeline" table, which has no "Decided by" column, so none is required there.
- I did not run Go tests (not approved).
boazdavid
commented
Nov 1, 2026
boazdavid
left a comment
Collaborator
Author
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (claude, user of @boazdavid) | Claude Code 2.1.241, claude-sonnet-5-5 | offload-review skill, @boazdavid's session | resumed | 2 of 2 | 2 of 2 | 2fdaeff05993 |
approve |
Verdict: approve
Findings
None.
Non-blocking
scripts/beep.sh:17— Iftris missing, thecaseinput is empty. It matches nooffarm. The beep then plays even when the user setoff. The machine would need notr, which is very rare. The result is a sound, not a failure, and fail-open holds. No action needed.- The
paplay,aplayand bell branches still have no test. The author said this needs a sound-file override in the script. Agreed. Do it in a later PR. - The Client signals default in
docs/how-to/install-plugin.md(offagainstautoinplugin.json) is still wrong. It was wrong before this PR. Open a separate issue.
What I checked
- Last review: round 1, 3069560, 2026-11-01T09:02:53Z
- New commits read: 1 (2fdaeff docs(plugin): Add the beep data-dependence row; ignore case in the beep switch)
- Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files)
- New items since my last review:
- Commit 2fdaeff: read the whole diff (
beep.sh,docs/data-dependence.md,install-plugin.md). Details below. - Author comment at 09:09:41Z: replies to every item of both reviews. I checked each reply against the code. All match the commit.
- Commit 2fdaeff: read the whole diff (
- Earlier findings:
- My finding 1 (no data-dependence row): fixed. The new row is in
docs/data-dependence.md. Kind isnone. It says "Works, no data" at all three levels and gives the reason in plain words. The row has the same 6 columns as the rows around it.components/all/datadep_test.gocovers components only, so the new row does not break it. The author states "no change" in data dependence in the comment. The page has no "Decided by" column on this table, so there is nothing to add. - My non-blocking items: case of the value fixed (
tr '[:upper:]' '[:lower:]', soOffandOFFnow match). The sentence on scriptedclaude -pruns is added. Missing tests for the player branches and the Client signals docs mismatch were declined with a reason. I accept both reasons. - Reviewer 1: no findings. Its stderr-noise point is fixed (
{ printf '\a' >/dev/tty; } 2>/dev/nullsilences the redirect error, which2>/dev/nullon the command did not). I agree with it and added no new proof.
- My finding 1 (no data-dependence row): fixed. The new row is in
beep.shafter the change:set -uo pipefailhas no-e, so a failingtrcannot stop the script.printf %skeeps-or%in the value safe. Every exit is still 0. Fail-open holds.- Tests: the existing tests set
CONTEXT_GURU_BEEP=offandCLAUDE_PLUGIN_OPTION_BEEP=offin lowercase, andPATHincludes/usr/bin:/bin, sotris found. They still pass by reading. There is no test forOFF. Small gap, listed as non-blocking-level only. - Did not run tests. Go is not installed and live tests are not approved.
The table said off and that the proxy needs CONTEXT_GURU_CLIENT_SIGNALS=on. plugin.json and signal.sh default to auto, and the proxy runs this whenever its keep-alive runs. Link the section that says so. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: DAVID BOAZ <[email protected]>
OsherElhadad
approved these changes
Nov 1, 2026
amiddavid
added a commit
that referenced
this pull request
Nov 2, 2026
…0.2.9) (#863) Claude Code plugin 0.6.4 -> 0.6.5: - #850: 12 display-only skills get disable-model-invocation: true. - #738: an optional beep when Claude finishes or needs input. - #848: settings.py still writes head_ttl_min_tokens, so an older proxy loads its config. - #859: the band and cg.py show "finished" for an agent that ended with a terminal tool call. Codex plugin 0.2.8 -> 0.2.9: - #850: 9 display-only skills get allow_implicit_invocation: false. - #852: the session skill's front matter is valid YAML, so Codex loads it. Signed-off-by: DAVID AMID <[email protected]> Assisted-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The plugin now plays a short sound when Claude finishes a turn or waits for the user. The sound is on by default. The user can turn it off.
Closes #737
What changed
context-guru-plugin/scripts/beep.sh. It picks the first player that exists:afplay, thenpaplay, thenaplay, then a terminal bell. It always exits 0.beep.shon theStopandNotificationhooks. Thesignal.shhook onNotificationdoes not change.beepplugin option (onoroff, defaulton).CONTEXT_GURU_BEEP. It wins over the option, so one shell can differ from the saved setting.docs/how-to/install-plugin.md. The heading now says seven options.Rules kept
How it was tested
go test ./context-guru-plugin/ -run Beeppasses.gofmt,go vetandbash -nare clean.mkdocs.Limits
StoporNotificationbeep hook hears two sounds.Open questions
StopandNotificationuse different sounds?Assisted-By: Claude (Anthropic AI) [email protected]