claude-notification-plugin 1.0.59 → 1.0.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-notification-plugin",
3
- "version": "1.0.59",
3
+ "version": "1.0.65",
4
4
  "description": "Claude Code task-completion notifications: Telegram, desktop notifications (Windows/macOS/Linux), sound, and voice",
5
5
  "author": {
6
6
  "name": "Viacheslav Makarov",
package/README.md CHANGED
@@ -1,208 +1,261 @@
1
- # claude-notification-plugin
2
-
3
- Cross-platform notifications for Claude Code task completion. Sends alerts to Telegram and desktop (Windows, macOS, Linux) when Claude finishes working.
4
-
5
- ## Features
6
-
7
- - Desktop notifications (Windows toast, macOS Notification Center, Linux notify-send)
8
- - Telegram bot messages with auto-delete
9
- - Sound alert (Windows: PowerShell, macOS: afplay, Linux: paplay/aplay)
10
- - Voice announcement with number-to-words and pluralization (EN, RU) (Windows: SAPI, macOS: say, Linux: spd-say/espeak)
11
- - Separate notifications for task completion and waiting-for-input events
12
- - Skips short tasks (< 15s by default)
13
- - Granular per-channel enable/disable (globally and per-project)
14
- - Debug mode with full hook event dump
15
-
16
- ## Install
17
-
18
- ### Option A: Claude Code Plugin (recommended)
19
-
20
- Add the marketplace and install:
21
-
22
- ```shell
23
- /plugin marketplace add Bazilio-san/claude-plugins
24
- /plugin install claude-notification-plugin@bazilio-plugins
25
- /reload-plugins
26
- /claude-notification-plugin:setup
27
- ```
28
-
29
- For a detailed visual walkthrough, see [step-by-step installation guide with screenshots](INSTALL_MARKETPLACE_AND_PLUGIN.md).
30
-
31
- Or load directly for testing:
32
-
33
- ```bash
34
- claude --plugin-dir /path/to/claude-notification-plugin
35
- ```
36
-
37
- Hooks are registered automatically.
38
-
39
- To enable auto-updates, go to `/plugin` → **Marketplaces** tab → select `bazilio-plugins` → **Enable auto-update**.
40
-
41
- To configure Telegram credentials, run:
42
-
43
- ```shell
44
- /claude-notification-plugin:setup
45
- ```
46
-
47
- ### Option B: npm global package
48
-
49
- ```bash
50
- npm install -g claude-notification-plugin
51
- claude-notify-install
52
- ```
53
-
54
- The installer will:
55
- 1. Ask for Telegram bot credentials (or keep existing ones on re-run)
56
- 2. Create/update config at `~/.claude/notifier.config.json`
57
- 3. Register hooks in `~/.claude/settings.json`
58
-
59
- Re-running `claude-notify-install` after an update merges new config options without overwriting your existing settings.
60
-
61
- ## Configuration
62
-
63
- Config file: `~/.claude/notifier.config.json`
64
-
65
- ```json
66
- {
67
- "telegram": {
68
- "enabled": true,
69
- "token": "YOUR_BOT_TOKEN",
70
- "chatId": "YOUR_CHAT_ID",
71
- "deleteAfterHours": 24,
72
- "includeLastCcMessageInTelegram": true
73
- },
74
- "desktopNotification": {
75
- "enabled": true
76
- },
77
- "sound": {
78
- "enabled": true,
79
- "file": ""
80
- },
81
- "voice": {
82
- "enabled": true
83
- },
84
- "webhookUrl": "",
85
- "sendUserPromptToWebhook": false,
86
- "minSeconds": 15,
87
- "notifyOnWaiting": false,
88
- "debug": false
89
- }
90
- ```
91
-
92
- Each channel has an `enabled` flag (`true`/`false`) for global control.
93
-
94
- `sound.file` path to a sound file. Leave empty for platform default (Windows: `C:/Windows/Media/notify.wav`, macOS: `/System/Library/Sounds/Glass.aiff`, Linux: `/usr/share/sounds/freedesktop/stereo/complete.oga`).
95
-
96
- `deleteAfterHours` — auto-delete old Telegram messages after the specified number of hours (default: `24`, set `0` to disable).
97
-
98
- `includeLastCcMessageInTelegram` — append Claude's last assistant message to the Telegram notification (default: `true`). Only affects Telegram, not Windows toast notifications. Long messages are truncated to 3500 characters.
99
-
100
- `notifyOnWaiting` — send notifications when Claude is waiting for user input, e.g. permission prompts (default: `false`, set `true` to enable).
101
-
102
- `webhookUrl` — URL to send a POST request with full notification data (JSON). If empty, no request is sent. On `Stop`/`Notification` events the payload includes `title`, `project`, `branch`, `duration`, `trigger`, `voicePhrase`, and `hookEvent` (the raw hook input). Useful for integrating with custom dashboards, logging services, or automation pipelines.
103
-
104
- `sendUserPromptToWebhook` also send user prompts to the webhook URL (default: `false`). When enabled, each `UserPromptSubmit` event sends a POST with `title`, `project`, `trigger`, `prompt` (user's message text), and `hookEvent`. Requires `webhookUrl` to be set.
105
-
106
- `debug` — include extra info in notifications: voice phrase text, full hook event JSON (formatted as code block in Telegram). Default: `false`.
107
-
108
- Environment variables `CLAUDE_NOTIFY_TELEGRAM_TOKEN` and `CLAUDE_NOTIFY_TELEGRAM_CHAT_ID` override config file values.
109
-
110
- ### Per-channel environment variables
111
-
112
- These env vars override the global config per channel (`"1"` = on, `"0"` = off):
113
-
114
- | Variable | Channel |
115
- |-------------------------------------------------------|-----------------------------------------|
116
- | `CLAUDE_NOTIFY_TELEGRAM` | Telegram messages |
117
- | `CLAUDE_NOTIFY_DESKTOP` | Desktop notifications |
118
- | `CLAUDE_NOTIFY_SOUND` | Sound alert |
119
- | `CLAUDE_NOTIFY_VOICE` | Voice announcement (TTS) |
120
- | `CLAUDE_NOTIFY_WAITING` | Waiting-for-input events |
121
- | `CLAUDE_NOTIFY_DEBUG` | Debug mode |
122
- | `CLAUDE_NOTIFY_INCLUDE_LAST_CC_MESSAGE_IN_TELEGRAM` | Include last Claude message in Telegram |
123
- | `CLAUDE_NOTIFY_WEBHOOK_URL` | Webhook URL for POST requests |
124
- | `CLAUDE_NOTIFY_SEND_USER_PROMPT_TO_WEBHOOK` | Send user prompts to webhook |
125
-
126
- ### Per-project configuration
127
-
128
- Add to `.claude/settings.local.json` in the project root to control channels per project:
129
-
130
- ```json
131
- {
132
- "env": {
133
- "CLAUDE_NOTIFY_DISABLE": 0,
134
- "CLAUDE_NOTIFY_TELEGRAM": 1,
135
- "CLAUDE_NOTIFY_DESKTOP": 1,
136
- "CLAUDE_NOTIFY_SOUND": 1,
137
- "CLAUDE_NOTIFY_VOICE": 1,
138
- "CLAUDE_NOTIFY_WAITING": 1,
139
- "CLAUDE_NOTIFY_DEBUG": 0,
140
- "CLAUDE_NOTIFY_INCLUDE_LAST_CC_MESSAGE_IN_TELEGRAM": 1,
141
- "CLAUDE_NOTIFY_WEBHOOK_URL": "",
142
- "CLAUDE_NOTIFY_SEND_USER_PROMPT_TO_WEBHOOK": 0
143
- }
144
- }
145
- ```
146
-
147
- To disable all notifications for a project:
148
-
149
- ```json
150
- {
151
- "env": {
152
- "CLAUDE_NOTIFY_DISABLE": "1"
153
- }
154
- }
155
- ```
156
-
157
- ## Notification format
158
-
159
- Notifications include project name, git branch (when available), duration, and the trigger event:
160
-
161
- ```
162
- 🤖 Claude finished coding
163
-
164
- Project: my-project
165
- Branch: feature-auth
166
- Duration: 45s
167
- Trigger: Stop
168
- ```
169
-
170
- When Claude is waiting for input (and `notifyOnWaiting` is enabled):
171
-
172
- ```
173
- 🤖 Claude waiting for input
174
-
175
- Project: my-project
176
- Branch: feature-auth
177
- Duration: 30s
178
- Trigger: Notification
179
- ```
180
-
181
- ## Telegram Setup
182
-
183
- 1. Open Telegram, find **@BotFather**
184
- 2. Send `/newbot`, follow prompts, pick a name
185
- 3. Copy the bot token (format: `123456789:ABCdef...`)
186
- 4. **Send any message to your new bot**
187
- 5. Open `https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates`
188
- 6. Find `"chat":{"id":123456789}` in the response — that's your Chat ID
189
- 7. Run `claude-notify-install` and enter the token and chat ID
190
-
191
- Alternative for Chat ID: add **@userinfobot** to a chat and it will reply with the ID.
192
-
193
- ## Uninstall
194
-
195
- ### Plugin install
196
-
197
- Uninstall via the plugin manager or remove `--plugin-dir` flag.
198
-
199
- ### npm install
200
-
201
- ```bash
202
- claude-notify-uninstall
203
- npm uninstall -g claude-notification-plugin
204
- ```
205
-
206
- ## License
207
-
208
- MIT
1
+ # claude-notification-plugin
2
+
3
+ Cross-platform notifications for Claude Code task completion. Sends alerts to Telegram and desktop (Windows, macOS, Linux) when Claude finishes working.
4
+
5
+ ## Features
6
+
7
+ - Desktop notifications (Windows toast, macOS Notification Center, Linux notify-send)
8
+ - Telegram bot messages with auto-delete
9
+ - Sound alert
10
+ - Voice announcement
11
+ - Separate notifications for task completion and waiting-for-input events
12
+ - Skips short tasks (< 15s by default)
13
+ - Granular per-channel enable/disable (globally and per-project)
14
+ - Debug mode with full hook event dump
15
+
16
+
17
+ - **[Telegram Listener](LISTENER.md)** — your remote control for Claude: send a message in Telegram, and the task starts running on your PC
18
+
19
+ ## Install
20
+
21
+ ### Option A: Claude Code Plugin (recommended)
22
+
23
+ Auto-updates, seamless integration with the plugin ecosystem.
24
+
25
+ ```shell
26
+ /plugin marketplace add Bazilio-san/claude-plugins
27
+ /plugin install claude-notification-plugin@bazilio-plugins
28
+ /reload-plugins
29
+ /claude-notification-plugin:setup
30
+ ```
31
+
32
+ Go to `/plugin` → **Marketplaces** tab → select `bazilio-plugins` → **Enable auto-update**.
33
+
34
+ For a detailed visual walkthrough, see [step-by-step installation guide with screenshots](INSTALL_MARKETPLACE_AND_PLUGIN.md).
35
+
36
+
37
+ ### Option B: npm global package
38
+
39
+ Simple install, works without the plugin system.
40
+
41
+ ```bash
42
+ npm install -g claude-notification-plugin
43
+ claude-notify-install
44
+ ```
45
+
46
+ The installer will:
47
+ 1. Ask for Telegram bot credentials (or keep existing ones on re-run)
48
+ 2. Create/update config at `~/.claude/notifier.config.json`
49
+ 3. Register hooks in `~/.claude/settings.json`
50
+
51
+ Re-running `claude-notify-install` after an update merges new config options without overwriting your existing settings.
52
+
53
+ ## Configuration
54
+
55
+ Config file: `~/.claude/notifier.config.json`
56
+
57
+ ```json
58
+ {
59
+ "telegram": {
60
+ "enabled": true,
61
+ "token": "YOUR_BOT_TOKEN",
62
+ "chatId": "YOUR_CHAT_ID",
63
+ "deleteAfterHours": 24,
64
+ "includeLastCcMessageInTelegram": true
65
+ },
66
+ "desktopNotification": {
67
+ "enabled": true
68
+ },
69
+ "sound": {
70
+ "enabled": true,
71
+ "file": ""
72
+ },
73
+ "voice": {
74
+ "enabled": true
75
+ },
76
+ "webhookUrl": "",
77
+ "sendUserPromptToWebhook": false,
78
+ "minSeconds": 15,
79
+ "notifyOnWaiting": false,
80
+ "debug": false
81
+ }
82
+ ```
83
+
84
+ Environment variables override config values (`"1"` = on, `"0"` = off).
85
+
86
+
87
+ **telegram.enabled**
88
+ Enable Telegram messages.
89
+ Default: **true**
90
+ ENV: `CLAUDE_NOTIFY_TELEGRAM`
91
+
92
+
93
+ **telegram.token**
94
+ Bot token from @BotFather.
95
+ ENV: `CLAUDE_NOTIFY_TELEGRAM_TOKEN`
96
+
97
+
98
+ **telegram.chatId**
99
+ Chat ID to send messages to.
100
+ ENV: `CLAUDE_NOTIFY_TELEGRAM_CHAT_ID`
101
+
102
+
103
+ **telegram.deleteAfterHours**
104
+ Auto-delete old Telegram messages after the specified number of hours. Set `0` to disable.
105
+ Default: **24**
106
+
107
+
108
+ **telegram.includeLastCcMessageInTelegram**
109
+ Append Claude's last assistant message to the Telegram notification. Long messages are truncated to 3500 characters.
110
+ Default: **true**
111
+ ENV: `CLAUDE_NOTIFY_INCLUDE_LAST_CC_MESSAGE_IN_TELEGRAM`
112
+
113
+
114
+ **desktopNotification.enabled**
115
+ Desktop notifications (Windows toast, macOS Notification Center, Linux notify-send).
116
+ Default: **true**
117
+ ENV: `CLAUDE_NOTIFY_DESKTOP`
118
+
119
+
120
+ **sound.enabled**
121
+ Sound alert on task completion.
122
+ Default: **true**
123
+ ENV: `CLAUDE_NOTIFY_SOUND`
124
+
125
+
126
+ **sound.file**
127
+ Path to a custom sound file. Platform defaults: Windows `C:/Windows/Media/notify.wav`, macOS `/System/Library/Sounds/Glass.aiff`, Linux `/usr/share/sounds/freedesktop/stereo/complete.oga`.
128
+ Default: **platform default**
129
+
130
+
131
+ **voice.enabled**
132
+ Voice announcement (TTS) with duration in words.
133
+ Default: **true**
134
+ ENV: `CLAUDE_NOTIFY_VOICE`
135
+
136
+
137
+ **notifyOnWaiting**
138
+ Send notifications when Claude is waiting for user input (e.g. permission prompts).
139
+ Default: **false**
140
+ ENV: `CLAUDE_NOTIFY_WAITING`
141
+
142
+
143
+ **webhookUrl**
144
+ POST notification data (JSON) to this URL. Payload: `title`, `project`, `branch`, `duration`, `trigger`, `voicePhrase`, `hookEvent`.
145
+ ENV: `CLAUDE_NOTIFY_WEBHOOK_URL`
146
+
147
+
148
+ **sendUserPromptToWebhook**
149
+ Also send user prompts to the webhook. Payload: `title`, `project`, `trigger`, `prompt`, `hookEvent`. Requires `webhookUrl`.
150
+ Default: **false**
151
+ ENV: `CLAUDE_NOTIFY_SEND_USER_PROMPT_TO_WEBHOOK`
152
+
153
+
154
+ **minSeconds**
155
+ Skip notifications for tasks shorter than this (seconds).
156
+ Default: **15**
157
+
158
+
159
+ **debug**
160
+ Include trigger event type, voice phrase text, and full hook event JSON in notifications.
161
+ Default: **false**
162
+ ENV: `CLAUDE_NOTIFY_DEBUG`
163
+
164
+
165
+ ENV: **CLAUDE_NOTIFY_DISABLE**
166
+ Set to `1` to disable all notifications for the current project.
167
+ Default: **0**
168
+
169
+ ### Per-project configuration
170
+
171
+ Add to `.claude/settings.local.json` in the project root to control channels per project:
172
+
173
+ ```json
174
+ {
175
+ "env": {
176
+ "CLAUDE_NOTIFY_DISABLE": 0,
177
+ "CLAUDE_NOTIFY_TELEGRAM": 1,
178
+ "CLAUDE_NOTIFY_DESKTOP": 1,
179
+ "CLAUDE_NOTIFY_SOUND": 1,
180
+ "CLAUDE_NOTIFY_VOICE": 1,
181
+ "CLAUDE_NOTIFY_WAITING": 1,
182
+ "CLAUDE_NOTIFY_DEBUG": 0,
183
+ "CLAUDE_NOTIFY_INCLUDE_LAST_CC_MESSAGE_IN_TELEGRAM": 1,
184
+ "CLAUDE_NOTIFY_WEBHOOK_URL": "",
185
+ "CLAUDE_NOTIFY_SEND_USER_PROMPT_TO_WEBHOOK": 0
186
+ }
187
+ }
188
+ ```
189
+
190
+ To disable all notifications for a project:
191
+
192
+ ```json
193
+ {
194
+ "env": {
195
+ "CLAUDE_NOTIFY_DISABLE": "1"
196
+ }
197
+ }
198
+ ```
199
+
200
+ ## Notification format
201
+
202
+ Notifications include project name, git branch (when available), duration, and the trigger event:
203
+
204
+ ```
205
+ 🤖 Claude finished coding
206
+
207
+ Project: my-project
208
+ Branch: feature-auth
209
+ Duration: 45s
210
+ ```
211
+
212
+ When Claude is waiting for input (and `notifyOnWaiting` is enabled):
213
+
214
+ ```
215
+ 🤖 Claude waiting for input
216
+
217
+ Project: my-project
218
+ Branch: feature-auth
219
+ Duration: 30s
220
+ ```
221
+
222
+ ## Telegram Setup
223
+
224
+ 1. Open Telegram, find **@BotFather**
225
+ 2. Send `/newbot`, follow prompts, pick a name
226
+ 3. Copy the bot token (format: `123456789:ABCdef...`)
227
+ 4. **Send any message to your new bot**
228
+ 5. Open `https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates`
229
+ 6. Find `"chat":{"id":123456789}` in the response — that's your Chat ID
230
+ 7. Run `claude-notify-install` and enter the token and chat ID
231
+
232
+ Alternative for Chat ID: add **@userinfobot** to a chat and it will reply with the ID.
233
+
234
+ ## Telegram Listener (Telegram → Claude Code)
235
+
236
+ Your remote control for Claude: send a message in Telegram, and the task starts running on your PC. See **[LISTENER.md](LISTENER.md)** for the full guide.
237
+
238
+ ## Testing (load without install)
239
+
240
+ ```bash
241
+ claude --plugin-dir /path/to/claude-notification-plugin
242
+ ```
243
+
244
+ ## Uninstall
245
+
246
+ ### Plugin install
247
+
248
+ Uninstall via the plugin manager or remove `--plugin-dir` flag.
249
+
250
+ ### npm
251
+
252
+ ```bash
253
+ claude-notify-uninstall
254
+ npm uninstall -g claude-notification-plugin
255
+ ```
256
+
257
+ Hooks are registered automatically.
258
+
259
+ ## License
260
+
261
+ MIT