awesome-claude-code
CLAUDE.md86 starsChanged 16 months agoMITView on GitHub
This is a Claude Code hooks project that implements sound notifications for various Claude Code events. The hooks are written in TypeScript and use native system commands to play sounds, requiring no external dependencies. Since this project uses TypeScript hooks with no build step required: The project contains three TypeScript hooks in .claude/hooks/: The hooks use native system commands for cross-platform audio: - macOS: afplay (built-in) - Windows: PowerShell Media.SoundPlayer (built-in) - Linux: aplay, paplay, or play (usually pre-installed) The…
The file
We split this CLAUDE.md into the rules it gives an agent
12 rules. About 0 are common, 4 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Test hooks locally: npx tsx .claude/hooks/notification.ts --notify
- Very specific: line 14
No installation needed - hooks run directly via npx tsx
- Very specific: line 25
Only plays sound with --notify flag
- Very specific: line 28
Alternative: Use --speak flag on macOS to use voice synthesis instead (says "Your agent needs attention")
- Very specific: line 36
Alternative: Use --speak flag on macOS to use voice synthesis instead (says "Your agent has finished")
- Very specific: line 43
Alternative: Use --speak flag on macOS to use voice synthesis instead (says "Your subagent has finished")
- Distinctive: line 66
macOS: No sound files required - uses built-in system sounds
- Distinctive: line 84
When adding new hooks:
- Very specific: line 85
Create TypeScript file in .claude/hooks/
- Distinctive: line 86
Read JSON from stdin
- Very specific: line 90
Add configuration to .claude/settings.json
- Distinctive: line 96
All file paths are properly escaped for shell commands
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
This is a Claude Code hooks project that implements sound notifications for various Claude Code events. The hooks are written in TypeScript and use native system commands to play sounds, requiring no external dependencies.
Development Commands
Since this project uses TypeScript hooks with no build step required:
- Test hooks locally:
npx tsx .claude/hooks/notification.ts --notify - No installation needed - hooks run directly via
npx tsx - Alternative runners:
pnpm dlx tsx,bunx tsx, orbun
Architecture & Key Components
Implemented Hooks
The project contains three TypeScript hooks in .claude/hooks/:
- notification.ts - Plays notification sound when Claude needs user attention
- Triggered on Notification events
- Only plays sound with
--notifyflag - macOS: Uses built-in system sound
/System/Library/Sounds/Funk.aiff - Windows/Linux: Requires
on-agent-need-attention.wavin repository root - Alternative: Use
--speakflag on macOS to use voice synthesis instead (says "Your agent needs attention") - Logs events to
logs/notifications.json
- stop.ts - Plays completion sound when Claude completes a task
- Triggered on Stop events
- Processes chat transcripts with
--chatflag - macOS: Uses built-in system sound
/System/Library/Sounds/Glass.aiff - Windows/Linux: Requires
on-agent-complete.wavin repository root - Alternative: Use
--speakflag on macOS to use voice synthesis instead (says "Your agent has finished") - Logs events to
logs/stop.jsonand transcripts tologs/chat.json
- subagent_stop.ts - Plays completion sound when a subagent completes
- Triggered on SubagentStop events
- macOS: Uses built-in system sound
/System/Library/Sounds/Glass.aiff - Windows/Linux: Requires
on-agent-complete.wavin repository root - Alternative: Use
--speakflag on macOS to use voice synthesis instead (says "Your subagent has finished") - Logs events to
logs/subagent_stop.json
Sound Playback
The hooks use native system commands for cross-platform audio:
- macOS:
afplay(built-in) - Windows: PowerShell
Media.SoundPlayer(built-in) - Linux:
aplay,paplay, orplay(usually pre-installed)
Configuration
The .claude/settings.json configures:
- Hook mappings for Notification, Stop, and SubagentStop events
- Permissions for necessary operations
- Commands using
npx tsxfor direct TypeScript execution
Speech Alternative: A .claude/settings-speech.json file is also provided that includes the --speak flag for all hooks. To use voice synthesis instead of sound files on macOS:
- Copy
settings-speech.jsontosettings.json - Or manually add the
--speakflag to your existing settings.json commands
Required Files
macOS: No sound files required - uses built-in system sounds
- Notification:
/System/Library/Sounds/Funk.aiff - Completion:
/System/Library/Sounds/Glass.aiff
Windows/Linux: Custom sound files required in repository root
on-agent-need-attention.wav- Sound for notificationson-agent-complete.wav- Sound for completion events
Future Features
Based on README.md, planned features include:
- Git Integration:
- Git commits for checkpoints with restore functionality
- Git worktrees for subagent isolation
Hook Development
When adding new hooks:
- Create TypeScript file in
.claude/hooks/ - Read JSON from stdin
- Process the event data
- Log to
logs/directory - Exit with appropriate code (0 for success)
- Add configuration to
.claude/settings.json
Security Considerations
- Hooks validate file existence before operations
- Error handling prevents script crashes
- All file paths are properly escaped for shell commands
- Logs are written to isolated
logs/directory
Project Origin and Inspiration
- Conceived during a collaborative coding session with Claude AI
- Goal: Create a lightweight, dependency-free sound notification system for AI interactions
- Inspired by the need for audible feedback during complex coding tasks
- Developed to enhance the developer experience with Claude Code hooks
Memories
- Added a memory update using the CLAUDE.md file guidance system
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

