claude-notification-plugin 1.1.52 → 1.1.56
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.
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +38 -34
- package/commit-sha +1 -1
- package/hooks/hooks.json +89 -34
- package/listener/LISTENER-DETAILED.md +117 -94
- package/listener/listener.js +84 -50
- package/listener/message-parser.js +96 -111
- package/listener/pty-runner.js +122 -98
- package/listener/telegram-poller.js +21 -4
- package/notifier/NOTIFIER-DETAILED.md +82 -0
- package/notifier/notifier.js +88 -19
- package/package.json +1 -1
|
@@ -61,7 +61,7 @@ GET /getUpdates?timeout=30 ────► "Let's wait up to 30 seconds,
|
|
|
61
61
|
connection is open)
|
|
62
62
|
|
|
63
63
|
After 15 sec a user
|
|
64
|
-
wrote "
|
|
64
|
+
wrote "&proj1 fix bug"
|
|
65
65
|
|
|
66
66
|
◄──── {"result": [{"message":...}]} "There's a message, here it is!"
|
|
67
67
|
|
|
@@ -181,7 +181,7 @@ Running two listeners is impossible — the PID file prevents it. And this is im
|
|
|
181
181
|
│ ┌───────┴────────┐ ┌───────┴───────┐ │
|
|
182
182
|
│ │ MessageParser │ │ PtyRunner │ │
|
|
183
183
|
│ │ │ │ │ │
|
|
184
|
-
│ │
|
|
184
|
+
│ │ &proj/branch │ │ PTY session │ │
|
|
185
185
|
│ │ /commands │ │ timeouts │ │
|
|
186
186
|
│ └────────────────┘ │ signal files │ │
|
|
187
187
|
│ └───────────────┘ │
|
|
@@ -198,10 +198,10 @@ Running two listeners is impossible — the PID file prevents it. And this is im
|
|
|
198
198
|
| Module | File | Description |
|
|
199
199
|
|---|---|---|
|
|
200
200
|
| **TelegramPoller** | `telegram-poller.js` | Long polling to the Telegram API. Receives messages, sends replies. Splits long messages into chunks |
|
|
201
|
-
| **MessageParser** | `message-parser.js` | Parses message text: is it a command (`/status`) or a task (
|
|
201
|
+
| **MessageParser** | `message-parser.js` | Parses message text: is it a command (`/status`) or a task (`&proj1 fix bug`)? Extracts project, branch, task text |
|
|
202
202
|
| **WorkQueue** | `work-queue.js` | Manages task queues. Each working directory has a separate FIFO queue. Guarantees: one `claude` process per directory. Persists state to disk |
|
|
203
203
|
| **PtyRunner** | `pty-runner.js` | Runs Claude in an interactive PTY session (via `node-pty`). Reuses sessions across tasks. Receives results via hook signal files. Monitors timeouts. Emits events: complete, error, timeout |
|
|
204
|
-
| **WorktreeManager** | `worktree-manager.js` | Creates and removes git worktrees. Auto-discovery via `git worktree list`. Maps
|
|
204
|
+
| **WorktreeManager** | `worktree-manager.js` | Creates and removes git worktrees. Auto-discovery via `git worktree list`. Maps `&project/branch` to a path on disk |
|
|
205
205
|
| **Logger** | `logger.js` | Writes operational log to `~/.claude/.cc-n-listener.log`. Rotation when exceeding 5 MB (old file → `.log.old`) |
|
|
206
206
|
| **TaskLogger** | `task-logger.js` | Writes task Q&A logs (questions to Claude and answers). Separate file per project/branch. Rotation at 5 MB |
|
|
207
207
|
|
|
@@ -223,20 +223,23 @@ MessageParser.parse(text)
|
|
|
223
223
|
├─ Starts with "/"? ──► Command
|
|
224
224
|
│ ├─ /status, /queue, /cancel, /drop, /clear, /newsession
|
|
225
225
|
│ ├─ /projects, /worktrees, /worktree, /rmworktree
|
|
226
|
-
│ ├─ /history, /help, /stop
|
|
226
|
+
│ ├─ /history, /help, /menu, /start, /stop, /pty
|
|
227
227
|
│ └─ Execute → reply in Telegram
|
|
228
|
+
│ └─ Unknown /command → reply "Unknown command"
|
|
228
229
|
│
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
230
|
+
├─ Starts with "&"? ──► Task (project-targeted)
|
|
231
|
+
│ │
|
|
232
|
+
│ ├─ "&proj1/feature/auth fix bug"
|
|
233
|
+
│ │ → project = "proj1"
|
|
234
|
+
│ │ → branch = "feature/auth"
|
|
235
|
+
│ │ → text = "fix bug"
|
|
236
|
+
│ │
|
|
237
|
+
│ └─ "&proj1 fix bug"
|
|
238
|
+
│ → project = "proj1"
|
|
239
|
+
│ → branch = null (main)
|
|
240
|
+
│ → text = "fix bug"
|
|
241
|
+
│
|
|
242
|
+
└─ Otherwise ──► Task (default project)
|
|
240
243
|
│
|
|
241
244
|
└─ "fix bug"
|
|
242
245
|
→ project = "default"
|
|
@@ -363,9 +366,9 @@ Each project is an alias (short name) + path to a directory on disk:
|
|
|
363
366
|
}
|
|
364
367
|
```
|
|
365
368
|
|
|
366
|
-
Now in Telegram you can write
|
|
369
|
+
Now in Telegram you can write `&api refactor the code`, and Claude will run in the `/home/user/projects/api-server` directory.
|
|
367
370
|
|
|
368
|
-
The **`default`** alias is special. Messages without
|
|
371
|
+
The **`default`** alias is special. Messages without `&project` prefix go to it:
|
|
369
372
|
|
|
370
373
|
```json
|
|
371
374
|
{
|
|
@@ -384,9 +387,9 @@ The **`default`** alias is special. Messages without `/project` prefix go to it:
|
|
|
384
387
|
In the Telegram chat with the bot:
|
|
385
388
|
|
|
386
389
|
```
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
task without
|
|
390
|
+
&project task ← task in the main worktree of the project
|
|
391
|
+
&project/branch task ← task in the worktree of a specific branch
|
|
392
|
+
task without &project prefix ← task in the "default" project
|
|
390
393
|
```
|
|
391
394
|
|
|
392
395
|
### Examples
|
|
@@ -397,25 +400,25 @@ add a README to the project
|
|
|
397
400
|
→ runs in the `default` project (if configured)
|
|
398
401
|
|
|
399
402
|
```
|
|
400
|
-
|
|
403
|
+
&api fix the authentication bug
|
|
401
404
|
```
|
|
402
405
|
→ runs in `/home/user/projects/api-server`
|
|
403
406
|
|
|
404
407
|
```
|
|
405
|
-
|
|
408
|
+
&api/feature/payments add Stripe integration
|
|
406
409
|
```
|
|
407
410
|
→ runs in the `feature/payments` worktree of the `api` project.
|
|
408
411
|
If the worktree doesn't exist, it will be created automatically.
|
|
409
412
|
|
|
410
413
|
```
|
|
411
|
-
|
|
414
|
+
&web update dependencies
|
|
412
415
|
```
|
|
413
416
|
→ runs in `/home/user/projects/web-app`
|
|
414
417
|
|
|
415
418
|
### What happens when a task is sent
|
|
416
419
|
|
|
417
420
|
1. The Listener receives the message from Telegram
|
|
418
|
-
2. Parses
|
|
421
|
+
2. Parses `&project/branch` from the beginning of the message
|
|
419
422
|
3. Determines the working directory (workDir)
|
|
420
423
|
4. Checks: is this workDir busy with another task?
|
|
421
424
|
- **No** → sends task to the PTY session immediately, replies with `⏳ Running...`
|
|
@@ -451,8 +454,8 @@ api-server/ ← main worktree, branch main
|
|
|
451
454
|
**The queue is tied to the working directory, not to the project name.**
|
|
452
455
|
|
|
453
456
|
This means:
|
|
454
|
-
-
|
|
455
|
-
-
|
|
457
|
+
- `&api task` and `&api/feature/auth task` are **different queues**, because they're different directories. They run **in parallel**.
|
|
458
|
+
- `&api task1` and `&api task2` are **the same queue** (both go to the main worktree). `task2` will wait for `task1` to complete.
|
|
456
459
|
|
|
457
460
|
```
|
|
458
461
|
Project "api"
|
|
@@ -472,7 +475,7 @@ Within each — strictly one task at a time.
|
|
|
472
475
|
|
|
473
476
|
### Auto-creation of worktrees
|
|
474
477
|
|
|
475
|
-
When you write
|
|
478
|
+
When you write `&api/feature/new task`, and a worktree for the `feature/new` branch doesn't exist:
|
|
476
479
|
|
|
477
480
|
1. The Listener checks: does the `feature/new` branch exist in git?
|
|
478
481
|
- Yes → `git worktree add ~/.claude/worktrees/api/feature-new feature/new`
|
|
@@ -490,9 +493,9 @@ On startup, the listener scans each project with `git worktree list` and picks u
|
|
|
490
493
|
### Manual worktree management from Telegram
|
|
491
494
|
|
|
492
495
|
```
|
|
493
|
-
/worktree
|
|
494
|
-
/worktrees
|
|
495
|
-
/rmworktree
|
|
496
|
+
/worktree &api/feature/payments ← create a worktree
|
|
497
|
+
/worktrees &api ← list all worktrees for a project
|
|
498
|
+
/rmworktree &api/feature/payments ← remove a worktree
|
|
496
499
|
```
|
|
497
500
|
|
|
498
501
|
---
|
|
@@ -510,41 +513,41 @@ While `active !== null`, all new tasks for this workDir go into the `queue`.
|
|
|
510
513
|
### Example: 4 tasks, 2 projects
|
|
511
514
|
|
|
512
515
|
```
|
|
513
|
-
10:00 You:
|
|
514
|
-
Bot: ⏳ [
|
|
516
|
+
10:00 You: &api fix the router bug
|
|
517
|
+
Bot: ⏳ [&api] Running: fix the router bug
|
|
515
518
|
(api/main: active = "fix the router bug", queue = [])
|
|
516
519
|
|
|
517
|
-
10:01 You:
|
|
518
|
-
Bot: ⏳ [
|
|
520
|
+
10:01 You: &web update dependencies
|
|
521
|
+
Bot: ⏳ [&web] Running: update dependencies
|
|
519
522
|
(web/main: active = "update dependencies", queue = [])
|
|
520
523
|
(api and web are running in parallel!)
|
|
521
524
|
|
|
522
|
-
10:02 You:
|
|
523
|
-
Bot: 📋 [
|
|
525
|
+
10:02 You: &api add tests
|
|
526
|
+
Bot: 📋 [&api] Queued (position 1).
|
|
524
527
|
Currently running: fix the router bug
|
|
525
528
|
(api/main: active = "fix the router bug", queue = ["add tests"])
|
|
526
529
|
|
|
527
|
-
10:03 You:
|
|
528
|
-
Bot: 📋 [
|
|
530
|
+
10:03 You: &api refactor the code
|
|
531
|
+
Bot: 📋 [&api] Queued (position 2).
|
|
529
532
|
Currently running: fix the router bug
|
|
530
533
|
(api/main: active = "fix the router bug", queue = ["add tests", "refactor"])
|
|
531
534
|
|
|
532
|
-
10:05 Bot: ✅ [
|
|
535
|
+
10:05 Bot: ✅ [&web] Done: update dependencies
|
|
533
536
|
<result>
|
|
534
537
|
(web/main: active = null, queue = [])
|
|
535
538
|
|
|
536
|
-
10:08 Bot: ✅ [
|
|
539
|
+
10:08 Bot: ✅ [&api] Done: fix the router bug
|
|
537
540
|
<result>
|
|
538
|
-
Bot: ⏳ [
|
|
541
|
+
Bot: ⏳ [&api] Running: add tests
|
|
539
542
|
(api/main: active = "add tests", queue = ["refactor"])
|
|
540
543
|
(next task started automatically!)
|
|
541
544
|
|
|
542
|
-
10:15 Bot: ✅ [
|
|
545
|
+
10:15 Bot: ✅ [&api] Done: add tests
|
|
543
546
|
<result>
|
|
544
|
-
Bot: ⏳ [
|
|
547
|
+
Bot: ⏳ [&api] Running: refactor the code
|
|
545
548
|
(api/main: active = "refactor", queue = [])
|
|
546
549
|
|
|
547
|
-
10:25 Bot: ✅ [
|
|
550
|
+
10:25 Bot: ✅ [&api] Done: refactor the code
|
|
548
551
|
<result>
|
|
549
552
|
(api/main: active = null, queue = [])
|
|
550
553
|
(all tasks completed)
|
|
@@ -561,7 +564,7 @@ While `active !== null`, all new tasks for this workDir go into the `queue`.
|
|
|
561
564
|
If a task runs longer than 30 minutes (configurable: `taskTimeoutMinutes`), it is forcefully stopped:
|
|
562
565
|
|
|
563
566
|
```
|
|
564
|
-
Bot: ⏰ [
|
|
567
|
+
Bot: ⏰ [&api] Task forcefully stopped — timeout exceeded (30 min): refactor the code
|
|
565
568
|
```
|
|
566
569
|
|
|
567
570
|
After a timeout, the next task from the queue starts automatically.
|
|
@@ -571,6 +574,7 @@ After a timeout, the next task from the queue starts automatically.
|
|
|
571
574
|
## Bot commands
|
|
572
575
|
|
|
573
576
|
All commands start with `/` and execute instantly (they are not queued).
|
|
577
|
+
Projects are referenced with the `&` prefix (e.g. `&api`, `&api/branch`).
|
|
574
578
|
|
|
575
579
|
### /status — project status
|
|
576
580
|
|
|
@@ -587,7 +591,7 @@ Bot: 📊 Status:
|
|
|
587
591
|
```
|
|
588
592
|
|
|
589
593
|
```
|
|
590
|
-
You: /status
|
|
594
|
+
You: /status &api
|
|
591
595
|
Bot: 📊 Project "api":
|
|
592
596
|
|
|
593
597
|
main:
|
|
@@ -604,7 +608,7 @@ Bot: 📊 Project "api":
|
|
|
604
608
|
You: /queue
|
|
605
609
|
Bot: 📋 Queues:
|
|
606
610
|
|
|
607
|
-
|
|
611
|
+
&api:
|
|
608
612
|
▶ fix the router bug
|
|
609
613
|
1. add tests
|
|
610
614
|
2. refactor the code
|
|
@@ -613,16 +617,16 @@ Bot: 📋 Queues:
|
|
|
613
617
|
### /cancel — stop a running task
|
|
614
618
|
|
|
615
619
|
```
|
|
616
|
-
You: /cancel
|
|
617
|
-
Bot: 🛑 [
|
|
618
|
-
⏳ [
|
|
620
|
+
You: /cancel &api
|
|
621
|
+
Bot: 🛑 [&api] Task cancelled. Starting next.
|
|
622
|
+
⏳ [&api] Running: add tests
|
|
619
623
|
```
|
|
620
624
|
|
|
621
625
|
Cancelling a task in a worktree:
|
|
622
626
|
|
|
623
627
|
```
|
|
624
|
-
You: /cancel
|
|
625
|
-
Bot: 🛑 [
|
|
628
|
+
You: /cancel &api/feature/auth
|
|
629
|
+
Bot: 🛑 [&api/feature/auth] Task cancelled
|
|
626
630
|
```
|
|
627
631
|
|
|
628
632
|
### /drop — remove from queue
|
|
@@ -630,7 +634,7 @@ Bot: 🛑 [/api/feature/auth] Task cancelled
|
|
|
630
634
|
Removes a task that **hasn't started executing yet** (waiting in the queue):
|
|
631
635
|
|
|
632
636
|
```
|
|
633
|
-
You: /drop
|
|
637
|
+
You: /drop &api 2
|
|
634
638
|
Bot: 🗑 Removed from queue: refactor the code
|
|
635
639
|
```
|
|
636
640
|
|
|
@@ -642,8 +646,8 @@ Removes all tasks from the queue (the active task continues running) and resets
|
|
|
642
646
|
The next task will start a fresh Claude session:
|
|
643
647
|
|
|
644
648
|
```
|
|
645
|
-
You: /clear
|
|
646
|
-
Bot: 🧹 [
|
|
649
|
+
You: /clear &api
|
|
650
|
+
Bot: 🧹 [&api] Queue cleared (3 tasks), session reset
|
|
647
651
|
```
|
|
648
652
|
|
|
649
653
|
### /newsession — reset session context
|
|
@@ -651,8 +655,8 @@ Bot: 🧹 [/api] Queue cleared (3 tasks), session reset
|
|
|
651
655
|
Resets the session without touching the queue. The next task starts a fresh session:
|
|
652
656
|
|
|
653
657
|
```
|
|
654
|
-
You: /newsession
|
|
655
|
-
Bot: 🆕 [
|
|
658
|
+
You: /newsession &api
|
|
659
|
+
Bot: 🆕 [&api] Session reset (was #5 tasks, ctx 42%). Next task starts fresh.
|
|
656
660
|
```
|
|
657
661
|
|
|
658
662
|
Use this when the context window is getting full or when you want Claude to "forget" previous work and start clean.
|
|
@@ -664,15 +668,15 @@ You: /projects
|
|
|
664
668
|
Bot: 📂 Projects:
|
|
665
669
|
|
|
666
670
|
@default → /home/user/main-project
|
|
667
|
-
|
|
671
|
+
&api → /home/user/projects/api-server
|
|
668
672
|
/feature/auth → ~/.claude/worktrees/api/feature-auth
|
|
669
|
-
|
|
673
|
+
&web → /home/user/projects/web-app
|
|
670
674
|
```
|
|
671
675
|
|
|
672
676
|
### /worktrees — project worktrees
|
|
673
677
|
|
|
674
678
|
```
|
|
675
|
-
You: /worktrees
|
|
679
|
+
You: /worktrees &api
|
|
676
680
|
Bot: 🌳 Worktrees for project "api":
|
|
677
681
|
• main → /home/user/projects/api-server
|
|
678
682
|
• feature/auth → ~/.claude/worktrees/api/feature-auth
|
|
@@ -682,7 +686,7 @@ Bot: 🌳 Worktrees for project "api":
|
|
|
682
686
|
### /worktree — create a worktree
|
|
683
687
|
|
|
684
688
|
```
|
|
685
|
-
You: /worktree
|
|
689
|
+
You: /worktree &api/feature/payments
|
|
686
690
|
Bot: 🌿 Created worktree for project "api":
|
|
687
691
|
Branch: feature/payments
|
|
688
692
|
Path: ~/.claude/worktrees/api/feature-payments
|
|
@@ -691,7 +695,7 @@ Bot: 🌿 Created worktree for project "api":
|
|
|
691
695
|
### /rmworktree — remove a worktree
|
|
692
696
|
|
|
693
697
|
```
|
|
694
|
-
You: /rmworktree
|
|
698
|
+
You: /rmworktree &api/feature/payments
|
|
695
699
|
Bot: 🗑 Worktree feature/payments removed from project "api"
|
|
696
700
|
```
|
|
697
701
|
|
|
@@ -699,7 +703,7 @@ If a task is running in the worktree, removal will be rejected:
|
|
|
699
703
|
|
|
700
704
|
```
|
|
701
705
|
Bot: ❌ Cannot remove worktree: a task is running in it.
|
|
702
|
-
First /cancel
|
|
706
|
+
First /cancel &api/feature/payments
|
|
703
707
|
```
|
|
704
708
|
|
|
705
709
|
### /history — history
|
|
@@ -708,10 +712,10 @@ Bot: ❌ Cannot remove worktree: a task is running in it.
|
|
|
708
712
|
You: /history
|
|
709
713
|
Bot: 📜 Recent tasks:
|
|
710
714
|
|
|
711
|
-
✅ [
|
|
712
|
-
✅ [
|
|
713
|
-
🛑 [
|
|
714
|
-
✅ [
|
|
715
|
+
✅ [&api] fix the router bug
|
|
716
|
+
✅ [&web] update dependencies
|
|
717
|
+
🛑 [&api/feature/auth] implement OAuth2
|
|
718
|
+
✅ [&api] add tests
|
|
715
719
|
```
|
|
716
720
|
|
|
717
721
|
### /stop — stop the listener
|
|
@@ -731,7 +735,7 @@ Shows real-time information about PTY sessions: state, buffer size, live console
|
|
|
731
735
|
You: /pty
|
|
732
736
|
Bot: 🖥 PTY Sessions:
|
|
733
737
|
|
|
734
|
-
|
|
738
|
+
&api
|
|
735
739
|
State: busy
|
|
736
740
|
Buffer: 12480 bytes
|
|
737
741
|
Elapsed: 2m 35s
|
|
@@ -744,7 +748,7 @@ Bot: 🖥 PTY Sessions:
|
|
|
744
748
|
```
|
|
745
749
|
|
|
746
750
|
```
|
|
747
|
-
You: /pty
|
|
751
|
+
You: /pty &api
|
|
748
752
|
Bot: (same, but for a specific project)
|
|
749
753
|
```
|
|
750
754
|
|
|
@@ -764,7 +768,8 @@ The output is cleaned from ANSI escape codes and Claude Code UI chrome (logo, st
|
|
|
764
768
|
|
|
765
769
|
Configuration:
|
|
766
770
|
- `liveConsole` — enable/disable (default: `true`)
|
|
767
|
-
- `
|
|
771
|
+
- `liveConsoleIntervalMillis` — update interval in seconds (default: `1`)
|
|
772
|
+
- `liveConsoleMaxOutputChars` — max characters of PTY output to show (default: `300`)
|
|
768
773
|
|
|
769
774
|
### PTY logs
|
|
770
775
|
|
|
@@ -782,7 +787,7 @@ Get-Content ~/.claude/myproject_main_pty.log -Wait -Tail 50
|
|
|
782
787
|
|
|
783
788
|
### /pty command
|
|
784
789
|
|
|
785
|
-
Send `/pty` or `/pty
|
|
790
|
+
Send `/pty` or `/pty &project` in Telegram to get instant diagnostics:
|
|
786
791
|
- Session state (`busy` / `idle` / `starting`)
|
|
787
792
|
- Buffer size in bytes
|
|
788
793
|
- Elapsed time since task start
|
|
@@ -801,7 +806,7 @@ Send `/pty` or `/pty /project` in Telegram to get instant diagnostics:
|
|
|
801
806
|
Telegram message → getUpdates() → parsing
|
|
802
807
|
|
|
803
808
|
2. ROUTING
|
|
804
|
-
"
|
|
809
|
+
"&api/feature/auth task"
|
|
805
810
|
→ project = "api"
|
|
806
811
|
→ branch = "feature/auth"
|
|
807
812
|
→ workDir = ~/.claude/worktrees/api/feature-auth
|
|
@@ -847,6 +852,24 @@ Claude sees the project files, CLAUDE.md, .claude/settings.json, and everything
|
|
|
847
852
|
|
|
848
853
|
Task results are received via Claude's `Stop` hook, which writes a signal file containing `last_assistant_message` — the clean final response (not the raw PTY output with spinners and tool calls).
|
|
849
854
|
|
|
855
|
+
### Hook-based communication
|
|
856
|
+
|
|
857
|
+
In listener mode (`CLAUDE_NOTIFY_FROM_LISTENER=1`), the plugin communicates with the PTY runner via signal files in `~/.claude/pty-signals/` instead of parsing PTY output. This provides structured, reliable data: error types, tool activity, compaction status, and permission auto-approval without fragile buffer pattern matching.
|
|
858
|
+
|
|
859
|
+
Signal files by hook event:
|
|
860
|
+
|
|
861
|
+
| Signal file | Hook event | Contents |
|
|
862
|
+
|---|---|---|
|
|
863
|
+
| `{sessionId}.json` | `Stop` | Completion: `lastAssistantMessage`, `cost`, `numTurns`, `durationMs` |
|
|
864
|
+
| `err_{sessionId}.json` | `StopFailure` | API error: `error` type (`rate_limit`, `authentication_failed`, etc.), `errorDetails` |
|
|
865
|
+
| `rdy_{sessionId}.json` | `SessionStart` | Session ready: `model`, `source` (`startup`/`resume`) |
|
|
866
|
+
| `act_{sessionId}.json` | `PostToolUse` | Tool activity: `toolName`, `toolInput` (overwritten per tool call) |
|
|
867
|
+
| `cmp_{sessionId}.json` | `PostCompact` | Context compaction: `summary`, `trigger` (`auto`/`manual`) |
|
|
868
|
+
|
|
869
|
+
The `PermissionRequest` hook auto-approves permissions by returning JSON to stdout (no signal file needed).
|
|
870
|
+
|
|
871
|
+
The PTY runner polls `~/.claude/pty-signals/` every 500ms and processes each signal by matching the `cwd` field to a known working directory.
|
|
872
|
+
|
|
850
873
|
### Session continuity
|
|
851
874
|
|
|
852
875
|
When `continueSession` is enabled (default), the listener reuses the same PTY session for subsequent tasks in the same workDir. The Claude process stays alive between tasks, preserving full context — exactly like working in an interactive terminal.
|
|
@@ -992,7 +1015,7 @@ Check:
|
|
|
992
1015
|
### Task is stuck
|
|
993
1016
|
|
|
994
1017
|
```
|
|
995
|
-
/cancel
|
|
1018
|
+
/cancel &project
|
|
996
1019
|
```
|
|
997
1020
|
|
|
998
1021
|
Or restart the listener:
|
|
@@ -1029,7 +1052,7 @@ After many tasks in the same session, the context window fills up and responses
|
|
|
1029
1052
|
The completion message shows `ctx N%` — when it's above ~80%, consider resetting:
|
|
1030
1053
|
|
|
1031
1054
|
```
|
|
1032
|
-
/newsession
|
|
1055
|
+
/newsession &project
|
|
1033
1056
|
```
|
|
1034
1057
|
|
|
1035
1058
|
This starts a fresh session without clearing the task queue. You can also use `/clear` to reset both.
|
|
@@ -1079,8 +1102,8 @@ You (terminal): claude-notify listener start
|
|
|
1079
1102
|
|
|
1080
1103
|
=== 10:01 — First task ===
|
|
1081
1104
|
|
|
1082
|
-
You:
|
|
1083
|
-
Bot: ⏳ [
|
|
1105
|
+
You: &api add endpoint GET /users with pagination
|
|
1106
|
+
Bot: ⏳ [&api] Running: add endpoint GET /users with pagination
|
|
1084
1107
|
|
|
1085
1108
|
Behind the scenes: PTY session created
|
|
1086
1109
|
claude (interactive PTY) → task sent
|
|
@@ -1088,23 +1111,23 @@ Bot: ⏳ [/api] Running: add endpoint GET /users with pagination
|
|
|
1088
1111
|
|
|
1089
1112
|
=== 10:02 — Task to another project (in parallel!) ===
|
|
1090
1113
|
|
|
1091
|
-
You:
|
|
1092
|
-
Bot: ⏳ [
|
|
1114
|
+
You: &web add a /users page that calls GET /users
|
|
1115
|
+
Bot: ⏳ [&web] Running: add a /users page that calls GET /users
|
|
1093
1116
|
|
|
1094
1117
|
Now two PTY sessions are running in parallel:
|
|
1095
1118
|
one in /home/user/projects/api, another in /home/user/projects/web
|
|
1096
1119
|
|
|
1097
1120
|
=== 10:03 — Another task for api (queued) ===
|
|
1098
1121
|
|
|
1099
|
-
You:
|
|
1100
|
-
Bot: 📋 [
|
|
1122
|
+
You: &api add tests for /users
|
|
1123
|
+
Bot: 📋 [&api] Queued (position 1).
|
|
1101
1124
|
Currently running: add endpoint GET /users with pagination
|
|
1102
1125
|
|
|
1103
1126
|
=== 10:04 — Task in a worktree (in parallel with api/main!) ===
|
|
1104
1127
|
|
|
1105
|
-
You:
|
|
1128
|
+
You: &api/feature/auth add JWT authorization middleware
|
|
1106
1129
|
Bot: 🌿 Created worktree feature/auth for project "api"
|
|
1107
|
-
⏳ [
|
|
1130
|
+
⏳ [&api/feature/auth] Running: add JWT authorization middleware
|
|
1108
1131
|
|
|
1109
1132
|
Three PTY sessions running in parallel:
|
|
1110
1133
|
1. api/main → GET /users
|
|
@@ -1125,7 +1148,7 @@ Bot: 📊 Status:
|
|
|
1125
1148
|
|
|
1126
1149
|
=== 10:07 — web finished ===
|
|
1127
1150
|
|
|
1128
|
-
Bot: ✅ [
|
|
1151
|
+
Bot: ✅ [&web] Done: add a /users page that calls GET /users
|
|
1129
1152
|
|
|
1130
1153
|
Created file src/pages/Users.vue with a user table.
|
|
1131
1154
|
Added route in src/router.js.
|
|
@@ -1133,24 +1156,24 @@ Bot: ✅ [/web] Done: add a /users page that calls GET /users
|
|
|
1133
1156
|
|
|
1134
1157
|
=== 10:09 — api/main finished, automatically starts the next task ===
|
|
1135
1158
|
|
|
1136
|
-
Bot: ✅ [
|
|
1159
|
+
Bot: ✅ [&api] Done: add endpoint GET /users with pagination
|
|
1137
1160
|
|
|
1138
1161
|
Created controller src/controllers/users.js.
|
|
1139
1162
|
Added route GET /users in src/routes.js.
|
|
1140
1163
|
Supports query parameters: page, limit, sort.
|
|
1141
1164
|
|
|
1142
|
-
Bot: ⏳ [
|
|
1165
|
+
Bot: ⏳ [&api] Running: add tests for /users
|
|
1143
1166
|
|
|
1144
1167
|
Next task from the queue started automatically!
|
|
1145
1168
|
|
|
1146
1169
|
=== 10:12 — Cancel a worktree task ===
|
|
1147
1170
|
|
|
1148
|
-
You: /cancel
|
|
1149
|
-
Bot: 🛑 [
|
|
1171
|
+
You: /cancel &api/feature/auth
|
|
1172
|
+
Bot: 🛑 [&api/feature/auth] Task cancelled
|
|
1150
1173
|
|
|
1151
1174
|
=== 10:15 — api/main (tests) finished ===
|
|
1152
1175
|
|
|
1153
|
-
Bot: ✅ [
|
|
1176
|
+
Bot: ✅ [&api] Done: add tests for /users
|
|
1154
1177
|
|
|
1155
1178
|
Created tests/users.test.js.
|
|
1156
1179
|
Covered cases: pagination, sorting, empty result, errors.
|
|
@@ -1160,14 +1183,14 @@ Bot: ✅ [/api] Done: add tests for /users
|
|
|
1160
1183
|
You: /history
|
|
1161
1184
|
Bot: 📜 Recent tasks:
|
|
1162
1185
|
|
|
1163
|
-
✅ [
|
|
1164
|
-
🛑 [
|
|
1165
|
-
✅ [
|
|
1166
|
-
✅ [
|
|
1186
|
+
✅ [&api] add tests for /users
|
|
1187
|
+
🛑 [&api/feature/auth] add JWT authorization middleware
|
|
1188
|
+
✅ [&api] add endpoint GET /users with pagination
|
|
1189
|
+
✅ [&web] add a /users page...
|
|
1167
1190
|
|
|
1168
1191
|
=== 10:17 — Remove unneeded worktree ===
|
|
1169
1192
|
|
|
1170
|
-
You: /rmworktree
|
|
1193
|
+
You: /rmworktree &api/feature/auth
|
|
1171
1194
|
Bot: 🗑 Worktree feature/auth removed from project "api"
|
|
1172
1195
|
|
|
1173
1196
|
=== Evening — Shut down ===
|