claude-notification-plugin 1.1.20 → 1.1.26

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.1.20",
3
+ "version": "1.1.26",
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
@@ -88,6 +88,8 @@ Config file: `~/.claude/claude-notify.config.json`
88
88
  "path": "abs-path-to-project"
89
89
  }
90
90
  },
91
+ "claudeArgs": ["--permission-mode", "auto"],
92
+ "continueSession": true,
91
93
  "worktreeBaseDir": "abs-path-to-worktrees-root",
92
94
  "autoCreateWorktree": true,
93
95
  "taskTimeoutMinutes": 30,
@@ -242,7 +244,8 @@ All commands start with `/` and execute instantly (not queued).
242
244
  | `/queue` | Show all queues |
243
245
  | `/cancel /project[/branch]` | Cancel the active task |
244
246
  | `/drop /project N` | Remove task N from queue |
245
- | `/clear /project[/branch]` | Clear queue |
247
+ | `/clear /project[/branch]` | Clear queue + reset session |
248
+ | `/newsession [/project[/branch]]` | Reset session only (keep queue) |
246
249
  | `/projects` | List projects and paths |
247
250
  | `/worktrees /project` | List worktrees |
248
251
  | `/worktree /project/branch` | Create a worktree |
@@ -253,16 +256,18 @@ All commands start with `/` and execute instantly (not queued).
253
256
 
254
257
  ### Listener configuration
255
258
 
256
- | Parameter | Default | Description |
257
- |----------------------|-----------------------|-----------------------------------------------------|
258
- | `projects` | (required) | Map of projects: `alias → { path }` |
259
- | `worktreeBaseDir` | `~/.claude/worktrees` | Where auto-created worktrees are stored |
260
- | `autoCreateWorktree` | `true` | Auto-create worktrees for unknown branches |
261
- | `taskTimeoutMinutes` | `30` | Max task execution time (force-stopped when exceeded)|
262
- | `maxQueuePerWorkDir` | `10` | Max tasks in queue per working directory |
263
- | `maxTotalTasks` | `50` | Max tasks across all queues |
264
- | `logDir` | `~/.claude` | Listener log directory |
265
- | `taskLogDir` | same as `logDir` | Task Q&A log directory |
259
+ | Parameter | Default | Description |
260
+ |----------------------|-----------------------|----------------------------------------------------------------------------------------|
261
+ | `projects` | (required) | Map of projects: `alias → { path }` |
262
+ | `claudeArgs` | `[]` | Extra CLI args for `claude -p` (e.g. `["--permission-mode", "auto"]`) |
263
+ | `continueSession` | `true` | Continue previous session context (`--continue` flag). Claude remembers previous tasks |
264
+ | `worktreeBaseDir` | `~/.claude/worktrees` | Where auto-created worktrees are stored |
265
+ | `autoCreateWorktree` | `true` | Auto-create worktrees for unknown branches |
266
+ | `taskTimeoutMinutes` | `30` | Max task execution time (force-stopped when exceeded) |
267
+ | `maxQueuePerWorkDir` | `10` | Max tasks in queue per working directory |
268
+ | `maxTotalTasks` | `50` | Max tasks across all queues |
269
+ | `logDir` | `~/.claude` | Listener log directory |
270
+ | `taskLogDir` | same as `logDir` | Task Q&A log directory |
266
271
 
267
272
  ### Projects and worktrees
268
273
 
@@ -270,6 +275,16 @@ All commands start with `/` and execute instantly (not queued).
270
275
  - `/api task` and `/api/feature/auth task` → **different queues** (parallel)
271
276
  - `/api task1` and `/api task2` → **same queue** (sequential)
272
277
 
278
+ `claudeArgs` can also be set per-project to override the global value:
279
+ ```json
280
+ "projects": {
281
+ "myapp": {
282
+ "path": "/path/to/myapp",
283
+ "claudeArgs": ["--permission-mode", "bypassPermissions", "--model", "opus"]
284
+ }
285
+ }
286
+ ```
287
+
273
288
  Worktrees are auto-created when you use `/project/branch` syntax (controlled by `autoCreateWorktree`).
274
289
 
275
290
  ```
package/bin/install.js CHANGED
@@ -622,6 +622,7 @@ Send any message to your bot in Telegram, then press Enter.\x1b[0m`);
622
622
  notifyOnWaiting: false,
623
623
  debug: false,
624
624
  listener: {
625
+ claudeArgs: ['--permission-mode', 'auto', '--model', 'opus'],
625
626
  projects: {},
626
627
  worktreeBaseDir: path.join(HOME, '.claude', 'worktrees'),
627
628
  autoCreateWorktree: true,
@@ -414,6 +414,37 @@ Press Enter to keep current value shown in [brackets].
414
414
  const maxTotalStr = await ask(rl, `Max total tasks [${defaults.maxTotalTasks}]: `);
415
415
  L.maxTotalTasks = parsePositiveInt(maxTotalStr, defaults.maxTotalTasks);
416
416
 
417
+ // --- Claude args ---
418
+ const permModes = ['auto', 'bypassPermissions', 'default', 'acceptEdits', 'plan'];
419
+ const currentClaudeArgs = L.claudeArgs || ['--permission-mode', 'auto', '--model', 'opus'];
420
+ const currentPermIdx = currentClaudeArgs.indexOf('--permission-mode');
421
+ const currentPerm = currentPermIdx >= 0 ? currentClaudeArgs[currentPermIdx + 1] : 'auto';
422
+ const currentPermNum = permModes.indexOf(currentPerm) + 1 || 1;
423
+
424
+ console.log(`
425
+ Permission mode for claude -p (tools access):
426
+ 1. auto — smart auto-approval (recommended)
427
+ 2. bypassPermissions — allow everything (trusted environments)
428
+ 3. default — standard interactive prompts
429
+ 4. acceptEdits — auto-approve edits only
430
+ 5. plan — read-only, no edits`);
431
+
432
+ const permInput = await ask(rl, `Choose [${currentPermNum}]: `);
433
+ const permChoice = parseInt(permInput, 10);
434
+ const selectedPerm = (permChoice >= 1 && permChoice <= 5) ? permModes[permChoice - 1] : currentPerm;
435
+
436
+ // Build claudeArgs preserving non-permission-mode args
437
+ const newClaudeArgs = ['--permission-mode', selectedPerm];
438
+ // Preserve --model if present
439
+ const modelIdx = currentClaudeArgs.indexOf('--model');
440
+ if (modelIdx >= 0 && currentClaudeArgs[modelIdx + 1]) {
441
+ newClaudeArgs.push('--model', currentClaudeArgs[modelIdx + 1]);
442
+ } else {
443
+ newClaudeArgs.push('--model', 'opus');
444
+ }
445
+ L.claudeArgs = newClaudeArgs;
446
+ console.log(` → --permission-mode ${selectedPerm}`);
447
+
417
448
  // --- Default project ---
418
449
  console.log('');
419
450
  const projectInput = await ask(rl, `Default project path [${defaults.projectPath || '(none)'}]: `);
package/commit-sha CHANGED
@@ -1 +1 @@
1
- 1c842063a9de04968f5523348e390194668a289b
1
+ 6f378bc3b2e112b21a02fcb18cd55bc584ecea38
@@ -220,7 +220,7 @@ TelegramPoller.getUpdates()
220
220
  MessageParser.parse(text)
221
221
 
222
222
  ├─ Starts with "/"? ──► Command
223
- │ ├─ /status, /queue, /cancel, /drop, /clear
223
+ │ ├─ /status, /queue, /cancel, /drop, /clear, /newsession
224
224
  │ ├─ /projects, /worktrees, /worktree, /rmworktree
225
225
  │ ├─ /history, /help, /stop
226
226
  │ └─ Execute → reply in Telegram
@@ -307,12 +307,15 @@ Full example of `~/.claude/claude-notify.config.json` with the listener section:
307
307
  "deleteAfterHours": 24
308
308
  },
309
309
  "listener": {
310
+ "claudeArgs": ["--permission-mode", "auto"],
311
+ "continueSession": true,
310
312
  "projects": {
311
313
  "default": {
312
314
  "path": "/home/user/main-project"
313
315
  },
314
316
  "api": {
315
317
  "path": "/home/user/projects/api-server",
318
+ "claudeArgs": ["--permission-mode", "bypassPermissions", "--model", "opus"],
316
319
  "worktrees": {
317
320
  "feature/auth": "/home/user/projects/api-wt-auth"
318
321
  }
@@ -336,7 +339,9 @@ Full example of `~/.claude/claude-notify.config.json` with the listener section:
336
339
 
337
340
  | Parameter | Default | Description |
338
341
  |---|---|---|
339
- | `projects` | — (required) | Map of projects: `alias → { path, worktrees? }` |
342
+ | `projects` | — (required) | Map of projects: `alias → { path, worktrees?, claudeArgs? }` |
343
+ | `claudeArgs` | `[]` | Extra CLI args passed to `claude -p` (e.g. `["--permission-mode", "auto"]`). Can also be set per-project to override |
344
+ | `continueSession` | `true` | Continue previous session context per workDir. Claude remembers previous tasks. Use `/newsession` or `/clear` to reset |
340
345
  | `worktreeBaseDir` | `~/.claude/worktrees` | Where auto-created worktrees are stored |
341
346
  | `autoCreateWorktree` | `true` | Automatically create a worktree if the branch is not found |
342
347
  | `taskTimeoutMinutes` | `30` | Maximum task execution time in minutes. Force-stopped when exceeded |
@@ -630,15 +635,27 @@ Bot: 🗑 Removed from queue: refactor the code
630
635
 
631
636
  The task number is the position in the queue (starting from 1). You can check numbers with `/queue`.
632
637
 
633
- ### /clear — clear the queue
638
+ ### /clear — clear the queue and reset session
634
639
 
635
- Removes all tasks from the queue (the active task continues running):
640
+ Removes all tasks from the queue (the active task continues running) and resets the session context.
641
+ The next task will start a fresh Claude session:
636
642
 
637
643
  ```
638
644
  You: /clear /api
639
- Bot: 🧹 [/api] Queue cleared (3 tasks)
645
+ Bot: 🧹 [/api] Queue cleared (3 tasks), session reset
640
646
  ```
641
647
 
648
+ ### /newsession — reset session context
649
+
650
+ Resets the session without touching the queue. The next task starts a fresh session:
651
+
652
+ ```
653
+ You: /newsession /api
654
+ Bot: 🆕 [/api] Session reset (was #5 tasks, ctx 42%). Next task starts fresh.
655
+ ```
656
+
657
+ Use this when the context window is getting full or when you want Claude to "forget" previous work and start clean.
658
+
642
659
  ### /projects — list projects
643
660
 
644
661
  ```
@@ -757,16 +774,32 @@ Shows a brief reference for all commands.
757
774
  The command that gets executed:
758
775
 
759
776
  ```bash
760
- claude -p "your message text from Telegram" --output-format text
777
+ claude -p "your message text from Telegram" --output-format text [claudeArgs...]
761
778
  ```
762
779
 
763
780
  With the working directory (`cwd`) = project/worktree workDir.
764
781
 
782
+ Extra CLI arguments can be configured via `claudeArgs` in config (global or per-project).
783
+ Recommended: `["--permission-mode", "auto"]` — allows Claude to use tools (Edit, Bash, Read, etc.) without interactive prompts, matching the quality of a full interactive session.
784
+
765
785
  Claude sees the project files, CLAUDE.md, .claude/settings.json, and everything else as if you had launched it manually in that directory.
766
786
 
787
+ ### Session continuity
788
+
789
+ When `continueSession` is enabled (default), the listener adds `--continue` to subsequent tasks in the same workDir. This means Claude remembers previous tasks and their context — just like working in an interactive terminal session.
790
+
791
+ Messages show session status:
792
+ - `🆕` = new session (first task or after `/newsession`/`/clear`)
793
+ - `🔄 #3` = continuing session, task number 3
794
+ - `ctx 42%` = context window usage (42% filled)
795
+
796
+ The completion message includes metadata: duration, turns, context usage, cost.
797
+
798
+ Use `/newsession` to reset the session when context gets full, or `/clear` to reset both queue and session.
799
+
767
800
  ### What is returned to Telegram
768
801
 
769
- All stdout from claude. This is Claude's text response to your task.
802
+ The `result` field from Claude's JSON output — the text response to your task.
770
803
 
771
804
  Handling long responses:
772
805
  - Up to 4096 characters — a single message
@@ -907,6 +940,38 @@ claude-notify listener restart
907
940
 
908
941
  The watchdog will automatically clear stale tasks on the next startup.
909
942
 
943
+ ### Claude gives low-quality responses (doesn't edit files, just describes what to do)
944
+
945
+ By default `claude -p` runs without tool permissions — Claude can't use Edit, Bash, Read, etc.
946
+ Add `claudeArgs` to your listener config:
947
+
948
+ ```json
949
+ "listener": {
950
+ "claudeArgs": ["--permission-mode", "auto"]
951
+ }
952
+ ```
953
+
954
+ Available permission modes:
955
+ - `auto` — allows tools with smart auto-approval (recommended)
956
+ - `bypassPermissions` — allows everything without any checks (use in trusted environments)
957
+
958
+ Other useful flags:
959
+ - `--model opus` — force a specific model
960
+ - `--allowedTools "Bash Edit Read Write"` — allow specific tools only
961
+
962
+ Restart the listener after changing config: `claude-notify listener restart`
963
+
964
+ ### Context window getting full
965
+
966
+ After many tasks in the same session, the context window fills up and responses may degrade.
967
+ The completion message shows `ctx N%` — when it's above ~80%, consider resetting:
968
+
969
+ ```
970
+ /newsession /project
971
+ ```
972
+
973
+ This starts a fresh session without clearing the task queue. You can also use `/clear` to reset both.
974
+
910
975
  ### Claude can't find project files
911
976
 
912
977
  Check the path in the config:
@@ -932,6 +997,8 @@ Suppose you have two projects: an API server and a web application.
932
997
  "chatId": "987654321"
933
998
  },
934
999
  "listener": {
1000
+ "claudeArgs": ["--permission-mode", "auto"],
1001
+ "continueSession": true,
935
1002
  "projects": {
936
1003
  "api": { "path": "/home/user/projects/api" },
937
1004
  "web": { "path": "/home/user/projects/web" }