claude-notification-plugin 1.0.80 → 1.0.88

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,14 +1,13 @@
1
- {
2
- "name": "claude-notification-plugin",
3
- "version": "1.0.80",
4
- "description": "Claude Code task-completion notifications: Telegram, desktop notifications (Windows/macOS/Linux), sound, and voice",
5
- "author": {
6
- "name": "Viacheslav Makarov",
7
- "email": "npmjs@bazilio.ru"
8
- },
9
- "homepage": "https://github.com/Bazilio-san/claude-notification-plugin#readme",
10
- "repository": "https://github.com/Bazilio-san/claude-notification-plugin",
11
- "license": "MIT",
12
- "keywords": ["notification", "telegram", "windows", "sound", "voice", "hooks"],
13
- "commands": "./commands/"
14
- }
1
+ {
2
+ "name": "claude-notification-plugin",
3
+ "version": "1.0.88",
4
+ "description": "Claude Code task-completion notifications: Telegram, desktop notifications (Windows/macOS/Linux), sound, and voice",
5
+ "author": {
6
+ "name": "Viacheslav Makarov",
7
+ "email": "npmjs@bazilio.ru"
8
+ },
9
+ "homepage": "https://github.com/Bazilio-san/claude-notification-plugin#readme",
10
+ "repository": "https://github.com/Bazilio-san/claude-notification-plugin",
11
+ "license": "MIT",
12
+ "keywords": ["notification", "telegram", "windows", "sound", "voice", "hooks"]
13
+ }
package/README.md CHANGED
@@ -1,283 +1,276 @@
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
- - **[Telegram Listener](LISTENER.md)** — your remote control for Claude: send a message in Telegram, and the task starts running on your PC
16
-
17
- ## Install
18
-
19
- ### Option A: Claude Code Plugin (recommended)
20
-
21
- Auto-updates, seamless integration with the plugin ecosystem.
22
-
23
- ```shell
24
- /plugin marketplace add Bazilio-san/claude-plugins
25
- /plugin install claude-notification-plugin@bazilio-plugins
26
- /reload-plugins
27
- /claude-notification-plugin:setup
28
- ```
29
-
30
- Go to `/plugin` → **Marketplaces** tab → select `bazilio-plugins` → **Enable auto-update**.
31
-
32
- For a detailed visual walkthrough, see [step-by-step installation guide with screenshots](INSTALL_MARKETPLACE_AND_PLUGIN.md).
33
-
34
-
35
- ### Option B: npm global package
36
-
37
- Simple install, works without the plugin system.
38
-
39
- ```bash
40
- npm install -g claude-notification-plugin
41
- claude-notify-install
42
- ```
43
-
44
- The installer will:
45
- 1. Ask for Telegram bot credentials (or keep existing ones on re-run)
46
- 2. Create/update config at `~/.claude/notifier.config.json`
47
- 3. Register hooks in `~/.claude/settings.json`
48
-
49
- Re-running `claude-notify-install` after an update merges new config options without overwriting your existing settings.
50
-
51
- ## Configuration
52
-
53
- Config file: `~/.claude/notifier.config.json`
54
-
55
- ```json
56
- {
57
- "telegram": {
58
- "enabled": true,
59
- "token": "YOUR_BOT_TOKEN",
60
- "chatId": "YOUR_CHAT_ID",
61
- "deleteAfterHours": 24,
62
- "includeLastCcMessageInTelegram": true
63
- },
64
- "desktopNotification": {
65
- "enabled": true
66
- },
67
- "sound": {
68
- "enabled": true,
69
- "file": ""
70
- },
71
- "voice": {
72
- "enabled": true
73
- },
74
- "webhookUrl": "",
75
- "sendUserPromptToWebhook": false,
76
- "notifyAfterSeconds": 15,
77
- "notifyOnWaiting": false,
78
- "debug": false
79
- }
80
- ```
81
-
82
- Environment variables override config values (`"1"` = on, `"0"` = off).
83
-
84
-
85
- **telegram.enabled**
86
- Enable Telegram messages.
87
- Default: **true**
88
- ENV: `CLAUDE_NOTIFY_TELEGRAM`
89
-
90
-
91
- **telegram.token**
92
- Bot token from @BotFather.
93
- ENV: `CLAUDE_NOTIFY_TELEGRAM_TOKEN`
94
-
95
-
96
- **telegram.chatId**
97
- Chat ID to send messages to.
98
- ENV: `CLAUDE_NOTIFY_TELEGRAM_CHAT_ID`
99
-
100
-
101
- **telegram.deleteAfterHours**
102
- Auto-delete old Telegram messages after the specified number of hours. Set `0` to disable.
103
- Default: **24**
104
-
105
-
106
- **telegram.includeLastCcMessageInTelegram**
107
- Append Claude's last assistant message to the Telegram notification. Long messages are truncated to 3500 characters.
108
- Default: **true**
109
- ENV: `CLAUDE_NOTIFY_INCLUDE_LAST_CC_MESSAGE_IN_TELEGRAM`
110
-
111
-
112
- **desktopNotification.enabled**
113
- Desktop notifications (Windows toast, macOS Notification Center, Linux notify-send).
114
- Default: **true**
115
- ENV: `CLAUDE_NOTIFY_DESKTOP`
116
-
117
-
118
- **sound.enabled**
119
- Sound alert on task completion.
120
- Default: **true**
121
- ENV: `CLAUDE_NOTIFY_SOUND`
122
-
123
-
124
- **sound.file**
125
- 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`.
126
- Default: **platform default**
127
-
128
-
129
- **voice.enabled**
130
- Voice announcement (TTS) with duration in words.
131
- Default: **true**
132
- ENV: `CLAUDE_NOTIFY_VOICE`
133
-
134
-
135
- **notifyOnWaiting**
136
- Send notifications when Claude is waiting for user input (e.g. permission prompts).
137
- Default: **false**
138
- ENV: `CLAUDE_NOTIFY_WAITING`
139
-
140
-
141
- **webhookUrl**
142
- POST notification data (JSON) to this URL. Payload: `title`, `project`, `branch`, `duration`, `trigger`, `voicePhrase`, `hookEvent`.
143
- ENV: `CLAUDE_NOTIFY_WEBHOOK_URL`
144
-
145
-
146
- **sendUserPromptToWebhook**
147
- Also send user prompts to the webhook. Payload: `title`, `project`, `trigger`, `prompt`, `hookEvent`. Requires `webhookUrl`.
148
- Default: **false**
149
- ENV: `CLAUDE_NOTIFY_SEND_USER_PROMPT_TO_WEBHOOK`
150
-
151
-
152
- **notifyAfterSeconds**
153
- Skip notifications for tasks shorter than this (seconds).
154
- Default: **15**
155
- ENV: `CLAUDE_NOTIFY_AFTER_SECONDS`
156
-
157
-
158
- **debug**
159
- Include trigger event type, voice phrase text, and full hook event JSON in notifications.
160
- Default: **false**
161
- ENV: `CLAUDE_NOTIFY_DEBUG`
162
-
163
-
164
- ENV: **CLAUDE_NOTIFY_DISABLE**
165
- Set to `1` to disable all notifications for the current project.
166
- Default: **0**
167
-
168
- ENV: **CLAUDE_NOTIFY_AFTER_LISTENER**
169
- When a task is started by the Telegram Listener, notifications are suppressed by default to avoid duplicates (the listener sends its own status messages). Set to `1` to enable notifier notifications for listener-spawned tasks.
170
- Default: **0**
171
-
172
- ### Per-project configuration
173
-
174
- Add to `.claude/settings.local.json` in the project root to control channels per project:
175
-
176
- ```json
177
- {
178
- "env": {
179
- "CLAUDE_NOTIFY_DISABLE": 0,
180
- "CLAUDE_NOTIFY_TELEGRAM": 1,
181
- "CLAUDE_NOTIFY_DESKTOP": 1,
182
- "CLAUDE_NOTIFY_SOUND": 1,
183
- "CLAUDE_NOTIFY_VOICE": 1,
184
- "CLAUDE_NOTIFY_WAITING": 1,
185
- "CLAUDE_NOTIFY_DEBUG": 0,
186
- "CLAUDE_NOTIFY_INCLUDE_LAST_CC_MESSAGE_IN_TELEGRAM": 1,
187
- "CLAUDE_NOTIFY_WEBHOOK_URL": "",
188
- "CLAUDE_NOTIFY_SEND_USER_PROMPT_TO_WEBHOOK": 0,
189
- "CLAUDE_NOTIFY_AFTER_SECONDS": 15
190
- }
191
- }
192
- ```
193
-
194
- To disable all notifications for a project:
195
-
196
- ```json
197
- {
198
- "env": {
199
- "CLAUDE_NOTIFY_DISABLE": "1"
200
- }
201
- }
202
- ```
203
-
204
- ## Notification format
205
-
206
- Notifications include project name, git branch (when available), duration, and the trigger event:
207
-
208
- ```
209
- 🤖 Claude finished coding
210
-
211
- Project: my-project
212
- Branch: feature-auth
213
- Duration: 45s
214
- ```
215
-
216
- When Claude is waiting for input (and `notifyOnWaiting` is enabled):
217
-
218
- ```
219
- 🤖 Claude waiting for input
220
-
221
- Project: my-project
222
- Branch: feature-auth
223
- Duration: 30s
224
- ```
225
-
226
- ## Telegram Setup
227
-
228
- 1. Open Telegram, find **@BotFather**
229
- 2. Send `/newbot`, follow prompts, pick a name
230
- 3. Copy the bot token (format: `123456789:ABCdef...`)
231
- 4. **Send any message to your new bot**
232
- 5. Open `https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates`
233
- 6. Find `"chat":{"id":123456789}` in the response — that's your Chat ID
234
- 7. Run `claude-notify-install` and enter the token and chat ID
235
-
236
- Alternative for Chat ID: add **@userinfobot** to a chat and it will reply with the ID.
237
-
238
- ## Telegram Listener (Telegram → Claude Code)
239
-
240
- 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.
241
-
242
- When installed as a plugin, you can manage the listener daemon directly from Claude Code with the `/listener` slash command:
243
- `/claude-notification-plugin:listener start | stop | status | logs | restart`
244
-
245
- ## CLI Commands Registration
246
-
247
- When installed as a **plugin**, CLI commands (`claude-notify-listener`, etc.) are not in PATH.
248
- The `/claude-notification-plugin:setup` command registers them automatically by placing wrapper scripts next to the `claude` binary.
249
-
250
- To manage manually:
251
-
252
- ```bash
253
- claude-notify-register # register CLI commands
254
- claude-notify-register list # show registration status
255
- claude-notify-register unregister # remove CLI commands
256
- ```
257
-
258
- When installed via `npm install -g`, npm links the commands itself — no extra step needed.
259
-
260
- ## Testing (load without install)
261
-
262
- ```bash
263
- claude --plugin-dir /path/to/claude-notification-plugin
264
- ```
265
-
266
- ## Uninstall
267
-
268
- ### Plugin install
269
-
270
- Uninstall via the plugin manager or remove `--plugin-dir` flag.
271
-
272
- ### npm
273
-
274
- ```bash
275
- claude-notify-uninstall
276
- npm uninstall -g claude-notification-plugin
277
- ```
278
-
279
- Hooks are registered automatically.
280
-
281
- ## License
282
-
283
- MIT
1
+ # Your remote control for Anthropic Claude Code
2
+
3
+ **Send a message in Telegram, and the task starts running on your PC.**
4
+
5
+ Cross-platform notifications for Claude Code task completion.
6
+ Sends alerts to Telegram and desktop (Windows, macOS, Linux) when Claude finishes working.
7
+
8
+
9
+ ## Features
10
+
11
+ - **[Telegram Listener](#telegram-listener)** your remote control for Claude (supports worktrees)
12
+ - Telegram bot messages with auto-delete
13
+ - Webhook notifications (any URL endpoint)
14
+ - Desktop notifications (Windows toast, macOS Notification Center, Linux notify-send)
15
+ - Sound alert
16
+ - Voice announcement
17
+ - Separate notifications for task completion and waiting-for-input events
18
+ - Skips short tasks (< 15s by default)
19
+ - Per-channel enable/disable (globally and per-project)
20
+
21
+ ## Install
22
+
23
+ ```bash
24
+ npm install -g claude-notification-plugin
25
+ ```
26
+
27
+ The installer prompts for Telegram bot credentials and sets everything up.
28
+ Re-run `claude-notify-install` anytime to reconfigure.
29
+
30
+ ## Uninstall
31
+
32
+ ```bash
33
+ npm uninstall -g claude-notification-plugin
34
+ ```
35
+
36
+ ## Configuration
37
+
38
+ Config file: `~/.claude/notifier.config.json`
39
+
40
+ ```json
41
+ {
42
+ "telegram": {
43
+ "enabled": true,
44
+ "token": "YOUR_BOT_TOKEN",
45
+ "chatId": "YOUR_CHAT_ID",
46
+ "deleteAfterHours": 24,
47
+ "includeLastCcMessageInTelegram": true
48
+ },
49
+ "desktopNotification": {
50
+ "enabled": true
51
+ },
52
+ "sound": {
53
+ "enabled": true,
54
+ "file": ""
55
+ },
56
+ "voice": {
57
+ "enabled": true
58
+ },
59
+ "webhookUrl": "",
60
+ "sendUserPromptToWebhook": false,
61
+ "notifyAfterSeconds": 15,
62
+ "notifyOnWaiting": false,
63
+ "debug": false,
64
+ "listener": {
65
+ "projects": {
66
+ "default": {
67
+ "path": "abs-path-to-project"
68
+ },
69
+ "alias1": {
70
+ "path": "abs-path-to-project"
71
+ }
72
+ },
73
+ "worktreeBaseDir": "abs-path-to-worktrees-root",
74
+ "autoCreateWorktree": true,
75
+ "taskTimeoutMinutes": 30,
76
+ "maxQueuePerWorkDir": 10,
77
+ "maxTotalTasks": 50,
78
+ "logDir": "abs-path-to-listener-logs",
79
+ "taskLogDir": "abs-path-to-task-logs"
80
+ }
81
+ }
82
+ ```
83
+
84
+ Environment variables override config values (`"1"` = on, `"0"` = off).
85
+
86
+ **telegram.enabled** — Enable Telegram messages. Default: **true**
87
+ ENV: `CLAUDE_NOTIFY_TELEGRAM`
88
+
89
+ **telegram.token** — Bot token from @BotFather.
90
+ ENV: `CLAUDE_NOTIFY_TELEGRAM_TOKEN`
91
+
92
+ **telegram.chatId** Chat ID to send messages to.
93
+ ENV: `CLAUDE_NOTIFY_TELEGRAM_CHAT_ID`
94
+
95
+ **telegram.deleteAfterHours** — Auto-delete old Telegram messages after N hours. `0` to disable. Default: **24**
96
+
97
+ **telegram.includeLastCcMessageInTelegram** Append Claude's last message to the notification (truncated to 3500 chars). Default: **true**
98
+ ENV: `CLAUDE_NOTIFY_INCLUDE_LAST_CC_MESSAGE_IN_TELEGRAM`
99
+
100
+ **desktopNotification.enabled** — Desktop notifications. Default: **true**
101
+ ENV: `CLAUDE_NOTIFY_DESKTOP`
102
+
103
+ **sound.enabled** — Sound alert on task completion. Default: **true**
104
+ ENV: `CLAUDE_NOTIFY_SOUND`
105
+
106
+ **sound.file** — Custom sound file path. Default: **platform default**
107
+
108
+ **voice.enabled** — Voice announcement (TTS) with duration. Default: **true**
109
+ ENV: `CLAUDE_NOTIFY_VOICE`
110
+
111
+ **notifyOnWaiting** — Notify when Claude is waiting for input. Default: **false**
112
+ ENV: `CLAUDE_NOTIFY_WAITING`
113
+
114
+ **webhookUrl** — POST notification JSON to this URL. Payload: `title`, `project`, `branch`, `duration`, `trigger`, `voicePhrase`, `hookEvent`.
115
+ ENV: `CLAUDE_NOTIFY_WEBHOOK_URL`
116
+
117
+ **sendUserPromptToWebhook** — Also send user prompts to the webhook. Requires `webhookUrl`. Default: **false**
118
+ ENV: `CLAUDE_NOTIFY_SEND_USER_PROMPT_TO_WEBHOOK`
119
+
120
+ **notifyAfterSeconds** — Skip notifications for tasks shorter than this. Default: **15**
121
+ ENV: `CLAUDE_NOTIFY_AFTER_SECONDS`
122
+
123
+ **debug** — Include trigger event type and full hook event JSON in notifications. Default: **false**
124
+ ENV: `CLAUDE_NOTIFY_DEBUG`
125
+
126
+ **CLAUDE_NOTIFY_DISABLE** — Set to `1` to disable all notifications for the current project.
127
+
128
+ **CLAUDE_NOTIFY_AFTER_LISTENER** — Enable notifier notifications for listener-spawned tasks (suppressed by default to avoid duplicates). Set to `1` to enable.
129
+
130
+ ### Per-project configuration
131
+
132
+ Add to `.claude/settings.local.json` in the project root:
133
+
134
+ ```json
135
+ {
136
+ "env": {
137
+ "CLAUDE_NOTIFY_DISABLE": 0,
138
+ "CLAUDE_NOTIFY_TELEGRAM": 1,
139
+ "CLAUDE_NOTIFY_DESKTOP": 1,
140
+ "CLAUDE_NOTIFY_SOUND": 1,
141
+ "CLAUDE_NOTIFY_VOICE": 1,
142
+ "CLAUDE_NOTIFY_WAITING": 1,
143
+ "CLAUDE_NOTIFY_DEBUG": 0,
144
+ "CLAUDE_NOTIFY_INCLUDE_LAST_CC_MESSAGE_IN_TELEGRAM": 1,
145
+ "CLAUDE_NOTIFY_WEBHOOK_URL": "",
146
+ "CLAUDE_NOTIFY_SEND_USER_PROMPT_TO_WEBHOOK": 0,
147
+ "CLAUDE_NOTIFY_AFTER_SECONDS": 15
148
+ }
149
+ }
150
+ ```
151
+
152
+ ## Telegram Setup
153
+
154
+ 1. Open Telegram, find **@BotFather**
155
+ 2. Send `/newbot`, follow prompts, pick a name
156
+ 3. Copy the bot token (format: `123456789:ABCdef...`)
157
+ 4. **Send any message to your new bot**
158
+ 5. Open `https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates`
159
+ 6. Find `"chat":{"id":123456789}` in the response that's your Chat ID
160
+
161
+ Alternative: add **@userinfobot** to a chat and it will reply with the ID.
162
+
163
+ ## Telegram Listener
164
+
165
+ Background daemon that receives tasks from Telegram and executes them via `claude -p`. The result is sent back to Telegram.
166
+
167
+ The Listener uses the same bot and `chatId` as notifications.
168
+
169
+ ### 1. Add a `listener` section to config
170
+
171
+ ```json
172
+ {
173
+ "listener": {
174
+ "projects": {
175
+ "default": { "path": "/home/user/my-project" },
176
+ "api": { "path": "/home/user/projects/api-server" },
177
+ "web": { "path": "/home/user/projects/web-app" }
178
+ }
179
+ }
180
+ }
181
+ ```
182
+
183
+ The `"default"` alias receives messages without a `@project` prefix.
184
+ `api` and `web` are project aliases for easy reference from Telegram.
185
+
186
+ ### 2. Start the listener
187
+
188
+ ```bash
189
+ claude-notify-listener start
190
+ ```
191
+
192
+ ### 3. Send tasks from Telegram
193
+
194
+ ```
195
+ fix the login bug → runs in "default" project
196
+ @api add pagination to GET /users → runs in "api" project
197
+ @api/feature/auth implement OAuth2 → runs in a worktree (auto-created)
198
+ ```
199
+
200
+ The bot replies with status and results:
201
+
202
+ ```
203
+ ⏳ [@api] Running: add pagination to GET /users
204
+ ...
205
+ ✅ [@api] Done: add pagination to GET /users
206
+ <claude's output>
207
+ ```
208
+
209
+ ### 4. Manage the daemon
210
+
211
+ ```bash
212
+ claude-notify-listener status # Check if running
213
+ claude-notify-listener stop # Stop
214
+ claude-notify-listener restart # Restart
215
+ claude-notify-listener logs # View last 50 log lines
216
+ ```
217
+
218
+ ### 5. Bot commands
219
+
220
+ All commands start with `/` and execute instantly (not queued).
221
+
222
+ | Command | Description |
223
+ |-------------------------------|--------------------------------------|
224
+ | `/status` | Status of all projects and worktrees |
225
+ | `/status @project` | Status of a specific project |
226
+ | `/queue` | Show all queues |
227
+ | `/cancel @project[/branch]` | Cancel the active task |
228
+ | `/drop @project N` | Remove task N from queue |
229
+ | `/clear @project[/branch]` | Clear queue |
230
+ | `/projects` | List projects and paths |
231
+ | `/worktrees @project` | List worktrees |
232
+ | `/worktree @project branch` | Create a worktree |
233
+ | `/rmworktree @project branch` | Remove a worktree |
234
+ | `/history` | Recent task history |
235
+ | `/stop` | Stop the listener |
236
+ | `/help` | Show help |
237
+
238
+ ### Listener configuration
239
+
240
+ | Parameter | Default | Description |
241
+ |----------------------|-----------------------|-----------------------------------------------------|
242
+ | `projects` | (required) | Map of projects: `alias { path }` |
243
+ | `worktreeBaseDir` | `~/.claude/worktrees` | Where auto-created worktrees are stored |
244
+ | `autoCreateWorktree` | `true` | Auto-create worktrees for unknown branches |
245
+ | `taskTimeoutMinutes` | `30` | Max task execution time (force-stopped when exceeded)|
246
+ | `maxQueuePerWorkDir` | `10` | Max tasks in queue per working directory |
247
+ | `maxTotalTasks` | `50` | Max tasks across all queues |
248
+ | `logDir` | `~/.claude` | Listener log directory |
249
+ | `taskLogDir` | same as `logDir` | Task Q&A log directory |
250
+
251
+ ### Projects and worktrees
252
+
253
+ **The queue is tied to the working directory, not the project name:**
254
+ - `@api task` and `@api/feature/auth task` → **different queues** (parallel)
255
+ - `@api task1` and `@api task2` → **same queue** (sequential)
256
+
257
+ Worktrees are auto-created when you use `@project/branch` syntax (controlled by `autoCreateWorktree`).
258
+
259
+ ```
260
+ /worktree @api feature/payments ← create
261
+ /worktrees @api ← list
262
+ /rmworktree @api feature/payments ← remove
263
+ ```
264
+
265
+ [Detailed Guide](listener/LISTENER-DETAILED.md) — internals, architecture, troubleshooting, full session example.
266
+
267
+ ## CLI Commands
268
+
269
+ | Command | Description |
270
+ |--------------------------|-------------------------------------------------------------------------------|
271
+ | `claude-notify-install` | Re-run to reinstall plugin registration, Telegram config, hooks, CLI wrappers |
272
+ | `claude-notify-listener` | Manage the Telegram Listener daemon (start/stop/status/logs/restart) |
273
+
274
+ ## License
275
+
276
+ MIT