Get browser notifications when Claude Code (CLI) needs your input, permission approval, or has finished a task.
Run this one-liner to automatically set up everything:
curl -fsSL https://raw.githubusercontent.com/MaximilianMauroner/claude-code-notify/main/install.sh | bashWhat this does:
- Clones the repository to
~/.claude/claude-code-notify - Builds the notification server
- Makes hook scripts executable
- Configures Claude Code hooks in
~/.claude/settings.json
Requirements: git, node, npm
Install the extension from your browser's store:
Install from the Chrome Web Store (search for "Claude Code Notify")
Install from Firefox Add-ons (search for "Claude Code Notify")
- Click the extension icon in your browser - it should show "Connected"
- Start Claude Code and interact until it needs input or finishes a task
- You should see a browser notification
To remove the extension completely:
~/.claude/claude-code-notify/uninstall.shThis removes the hooks from settings, stops the server, and deletes the installation directory. You'll need to manually remove the browser extension.
If you prefer to set things up manually or want to understand what the install script does:
git clone https://github.com/MaximilianMauroner/claude-code-notify.git ~/.claude/claude-code-notifycd ~/.claude/claude-code-notify/server
npm install
npm run buildchmod +x ~/.claude/claude-code-notify/hooks/notify.sh
chmod +x ~/.claude/claude-code-notify/hooks/ensure-server.shAdd the following to your ~/.claude/settings.json (create it if it doesn't exist):
{
"hooks": {
"Notification": [
{
"matcher": "permission_prompt",
"hooks": [
{
"type": "command",
"command": "CLAUDE_HOOK_NAME=permission_prompt ~/.claude/claude-code-notify/hooks/notify.sh"
}
]
},
{
"matcher": "idle_prompt",
"hooks": [
{
"type": "command",
"command": "CLAUDE_HOOK_NAME=idle_prompt ~/.claude/claude-code-notify/hooks/notify.sh"
}
]
}
],
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "CLAUDE_HOOK_NAME=stop ~/.claude/claude-code-notify/hooks/notify.sh"
}
]
}
]
}
}Install from the Chrome Web Store or Firefox Add-ons (search for "Claude Code Notify").
┌─────────────────┐ HTTP POST ┌─────────────────┐ WebSocket ┌─────────────────┐
│ Claude Code │ ─────────────────► │ Local Server │ ◄───────────────► │ Browser Extension│
│ (with hooks) │ │ (Node.js) │ │ (Chrome/Firefox)│
└─────────────────┘ └─────────────────┘ └─────────────────┘
- Claude Code Hooks - Send HTTP requests when events occur
- Local WebSocket Server - Receives hook events, broadcasts to browser
- Browser Extension - Connects to server, shows notifications
| Event | Title | Behavior |
|---|---|---|
permission_prompt |
"Claude needs permission" | High priority, stays visible until clicked |
idle_prompt |
"Claude is waiting" | Normal priority, auto-dismisses |
stop |
"Claude finished" | Low priority, auto-dismisses |
Click the extension icon to access settings:
- Enable notifications - Toggle all notifications on/off
- Sound for notifications - Enable/disable notification sounds
- Notify when Claude is idle - Show notifications for idle prompts
- Notify when Claude finishes - Show notifications when tasks complete
- Test Notification - Send a test notification
- Reconnect - Manually reconnect to the server
Send a notification to connected browser extensions.
Request:
{
"type": "permission_prompt" | "idle_prompt" | "stop",
"message": "Description of what Claude needs"
}Response:
{
"success": true,
"clientsNotified": 1
}Check server status.
Response:
{
"status": "ok",
"connectedClients": 1,
"uptime": 123.456
}- The server should auto-start when Claude Code runs. Check if it's running:
curl http://localhost:3099/health
- If not running, start it manually:
cd server && npm start - Check if port 3099 is available:
lsof -i :3099 - Click "Reconnect" in the extension popup
- Check browser notification permissions for the extension
- Ensure "Enable notifications" is toggled on in the extension
- Verify the server received the request (check server logs)
- Verify Claude Code settings are configured correctly
- Check that scripts are executable:
chmod +x hooks/notify.sh hooks/ensure-server.sh - Test the hook manually:
echo '{}' | CLAUDE_HOOK_NAME=permission_prompt ./hooks/notify.sh
The server auto-starts when Claude Code launches. For manual control:
# Check server status
curl http://localhost:3099/health
# View server logs
tail -f /tmp/claude-notify-server.log
# Stop the server
kill $(cat /tmp/claude-notify-server.pid)
# Start server manually (for development)
cd server && npm start
# Check if multiple instances are running
pgrep -f "node.*index.js"claude-code-notify/
├── server/
│ ├── package.json
│ ├── src/
│ │ └── index.ts # WebSocket + HTTP server
│ └── dist/ # Compiled output
├── extension/
│ ├── manifest.json # Chrome manifest (v3)
│ ├── manifest.firefox.json # Firefox manifest (v2)
│ ├── src/
│ │ ├── background.ts # Service worker
│ │ └── popup.ts # Popup logic
│ ├── popup.html # Settings popup
│ ├── popup.css # Popup styles
│ ├── dist/ # Compiled output
│ └── icons/
├── hooks/
│ ├── notify.sh # Hook script for notifications
│ └── ensure-server.sh # Auto-starts server if not running
└── README.md
- Build and start the server:
cd server && npm install && npm run build && npm start - Build the extension:
cd extension && npm install && npm run build - Load the extension in developer mode:
- Chrome: Go to
chrome://extensions, enable "Developer mode", click "Load unpacked", select theextensionfolder - Firefox: Go to
about:debugging#/runtime/this-firefox, click "Load Temporary Add-on", selectextension/manifest.firefox.json
- Chrome: Go to
- Make changes to extension files and run
npm run buildin the extension folder - Click "Reload" on the extension in
chrome://extensionsorabout:debugging
MIT