@bybrawe/opencode-loop 0.5.1 → 0.5.6
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/CHANGELOG.md +26 -0
- package/README.md +1016 -847
- package/commands/loop-ask.md +5 -0
- package/commands/loop-cmd.md +5 -0
- package/commands/loop-command.md +5 -0
- package/commands/loop-prompt.md +5 -0
- package/commands/loop-shell.md +5 -0
- package/package.json +4 -1
- package/src/index.js +239 -47
package/README.md
CHANGED
|
@@ -1,848 +1,1017 @@
|
|
|
1
|
-
# OpenCode Loop
|
|
2
|
-
|
|
3
|
-
**Claude Code style auto-continue for OpenCode.**
|
|
4
|
-
|
|
5
|
-
OpenCode Loop adds a practical `/loop` command and `opencode-loopd` daemon to OpenCode so an agent can keep working after each idle turn instead of waiting for you to type “continue” again.
|
|
6
|
-
|
|
7
|
-
It is useful for long coding sessions, `progress.md` workflows, TODO automation, test-fix loops, periodic `/compact`, checkpoints, safe autonomous development, and background OpenCode continuation jobs.
|
|
8
|
-
|
|
9
|
-
Repository: **ByBrawe/opencode-loop**
|
|
10
|
-
NPM package name: **@bybrawe/opencode-loop**
|
|
11
|
-
|
|
12
|
-
##
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
- `
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
- background
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
-
|
|
32
|
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
-
|
|
63
|
-
|
|
64
|
-
- **
|
|
65
|
-
- **
|
|
66
|
-
- **
|
|
67
|
-
- **
|
|
68
|
-
- **
|
|
69
|
-
- **
|
|
70
|
-
- **
|
|
71
|
-
- **
|
|
72
|
-
- **
|
|
73
|
-
- **
|
|
74
|
-
- **
|
|
75
|
-
- **
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
/loop
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
The
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
```
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
```
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
```
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
```
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
```
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
```
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
```
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
```
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
```text
|
|
441
|
-
/loop
|
|
442
|
-
/loop
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
```text
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
```text
|
|
506
|
-
/loop
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
```
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
```
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
```
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
```text
|
|
565
|
-
/loop
|
|
566
|
-
```
|
|
567
|
-
|
|
568
|
-
###
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
```text
|
|
573
|
-
/loop
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
.
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
```
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
```
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
```
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
```
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
```
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
```
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
###
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
```
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
```
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
```text
|
|
702
|
-
/loop 0s --
|
|
703
|
-
```
|
|
704
|
-
|
|
705
|
-
###
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
```
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
```
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
```text
|
|
762
|
-
|
|
763
|
-
```
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
```
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
```
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
```
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
###
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
1
|
+
# OpenCode Loop
|
|
2
|
+
|
|
3
|
+
**Claude Code style auto-continue for OpenCode.**
|
|
4
|
+
|
|
5
|
+
OpenCode Loop adds a practical `/loop` command and `opencode-loopd` daemon to OpenCode so an agent can keep working after each idle turn instead of waiting for you to type “continue” again.
|
|
6
|
+
|
|
7
|
+
It is useful for long coding sessions, `progress.md` workflows, TODO automation, test-fix loops, periodic `/compact`, checkpoints, safe autonomous development, and background OpenCode continuation jobs.
|
|
8
|
+
|
|
9
|
+
Repository: **ByBrawe/opencode-loop**
|
|
10
|
+
NPM package name: **@bybrawe/opencode-loop**
|
|
11
|
+
|
|
12
|
+
## Current status
|
|
13
|
+
|
|
14
|
+
**v0.5.6 fixes the recent OpenCode update compatibility issue and adds clear loop action types.** OpenCode Loop has been updated for the current OpenCode SDK/TUI call shape and idle/status behavior. The TUI loop waits for the session to become idle, debounces idle events, and avoids starting a new run while OpenCode is still busy or queued. It now separates prompt loops, scheduled question loops, OpenCode slash-command loops, shell loops, and compact loops so commands like `/compact` are not sent as normal chat text.
|
|
15
|
+
|
|
16
|
+
The known update-related symptoms from older builds are fixed:
|
|
17
|
+
|
|
18
|
+
- `/loop` looks queued but the job stays at `runs=0`
|
|
19
|
+
- a loop job is replaced but does not fire after OpenCode becomes idle
|
|
20
|
+
- repeated `/loop` commands create confusing queued turns
|
|
21
|
+
- prompt, shell, or toast calls silently fail after OpenCode SDK changes
|
|
22
|
+
- `/compact` accidentally being treated as a normal agent prompt
|
|
23
|
+
- intermittent `Tool execution aborted` behavior caused by triggering a new turn too early
|
|
24
|
+
|
|
25
|
+
The TUI loop is still intentionally session-bound: it runs while OpenCode is open and the current session emits status/idle events. For long-running background work after closing the terminal or OpenCode, use `opencode-loopd`.
|
|
26
|
+
|
|
27
|
+
## Why this exists
|
|
28
|
+
|
|
29
|
+
Claude Code users often rely on a loop-like workflow where the agent finishes one step, then immediately continues with the next step.
|
|
30
|
+
|
|
31
|
+
OpenCode is powerful, but long-running autonomous workflows usually need extra control around:
|
|
32
|
+
|
|
33
|
+
- auto-continue after idle
|
|
34
|
+
- compact / summarize scheduling
|
|
35
|
+
- `progress.md` and TODO-driven development
|
|
36
|
+
- test verification after each turn
|
|
37
|
+
- patch checkpoints
|
|
38
|
+
- maximum runtime limits
|
|
39
|
+
- failure limits
|
|
40
|
+
- background daemon execution
|
|
41
|
+
- Windows Task Scheduler support
|
|
42
|
+
- safety prompts and destructive command guards
|
|
43
|
+
|
|
44
|
+
OpenCode Loop is designed for developers searching for:
|
|
45
|
+
|
|
46
|
+
- OpenCode loop
|
|
47
|
+
- OpenCode Claude Code loop
|
|
48
|
+
- OpenCode auto continue
|
|
49
|
+
- OpenCode continue automatically
|
|
50
|
+
- OpenCode `/loop` command
|
|
51
|
+
- OpenCode compact scheduler
|
|
52
|
+
- OpenCode Ralph loop alternative
|
|
53
|
+
- Claude Code style loop for OpenCode
|
|
54
|
+
- autonomous coding loop for OpenCode
|
|
55
|
+
- progress.md TODO automation for OpenCode
|
|
56
|
+
- OpenCode background daemon
|
|
57
|
+
- OpenCode loop daemon
|
|
58
|
+
- OpenCode Windows Task Scheduler loop
|
|
59
|
+
|
|
60
|
+
## Features
|
|
61
|
+
|
|
62
|
+
> The TUI `/loop` command is session-bound. It runs while OpenCode is open and the session receives idle/status events. If the terminal closes, the machine sleeps, the process is killed, or the provider connection is lost for a long time, the TUI loop cannot continue in the background. For long-running loops, use `opencode-loopd` daemon mode.
|
|
63
|
+
|
|
64
|
+
- **Claude Code style auto-continue** with `/loop 0s ...`.
|
|
65
|
+
- **TUI loop mode** with `/loop`, active while OpenCode is open.
|
|
66
|
+
- **Background daemon mode** with `opencode-loopd` for long-running loops outside the OpenCode TUI.
|
|
67
|
+
- **Windows Task Scheduler helper** with `opencode-loopd install-task`.
|
|
68
|
+
- **One-shot scheduled runs** for periodic continuation jobs.
|
|
69
|
+
- **Interval loops** for prompts, slash commands, and shell commands.
|
|
70
|
+
- **Prompt-file support** with `--prompt-file loop-prompt.md` for long reusable instructions.
|
|
71
|
+
- **Prompt-file daemon support** with `opencode-loopd --prompt-file loop-prompt.md`.
|
|
72
|
+
- **Include extra context files** with `--include-file`.
|
|
73
|
+
- **progress.md workflow** with `--progress-file progress.md`.
|
|
74
|
+
- **Large TODO support** with `--batch`.
|
|
75
|
+
- **Compact scheduling** with `/loop 200m /compact` or `--compact-every`.
|
|
76
|
+
- **Verification loops** with `--verify "npm test"`.
|
|
77
|
+
- **Preflight checks** with `--preflight "npm install"`.
|
|
78
|
+
- **Post-run commands** with `--postrun`.
|
|
79
|
+
- **Failure control** with `--max-failures` and `--pause-on-verify-fail`.
|
|
80
|
+
- **Runtime control** with `--max-runtime 6h`.
|
|
81
|
+
- **Run limit support** with `--max-runs`.
|
|
82
|
+
- **Wait-before-first-run support** with `--no-now` for TUI loops and `--sleep-first` for daemon mode.
|
|
83
|
+
- **Checkpoints** with `--checkpoint-only` or `--git-checkpoint`.
|
|
84
|
+
- **Safe mode** with `--safe` and prompt-level destructive command warnings.
|
|
85
|
+
- **Branch setup** with `--branch ai-loop`.
|
|
86
|
+
- **Stop controls** with `--stop-file STOP_LOOP`, `--until`, `/loop-stop`, `/loop-pause`, `/loop-resume`, and `/loop-remove`.
|
|
87
|
+
- **Watch mode** with `--watch progress.md`.
|
|
88
|
+
- **Diagnostics** with `/loop-doctor`.
|
|
89
|
+
- **Starter progress file** with `/loop-init`.
|
|
90
|
+
- **State export** with `/loop-export`.
|
|
91
|
+
|
|
92
|
+
## Installation
|
|
93
|
+
|
|
94
|
+
### Recommended: install from npm
|
|
95
|
+
|
|
96
|
+
For a clean reinstall or upgrade, use the latest published package:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
npx -y @bybrawe/opencode-loop@latest
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Then fully restart OpenCode.
|
|
103
|
+
|
|
104
|
+
Install from npm with `npx`:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
npx -y @bybrawe/opencode-loop
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
On Windows CMD:
|
|
111
|
+
|
|
112
|
+
```bat
|
|
113
|
+
npx -y @bybrawe/opencode-loop
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
On Windows PowerShell:
|
|
117
|
+
|
|
118
|
+
```powershell
|
|
119
|
+
npx -y @bybrawe/opencode-loop
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
The installer copies the plugin and slash command files into your OpenCode config directory.
|
|
123
|
+
|
|
124
|
+
Windows target paths:
|
|
125
|
+
|
|
126
|
+
```text
|
|
127
|
+
%USERPROFILE%\.config\opencode\plugins\opencode-loop.js
|
|
128
|
+
%USERPROFILE%\.config\opencode\commands\loop*.md
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
macOS / Linux target paths:
|
|
132
|
+
|
|
133
|
+
```text
|
|
134
|
+
~/.config/opencode/plugins/opencode-loop.js
|
|
135
|
+
~/.config/opencode/commands/loop*.md
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Then fully restart OpenCode and run:
|
|
139
|
+
|
|
140
|
+
```text
|
|
141
|
+
/loop-help
|
|
142
|
+
/loop-doctor
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
The npm package also installs the `opencode-loopd` CLI for background loops:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
opencode-loopd --help
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Why `npx` is the recommended npm install
|
|
152
|
+
|
|
153
|
+
OpenCode can load npm plugins from the `plugin` array in `opencode.json`, but OpenCode slash commands are discovered from command definitions such as markdown files in a `commands/` directory or command entries in config.
|
|
154
|
+
|
|
155
|
+
The `npx` installer installs both parts:
|
|
156
|
+
|
|
157
|
+
- the OpenCode plugin file
|
|
158
|
+
- the `/loop-*` command markdown files
|
|
159
|
+
|
|
160
|
+
Use the OpenCode config-only method only if you already installed the command files separately or you are only testing plugin loading.
|
|
161
|
+
|
|
162
|
+
### Optional: OpenCode config package entry
|
|
163
|
+
|
|
164
|
+
If you want OpenCode to load the npm plugin package directly, add the scoped package name to your OpenCode config:
|
|
165
|
+
|
|
166
|
+
```json
|
|
167
|
+
{
|
|
168
|
+
"$schema": "https://opencode.ai/config.json",
|
|
169
|
+
"plugin": ["@bybrawe/opencode-loop"]
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Use the scoped package name exactly as shown.
|
|
174
|
+
|
|
175
|
+
`opencode-loop` without `@bybrawe/` is a different npm package name.
|
|
176
|
+
|
|
177
|
+
If `/loop` does not appear after using only the config method, run the installer once:
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
npx -y @bybrawe/opencode-loop
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Install from GitHub
|
|
184
|
+
|
|
185
|
+
Use this if you want to install from source instead of npm.
|
|
186
|
+
|
|
187
|
+
Windows PowerShell:
|
|
188
|
+
|
|
189
|
+
```powershell
|
|
190
|
+
git clone https://github.com/ByBrawe/opencode-loop.git
|
|
191
|
+
cd opencode-loop
|
|
192
|
+
powershell -ExecutionPolicy Bypass -File .\scripts\install.ps1
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
macOS / Linux / Git Bash:
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
git clone https://github.com/ByBrawe/opencode-loop.git
|
|
199
|
+
cd opencode-loop
|
|
200
|
+
chmod +x ./scripts/install.sh
|
|
201
|
+
./scripts/install.sh
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Then restart OpenCode and run:
|
|
205
|
+
|
|
206
|
+
```text
|
|
207
|
+
/loop-help
|
|
208
|
+
/loop-doctor
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Manual global install
|
|
212
|
+
|
|
213
|
+
Windows PowerShell:
|
|
214
|
+
|
|
215
|
+
```powershell
|
|
216
|
+
mkdir "$env:USERPROFILE\.config\opencode\plugins" -Force
|
|
217
|
+
mkdir "$env:USERPROFILE\.config\opencode\commands" -Force
|
|
218
|
+
copy .\src\index.js "$env:USERPROFILE\.config\opencode\plugins\opencode-loop.js"
|
|
219
|
+
copy .\commands\*.md "$env:USERPROFILE\.config\opencode\commands\"
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
macOS / Linux:
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
mkdir -p ~/.config/opencode/plugins ~/.config/opencode/commands
|
|
226
|
+
cp ./src/index.js ~/.config/opencode/plugins/opencode-loop.js
|
|
227
|
+
cp ./commands/*.md ~/.config/opencode/commands/
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### Project-local install
|
|
231
|
+
|
|
232
|
+
Use this when you want the plugin to be available only inside one repository.
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
mkdir -p .opencode/plugins .opencode/commands
|
|
236
|
+
cp ./src/index.js .opencode/plugins/opencode-loop.js
|
|
237
|
+
cp ./commands/*.md .opencode/commands/
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
On Windows PowerShell:
|
|
241
|
+
|
|
242
|
+
```powershell
|
|
243
|
+
mkdir .opencode\plugins -Force
|
|
244
|
+
mkdir .opencode\commands -Force
|
|
245
|
+
copy .\src\index.js .opencode\plugins\opencode-loop.js
|
|
246
|
+
copy .\commands\*.md .opencode\commands\
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### Verify installation
|
|
250
|
+
|
|
251
|
+
After restarting OpenCode, run:
|
|
252
|
+
|
|
253
|
+
```text
|
|
254
|
+
/loop-help
|
|
255
|
+
/loop-doctor
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
If the commands do not appear:
|
|
259
|
+
|
|
260
|
+
1. Make sure OpenCode was fully restarted.
|
|
261
|
+
2. Check that `opencode-loop.js` exists in the OpenCode plugin directory.
|
|
262
|
+
3. Check that `loop.md`, `loop-help.md`, and the other command files exist in the OpenCode commands directory.
|
|
263
|
+
4. Run `npx -y @bybrawe/opencode-loop` again to reinstall the command files.
|
|
264
|
+
|
|
265
|
+
## Quick start
|
|
266
|
+
|
|
267
|
+
### The 5 examples most people need
|
|
268
|
+
|
|
269
|
+
Auto-continue every time OpenCode finishes a turn:
|
|
270
|
+
|
|
271
|
+
```text
|
|
272
|
+
/loop 0s continue from progress.md and implement the next unfinished TODO
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
Run now, then continue every 1 minute when OpenCode is idle:
|
|
276
|
+
|
|
277
|
+
```text
|
|
278
|
+
/loop 1m continue the project
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
Wait 1 minute before the first run, then continue every 1 minute when idle:
|
|
282
|
+
|
|
283
|
+
```text
|
|
284
|
+
/loop 1m --no-now continue the project
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
Run OpenCode compact every 200 minutes, but only when OpenCode is idle:
|
|
288
|
+
|
|
289
|
+
```text
|
|
290
|
+
/loop-command 200m /compact
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
Ask a recurring check question every hour:
|
|
294
|
+
|
|
295
|
+
```text
|
|
296
|
+
/loop-ask 1h did you run tests, tsc --noEmit, and build? If not, run them and fix any error.
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
Run a real shell command every 10 minutes when idle:
|
|
300
|
+
|
|
301
|
+
```text
|
|
302
|
+
/loop-shell 10m npm test
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### What “when idle” means
|
|
306
|
+
|
|
307
|
+
OpenCode Loop is idle-safe. It does **not** intentionally start a new agent turn while OpenCode is already busy.
|
|
308
|
+
|
|
309
|
+
Example:
|
|
310
|
+
|
|
311
|
+
```text
|
|
312
|
+
/loop 5m continue the project
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
If 5 minutes pass while OpenCode is still working, the job becomes due but waits. As soon as OpenCode becomes idle, the loop sends the prompt. This avoids queued turns, aborted tools, and overlapping responses.
|
|
316
|
+
|
|
317
|
+
### Prompt loops vs command loops
|
|
318
|
+
|
|
319
|
+
Use a prompt loop when you want to ask or instruct the agent:
|
|
320
|
+
|
|
321
|
+
```text
|
|
322
|
+
/loop 1h check if tests, tsc --noEmit, and build pass. If not, fix them.
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
Use a command loop when the action starts with `/` and should be executed as an OpenCode command:
|
|
326
|
+
|
|
327
|
+
```text
|
|
328
|
+
/loop-command 200m /compact
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
Do not use this for compacting:
|
|
332
|
+
|
|
333
|
+
```text
|
|
334
|
+
/loop 200m /compact
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
That can look like a chat prompt in older versions or unclear setups. Prefer `/loop-command 200m /compact` or the shortcut below:
|
|
338
|
+
|
|
339
|
+
```text
|
|
340
|
+
/loop-compact 200m
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
### Safer development loop
|
|
344
|
+
|
|
345
|
+
```text
|
|
346
|
+
/loop 0s --name dev --ask-never --safe --no-overlap --batch 5 --compact-every 200m --checkpoint-only --progress-file progress.md Treat progress.md as the main project state file. Continue with the next unfinished TODO, implement it, mark completed items with [x], add useful follow-up TODOs when you discover them, run tests/lint/build when available, and keep going while work remains.
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
### Test-fix loop
|
|
350
|
+
|
|
351
|
+
```text
|
|
352
|
+
/loop 0s --name testfix --ask-never --safe --verify "npm test" Continue from progress.md. If tests fail, analyze the failure, fix it, and run the tests again.
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
## Background daemon
|
|
356
|
+
|
|
357
|
+
The `/loop` command is session-bound. It works while OpenCode is open and the current session emits idle/status events.
|
|
358
|
+
|
|
359
|
+
If you close OpenCode, restart the terminal, lose connection, or your PC sleeps, the TUI loop will not keep running.
|
|
360
|
+
|
|
361
|
+
For long-running loops, use the daemon:
|
|
362
|
+
|
|
363
|
+
```bash
|
|
364
|
+
opencode-loopd --project . --every 5m --prompt-file loop-prompt.md
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
Run immediately after each OpenCode turn:
|
|
368
|
+
|
|
369
|
+
```bash
|
|
370
|
+
opencode-loopd --project . --every 0s --prompt "continue from progress.md and implement the next unfinished TODO"
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
Limit runs:
|
|
374
|
+
|
|
375
|
+
```bash
|
|
376
|
+
opencode-loopd --project . --every 5m --max-runs 20 --prompt-file loop-prompt.md
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
Wait before the first run:
|
|
380
|
+
|
|
381
|
+
```bash
|
|
382
|
+
opencode-loopd --project . --every 10m --sleep-first --prompt-file loop-prompt.md
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
Use an inline prompt:
|
|
386
|
+
|
|
387
|
+
```bash
|
|
388
|
+
opencode-loopd --project . --every 0s --prompt "continue from progress.md and implement the next unfinished TODO"
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
Example `loop-prompt.md`:
|
|
392
|
+
|
|
393
|
+
```md
|
|
394
|
+
Continue from progress.md and implement the next unfinished TODO.
|
|
395
|
+
|
|
396
|
+
Rules:
|
|
397
|
+
- Do not ask questions.
|
|
398
|
+
- Make reasonable assumptions.
|
|
399
|
+
- Mark completed TODO items with [x].
|
|
400
|
+
- Add useful follow-up TODOs when needed.
|
|
401
|
+
- Run tests/lint/build when available.
|
|
402
|
+
- Do not run destructive commands such as git reset, git clean, rm -rf, force push, deploy, or production migrations.
|
|
403
|
+
- Keep going while work remains.
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
## Windows Task Scheduler
|
|
407
|
+
|
|
408
|
+
You can create a Windows scheduled task that runs a one-shot daemon job every N minutes.
|
|
409
|
+
|
|
410
|
+
Install a scheduled task:
|
|
411
|
+
|
|
412
|
+
```powershell
|
|
413
|
+
opencode-loopd install-task --project "C:\path\to\project" --every 10m --prompt-file loop-prompt.md --name OpenCodeLoop
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
Remove it:
|
|
417
|
+
|
|
418
|
+
```powershell
|
|
419
|
+
opencode-loopd uninstall-task --name OpenCodeLoop
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
Check existing tasks:
|
|
423
|
+
|
|
424
|
+
```powershell
|
|
425
|
+
Get-ScheduledTask | Where-Object { $_.TaskName -like "*OpenCode*" }
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
For active development, a visible terminal running daemon mode is usually easier to monitor:
|
|
429
|
+
|
|
430
|
+
```powershell
|
|
431
|
+
opencode-loopd --project "C:\path\to\project" --every 0s --prompt-file loop-prompt.md
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
## Multiple loops and duplicate protection
|
|
435
|
+
|
|
436
|
+
By default, `/loop ...` uses an upsert/replace behavior. Running `/loop 5m ...` again replaces the existing default loop instead of creating duplicate jobs.
|
|
437
|
+
|
|
438
|
+
Use `--name` to manage separate named loops, or `--multi` when you intentionally want multiple loops with the same shape:
|
|
439
|
+
|
|
440
|
+
```text
|
|
441
|
+
/loop 5m --name dev continue from progress.md
|
|
442
|
+
/loop 200m --name compact /compact
|
|
443
|
+
/loop 10m --multi !npm test
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
## Core commands
|
|
447
|
+
|
|
448
|
+
| Command | Purpose |
|
|
449
|
+
|---|---|
|
|
450
|
+
| `/loop <interval> <prompt>` | Add an idle/interval prompt loop |
|
|
451
|
+
| `/loop-command <interval> <slash-command>` | Schedule an OpenCode slash command such as `/compact` |
|
|
452
|
+
| `/loop-cmd <interval> <slash-command>` | Alias for `/loop-command` |
|
|
453
|
+
| `/loop-ask <interval> <prompt/question>` | Schedule a recurring question/check prompt; first run waits for the interval by default |
|
|
454
|
+
| `/loop-prompt <interval> <prompt>` | Force prompt mode, even when you want explicit prompt-loop naming |
|
|
455
|
+
| `/loop-shell <interval> <shell-command>` | Schedule a shell command loop |
|
|
456
|
+
| `/loop-help` | Show usage help inside OpenCode |
|
|
457
|
+
| `/loop-status` | Show active loop jobs |
|
|
458
|
+
| `/loop-logs` | Show recent loop log entries |
|
|
459
|
+
| `/loop-now [id/name/number/all]` | Run loop job(s) immediately |
|
|
460
|
+
| `/loop-pause [id/name/number/all]` | Pause loop job(s) |
|
|
461
|
+
| `/loop-resume [id/name/number/all]` | Resume loop job(s) |
|
|
462
|
+
| `/loop-remove [id/name/number/all]` | Remove loop job(s) |
|
|
463
|
+
| `/loop-stop [id/name/number/all]` | Alias for remove/stop |
|
|
464
|
+
| `/loop-clear` | Remove all loop jobs for the current session |
|
|
465
|
+
| `/loop-doctor` | Diagnose plugin/session state |
|
|
466
|
+
| `/loop-init [file]` | Create a starter `progress.md` or another progress file |
|
|
467
|
+
| `/loop-export` | Export current loop state as JSON |
|
|
468
|
+
|
|
469
|
+
## Preset commands
|
|
470
|
+
|
|
471
|
+
| Command | Purpose |
|
|
472
|
+
|---|---|
|
|
473
|
+
| `/loop-dev 0s` | General autonomous OpenCode development loop |
|
|
474
|
+
| `/loop-progress 0s` | Follow `progress.md` and TODOs |
|
|
475
|
+
| `/loop-safe-dev 0s` | Safe dev loop with ask-never, batch 5, and patch checkpoints |
|
|
476
|
+
| `/loop-testfix 0s "npm test"` | Run, fix, and re-run tests |
|
|
477
|
+
| `/loop-compact 200m` | Compact loop shortcut |
|
|
478
|
+
|
|
479
|
+
## Intervals
|
|
480
|
+
|
|
481
|
+
```text
|
|
482
|
+
0s run whenever OpenCode becomes idle, like Claude Code auto-continue
|
|
483
|
+
5m run every 5 minutes when idle
|
|
484
|
+
200m run every 200 minutes when idle
|
|
485
|
+
1h run every hour when idle
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
The plugin is **idle-driven**. It checks jobs when OpenCode becomes idle, so it avoids intentionally starting a second agent turn on top of an active one.
|
|
489
|
+
|
|
490
|
+
If the interval expires while OpenCode is busy, the loop becomes due and waits. It runs on the next idle event.
|
|
491
|
+
|
|
492
|
+
## Loop types
|
|
493
|
+
|
|
494
|
+
OpenCode Loop has separate types for prompts, OpenCode slash commands, and shell commands. This matters because `/compact` should be executed as an OpenCode command, not sent to the agent as text.
|
|
495
|
+
|
|
496
|
+
| Type | Use | Example | First run |
|
|
497
|
+
|---|---|---|---|
|
|
498
|
+
| Prompt loop | Ask or instruct the agent repeatedly | `/loop 1h check whether tests, tsc --noEmit, and build pass` | Now by default |
|
|
499
|
+
| Scheduled question | Ask/check on a timer | `/loop-ask 1h did you run tests and build?` | After the interval by default |
|
|
500
|
+
| Slash-command loop | Run OpenCode commands like `/compact` | `/loop-command 200m /compact` | After the interval by default |
|
|
501
|
+
| Shell loop | Run real terminal commands | `/loop-shell 10m npm test` | After the interval by default |
|
|
502
|
+
|
|
503
|
+
You can still force the type on `/loop`:
|
|
504
|
+
|
|
505
|
+
```text
|
|
506
|
+
/loop 200m --command /compact
|
|
507
|
+
/loop 10m --shell npm test
|
|
508
|
+
/loop 1h --prompt did you run tests, tsc --noEmit, and build?
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
## Actions
|
|
512
|
+
|
|
513
|
+
### Prompt action
|
|
514
|
+
|
|
515
|
+
```text
|
|
516
|
+
/loop 0s continue from progress.md. Work on the next unfinished TODO. Mark completed items with [x].
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
### Prompt file action
|
|
520
|
+
|
|
521
|
+
Use this when the prompt is too long for a single command line:
|
|
522
|
+
|
|
523
|
+
```text
|
|
524
|
+
/loop 0s --prompt-file loop-prompt.md
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
Example `loop-prompt.md`:
|
|
528
|
+
|
|
529
|
+
```md
|
|
530
|
+
Continue from progress.md.
|
|
531
|
+
Do not ask questions unless truly blocked.
|
|
532
|
+
Make reasonable assumptions and keep working.
|
|
533
|
+
Complete TODOs in order and mark finished items with [x].
|
|
534
|
+
Add useful follow-up TODOs when you discover them.
|
|
535
|
+
Run tests, lint, or build when available.
|
|
536
|
+
Do not run destructive commands, force pushes, production deploys, or database resets.
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
### Include extra context files
|
|
540
|
+
|
|
541
|
+
```text
|
|
542
|
+
/loop 0s --include-file ARCHITECTURE.md --include-file progress.md continue with the next implementation task
|
|
543
|
+
```
|
|
544
|
+
|
|
545
|
+
### Slash command action
|
|
546
|
+
|
|
547
|
+
Use `/loop-command` when the action should be executed as an OpenCode command instead of sent to the agent as text.
|
|
548
|
+
|
|
549
|
+
```text
|
|
550
|
+
/loop-command 200m /compact
|
|
551
|
+
/loop-command 15m /review current changes
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
`/compact` and `/summarize` are treated specially and routed to OpenCode's TUI compact action. Custom command templates such as `/review` are routed through OpenCode's session command API. If OpenCode is busy when the interval expires, the command waits and runs when the session becomes idle.
|
|
555
|
+
|
|
556
|
+
Equivalent forced type on `/loop`:
|
|
557
|
+
|
|
558
|
+
```text
|
|
559
|
+
/loop 200m --command /compact
|
|
560
|
+
```
|
|
561
|
+
|
|
562
|
+
For most users, the clearer form is preferred:
|
|
563
|
+
|
|
564
|
+
```text
|
|
565
|
+
/loop-command 200m /compact
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
### Shell action
|
|
569
|
+
|
|
570
|
+
Use `/loop-shell` for real terminal commands.
|
|
571
|
+
|
|
572
|
+
```text
|
|
573
|
+
/loop-shell 10m npm test
|
|
574
|
+
/loop-shell 30m pnpm lint
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
Equivalent forced type on `/loop`:
|
|
578
|
+
|
|
579
|
+
```text
|
|
580
|
+
/loop 10m --shell npm test
|
|
581
|
+
```
|
|
582
|
+
|
|
583
|
+
Shell actions starting with `!` or `$` run through the OpenCode shell tool.
|
|
584
|
+
|
|
585
|
+
## Flags
|
|
586
|
+
|
|
587
|
+
### `--name <name>`
|
|
588
|
+
|
|
589
|
+
Name a loop so you can manage it later.
|
|
590
|
+
|
|
591
|
+
```text
|
|
592
|
+
/loop 0s --name dev continue from progress.md
|
|
593
|
+
/loop-pause dev
|
|
594
|
+
/loop-resume dev
|
|
595
|
+
/loop-stop dev
|
|
596
|
+
```
|
|
597
|
+
|
|
598
|
+
### `--max-runs <n>`
|
|
599
|
+
|
|
600
|
+
Stop after N runs.
|
|
601
|
+
|
|
602
|
+
```text
|
|
603
|
+
/loop 5m --max-runs 20 continue from progress.md
|
|
604
|
+
```
|
|
605
|
+
|
|
606
|
+
### `--max-runtime <duration>`
|
|
607
|
+
|
|
608
|
+
Stop after total runtime from loop creation.
|
|
609
|
+
|
|
610
|
+
```text
|
|
611
|
+
/loop 0s --max-runtime 6h continue from progress.md
|
|
612
|
+
```
|
|
613
|
+
|
|
614
|
+
### `--timeout <duration>`
|
|
615
|
+
|
|
616
|
+
Best-effort abort after a single run timeout.
|
|
617
|
+
|
|
618
|
+
```text
|
|
619
|
+
/loop 0s --timeout 30m continue from progress.md
|
|
620
|
+
```
|
|
621
|
+
|
|
622
|
+
### `--max-failures <n>`
|
|
623
|
+
|
|
624
|
+
Pause after repeated verify/postrun failures.
|
|
625
|
+
|
|
626
|
+
```text
|
|
627
|
+
/loop 0s --verify "npm test" --max-failures 3 continue from progress.md and fix test failures
|
|
628
|
+
```
|
|
629
|
+
|
|
630
|
+
### `--pause-on-verify-fail`
|
|
631
|
+
|
|
632
|
+
Pause immediately after the first verify failure.
|
|
633
|
+
|
|
634
|
+
```text
|
|
635
|
+
/loop 0s --verify "npm test" --pause-on-verify-fail continue from progress.md
|
|
636
|
+
```
|
|
637
|
+
|
|
638
|
+
### `--until <text>`
|
|
639
|
+
|
|
640
|
+
Stop when a marker appears in common state files such as `progress.md`, `TODO.md`, or `.opencode/opencode-loop/until.txt`.
|
|
641
|
+
|
|
642
|
+
```text
|
|
643
|
+
/loop 5m --until ALL_DONE continue from progress.md
|
|
644
|
+
```
|
|
645
|
+
|
|
646
|
+
### `--stop-file <file>`
|
|
647
|
+
|
|
648
|
+
Stop when a file appears. This is a simple manual kill switch.
|
|
649
|
+
|
|
650
|
+
```text
|
|
651
|
+
/loop 0s --stop-file STOP_LOOP continue from progress.md
|
|
652
|
+
```
|
|
653
|
+
|
|
654
|
+
Create `STOP_LOOP` in the project root to stop that job.
|
|
655
|
+
|
|
656
|
+
### `--no-overlap` and `--allow-overlap`
|
|
657
|
+
|
|
658
|
+
`--no-overlap` is the default. It prevents a new run from being triggered while a previous run is still considered active.
|
|
659
|
+
|
|
660
|
+
```text
|
|
661
|
+
/loop 5m --no-overlap continue from progress.md
|
|
662
|
+
```
|
|
663
|
+
|
|
664
|
+
### `--compact-every <n|duration>`
|
|
665
|
+
|
|
666
|
+
Compact before a run every N runs or every duration.
|
|
667
|
+
|
|
668
|
+
```text
|
|
669
|
+
/loop 0s --compact-every 20 continue from progress.md
|
|
670
|
+
/loop 0s --compact-every 200m continue from progress.md
|
|
671
|
+
```
|
|
672
|
+
|
|
673
|
+
### `--test "<command>"`
|
|
674
|
+
|
|
675
|
+
Adds a test instruction to prompt actions.
|
|
676
|
+
|
|
677
|
+
```text
|
|
678
|
+
/loop 0s --test "npm test" continue from progress.md
|
|
679
|
+
```
|
|
680
|
+
|
|
681
|
+
### `--verify "<command>"`
|
|
682
|
+
|
|
683
|
+
Runs a real shell verification command after each assistant turn. If it fails, the next loop prompt includes the failure summary so the agent can fix it.
|
|
684
|
+
|
|
685
|
+
```text
|
|
686
|
+
/loop 0s --verify "npm test" continue from progress.md and fix any failing tests
|
|
687
|
+
```
|
|
688
|
+
|
|
689
|
+
### `--preflight "<command>"`
|
|
690
|
+
|
|
691
|
+
Runs a real shell command before each loop turn. If it fails, the loop pauses.
|
|
692
|
+
|
|
693
|
+
```text
|
|
694
|
+
/loop 0s --preflight "npm install" continue from progress.md
|
|
695
|
+
```
|
|
696
|
+
|
|
697
|
+
### `--postrun "<command>"`
|
|
698
|
+
|
|
699
|
+
Runs a shell command after each assistant turn and verification.
|
|
700
|
+
|
|
701
|
+
```text
|
|
702
|
+
/loop 0s --postrun "git status --short" continue from progress.md
|
|
703
|
+
```
|
|
704
|
+
|
|
705
|
+
### `--notify "<command>"`
|
|
706
|
+
|
|
707
|
+
Runs a shell command when a loop stops or pauses due to a control condition. The command can use `{job}` and `{reason}` placeholders.
|
|
708
|
+
|
|
709
|
+
```text
|
|
710
|
+
/loop 0s --max-runtime 6h --notify "echo {job} stopped because {reason}" continue from progress.md
|
|
711
|
+
```
|
|
712
|
+
|
|
713
|
+
### `--checkpoint-only`
|
|
714
|
+
|
|
715
|
+
Save `git status` and `git diff --binary` snapshots under:
|
|
716
|
+
|
|
717
|
+
```text
|
|
718
|
+
.opencode/opencode-loop/checkpoints/<session>/
|
|
719
|
+
```
|
|
720
|
+
|
|
721
|
+
### `--git-checkpoint`
|
|
722
|
+
|
|
723
|
+
Save a patch checkpoint and attempt to commit all changes after each completed run.
|
|
724
|
+
|
|
725
|
+
```text
|
|
726
|
+
/loop 0s --git-checkpoint continue from progress.md
|
|
727
|
+
```
|
|
728
|
+
|
|
729
|
+
Use carefully. It runs `git add -A` and `git commit` when changes exist.
|
|
730
|
+
|
|
731
|
+
### `--branch <name>`
|
|
732
|
+
|
|
733
|
+
Switch to a branch before the first run, or create it if it does not exist.
|
|
734
|
+
|
|
735
|
+
```text
|
|
736
|
+
/loop 0s --branch ai-loop continue from progress.md
|
|
737
|
+
```
|
|
738
|
+
|
|
739
|
+
### `--safe`
|
|
740
|
+
|
|
741
|
+
Adds safety instructions to prompt actions and blocks obviously destructive shell actions.
|
|
742
|
+
|
|
743
|
+
```text
|
|
744
|
+
/loop 0s --safe continue from progress.md
|
|
745
|
+
```
|
|
746
|
+
|
|
747
|
+
Safe mode warns against or blocks patterns such as `git reset`, `git clean`, `rm -rf`, `git push`, `terraform destroy`, destructive delete commands, and production deploys.
|
|
748
|
+
|
|
749
|
+
### `--batch <n>`
|
|
750
|
+
|
|
751
|
+
Tell the agent to process at most N TODO items per run.
|
|
752
|
+
|
|
753
|
+
```text
|
|
754
|
+
/loop 0s --batch 5 continue from progress.md
|
|
755
|
+
```
|
|
756
|
+
|
|
757
|
+
### `--quiet`
|
|
758
|
+
|
|
759
|
+
Tell the agent to keep replies short.
|
|
760
|
+
|
|
761
|
+
```text
|
|
762
|
+
/loop 0s --quiet continue from progress.md
|
|
763
|
+
```
|
|
764
|
+
|
|
765
|
+
### `--ask-never`
|
|
766
|
+
|
|
767
|
+
Tell the agent not to ask questions and to make reasonable assumptions.
|
|
768
|
+
|
|
769
|
+
```text
|
|
770
|
+
/loop 0s --ask-never continue from progress.md
|
|
771
|
+
```
|
|
772
|
+
|
|
773
|
+
### `--progress-file <file>`
|
|
774
|
+
|
|
775
|
+
Tell the agent which state file to treat as the main progress/TODO source.
|
|
776
|
+
|
|
777
|
+
```text
|
|
778
|
+
/loop 0s --progress-file progress.md continue from the progress file
|
|
779
|
+
```
|
|
780
|
+
|
|
781
|
+
### `--watch <file>`
|
|
782
|
+
|
|
783
|
+
Run when watched file metadata changes. This is still checked on idle events.
|
|
784
|
+
|
|
785
|
+
```text
|
|
786
|
+
/loop --watch progress.md continue after progress.md changes
|
|
787
|
+
/loop 5m --watch progress.md continue when progress.md changes or the interval is due
|
|
788
|
+
```
|
|
789
|
+
|
|
790
|
+
You can pass multiple `--watch` flags.
|
|
791
|
+
|
|
792
|
+
### `--dry-run`
|
|
793
|
+
|
|
794
|
+
Parse and preview a loop without saving it.
|
|
795
|
+
|
|
796
|
+
```text
|
|
797
|
+
/loop 0s --dry-run --ask-never continue from progress.md
|
|
798
|
+
```
|
|
799
|
+
|
|
800
|
+
### `--now` and `--no-now`
|
|
801
|
+
|
|
802
|
+
By default `/loop` prompt jobs are due immediately. Use `--no-now` to wait for the first interval.
|
|
803
|
+
|
|
804
|
+
```text
|
|
805
|
+
/loop 1h --no-now did you run tests, tsc --noEmit, and build?
|
|
806
|
+
```
|
|
807
|
+
|
|
808
|
+
Command-style shortcuts such as `/loop-command`, `/loop-ask`, and `/loop-shell` wait for the first interval by default. Use `--now` if you want them to run immediately too.
|
|
809
|
+
|
|
810
|
+
```text
|
|
811
|
+
/loop-command 200m /compact
|
|
812
|
+
/loop-command 200m --now /compact
|
|
813
|
+
```
|
|
814
|
+
|
|
815
|
+
## Recommended recipes
|
|
816
|
+
|
|
817
|
+
### Claude Code style auto-continue loop
|
|
818
|
+
|
|
819
|
+
```text
|
|
820
|
+
/loop 0s --name dev --ask-never --safe --no-overlap --batch 5 --compact-every 200m --checkpoint-only --progress-file progress.md Treat progress.md as the main project state file. Continue with the next unfinished TODO, implement it, mark completed items with [x], add useful follow-up TODOs when you discover them, run tests/lint/build when available, and keep going while work remains.
|
|
821
|
+
```
|
|
822
|
+
|
|
823
|
+
### Long-running autonomous development loop
|
|
824
|
+
|
|
825
|
+
```text
|
|
826
|
+
/loop 0s --name dev --ask-never --safe --no-overlap --compact-every 20 --timeout 45m --max-runtime 6h --max-failures 3 --stop-file STOP_LOOP --checkpoint-only Continue from progress.md. Do not ask questions. Make reasonable assumptions. Complete TODOs in order, mark finished items with [x], add useful new ideas to progress.md, and keep going while work remains.
|
|
827
|
+
```
|
|
828
|
+
|
|
829
|
+
### Daemon-based long-running development loop
|
|
830
|
+
|
|
831
|
+
```bash
|
|
832
|
+
opencode-loopd --project . --every 5m --prompt-file loop-prompt.md
|
|
833
|
+
```
|
|
834
|
+
|
|
835
|
+
### Test-fix loop
|
|
836
|
+
|
|
837
|
+
```text
|
|
838
|
+
/loop 0s --name testfix --ask-never --safe --verify "npm test" --max-failures 3 Continue from progress.md. If tests fail, analyze the failure, fix it, and run the tests again.
|
|
839
|
+
```
|
|
840
|
+
|
|
841
|
+
### Compact loop
|
|
842
|
+
|
|
843
|
+
```text
|
|
844
|
+
/loop-command 200m /compact
|
|
845
|
+
```
|
|
846
|
+
|
|
847
|
+
This compacts every 200 minutes when OpenCode is idle. It does not interrupt an active agent turn.
|
|
848
|
+
|
|
849
|
+
### Scheduled quality-check question
|
|
850
|
+
|
|
851
|
+
```text
|
|
852
|
+
/loop-ask 1h did you run tests, tsc --noEmit, and build? If not, run them now and fix errors.
|
|
853
|
+
```
|
|
854
|
+
|
|
855
|
+
This asks the agent every hour when idle. If the hour passes while the agent is working, the question waits and is sent after the current turn finishes.
|
|
856
|
+
|
|
857
|
+
### Prompt file loop
|
|
858
|
+
|
|
859
|
+
```text
|
|
860
|
+
/loop 0s --name dev --prompt-file loop-prompt.md --checkpoint-only --max-runtime 6h
|
|
861
|
+
```
|
|
862
|
+
|
|
863
|
+
## Suggested OpenCode permission config
|
|
864
|
+
|
|
865
|
+
Full `permission: "allow"` is convenient but risky. For safer long loops, keep destructive commands as ask/deny.
|
|
866
|
+
|
|
867
|
+
```json
|
|
868
|
+
{
|
|
869
|
+
"$schema": "https://opencode.ai/config.json",
|
|
870
|
+
"permission": {
|
|
871
|
+
"read": "allow",
|
|
872
|
+
"grep": "allow",
|
|
873
|
+
"glob": "allow",
|
|
874
|
+
"todowrite": "allow",
|
|
875
|
+
"edit": "allow",
|
|
876
|
+
"bash": {
|
|
877
|
+
"*": "ask",
|
|
878
|
+
"git status*": "allow",
|
|
879
|
+
"git diff*": "allow",
|
|
880
|
+
"npm test*": "allow",
|
|
881
|
+
"npm run test*": "allow",
|
|
882
|
+
"npm run lint*": "allow",
|
|
883
|
+
"pnpm test*": "allow",
|
|
884
|
+
"pnpm lint*": "allow",
|
|
885
|
+
"git push*": "ask",
|
|
886
|
+
"git reset*": "ask",
|
|
887
|
+
"git clean*": "deny",
|
|
888
|
+
"rm *": "deny",
|
|
889
|
+
"del *": "ask",
|
|
890
|
+
"rmdir *": "ask"
|
|
891
|
+
},
|
|
892
|
+
"external_directory": "ask"
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
```
|
|
896
|
+
|
|
897
|
+
## State files
|
|
898
|
+
|
|
899
|
+
Session loop state is stored under:
|
|
900
|
+
|
|
901
|
+
```text
|
|
902
|
+
.opencode/opencode-loop/
|
|
903
|
+
```
|
|
904
|
+
|
|
905
|
+
Patch checkpoints are stored under:
|
|
906
|
+
|
|
907
|
+
```text
|
|
908
|
+
.opencode/opencode-loop/checkpoints/
|
|
909
|
+
```
|
|
910
|
+
|
|
911
|
+
Recent plugin events are appended to:
|
|
912
|
+
|
|
913
|
+
```text
|
|
914
|
+
.opencode/opencode-loop/loop.log
|
|
915
|
+
```
|
|
916
|
+
|
|
917
|
+
## Example progress.md
|
|
918
|
+
|
|
919
|
+
Create one with:
|
|
920
|
+
|
|
921
|
+
```text
|
|
922
|
+
/loop-init
|
|
923
|
+
```
|
|
924
|
+
|
|
925
|
+
Example content:
|
|
926
|
+
|
|
927
|
+
```md
|
|
928
|
+
# Progress
|
|
929
|
+
|
|
930
|
+
## Current Goal
|
|
931
|
+
Improve the application in small safe steps.
|
|
932
|
+
|
|
933
|
+
## Agent Rules
|
|
934
|
+
- Do not ask questions unless truly blocked.
|
|
935
|
+
- Make reasonable assumptions and continue.
|
|
936
|
+
- Work on unfinished TODOs in order.
|
|
937
|
+
- Mark completed TODOs with [x].
|
|
938
|
+
- Add new bugs, ideas, or follow-up tasks as TODOs.
|
|
939
|
+
- Run tests/lint/build when available.
|
|
940
|
+
- Do not run destructive commands, force pushes, production deploys, or database resets.
|
|
941
|
+
|
|
942
|
+
## Active TODO
|
|
943
|
+
- [ ] Review the project structure and identify the next safe improvement.
|
|
944
|
+
- [ ] Fix the highest-priority failing test.
|
|
945
|
+
- [ ] Improve the user-facing error state in the main flow.
|
|
946
|
+
|
|
947
|
+
## Completed
|
|
948
|
+
- [x] Added initial project notes.
|
|
949
|
+
|
|
950
|
+
## Backlog Ideas
|
|
951
|
+
- [ ] Add a smoke test for the critical path.
|
|
952
|
+
- [ ] Improve developer setup documentation.
|
|
953
|
+
|
|
954
|
+
## Blocked
|
|
955
|
+
- None.
|
|
956
|
+
```
|
|
957
|
+
|
|
958
|
+
## Changelog highlights
|
|
959
|
+
|
|
960
|
+
### v0.5.6
|
|
961
|
+
|
|
962
|
+
- Added clearer README examples for prompt loops, scheduled question loops, command loops, shell loops, first-run timing, and idle-safe behavior.
|
|
963
|
+
- Stabilized `/loop-command 200m /compact` by routing compact/summarize through OpenCode TUI compact handling instead of treating it as a custom prompt command.
|
|
964
|
+
- Clarified that command loops wait for idle and should be used for slash commands such as `/compact`.
|
|
965
|
+
|
|
966
|
+
## v0.5.5
|
|
967
|
+
|
|
968
|
+
- Added explicit loop action types: prompt, scheduled question, OpenCode slash command, and shell command.
|
|
969
|
+
- Added `/loop-command` / `/loop-cmd` for commands such as `/compact`; these wait for the first interval by default.
|
|
970
|
+
- Added `/loop-ask` for recurring checks such as “did you run tests, tsc --noEmit, and build?”; it waits for the first interval by default.
|
|
971
|
+
- Added `/loop-shell` for recurring shell commands.
|
|
972
|
+
- Added `--prompt`, `--ask`, `--command`, `--cmd`, `--slash`, `--shell`, and `--compact` type flags for `/loop`.
|
|
973
|
+
- Clarified idle behavior: if a job becomes due while OpenCode is busy, it waits and runs on the next idle event.
|
|
974
|
+
|
|
975
|
+
### v0.5.4
|
|
976
|
+
|
|
977
|
+
- Fixed compatibility with recent OpenCode SDK/TUI call shapes.
|
|
978
|
+
- Updated prompt, shell, and toast calls for current OpenCode while keeping backwards-compatible fallbacks.
|
|
979
|
+
- Added `session.status` idle gating and debounce so loop runs do not stack on top of busy/queued agent turns.
|
|
980
|
+
- Improved logging around prompt/shell/toast failures instead of silently swallowing important runtime errors.
|
|
981
|
+
- Fixed the known update-related symptoms where `/loop` could appear queued, stay at `runs=0`, or only work intermittently.
|
|
982
|
+
|
|
983
|
+
### v0.5.1
|
|
984
|
+
|
|
985
|
+
- Cleaned up README installation docs.
|
|
986
|
+
- Removed duplicate npm install section.
|
|
987
|
+
- Removed unresolved merge conflict markers.
|
|
988
|
+
- Added clearer daemon mode documentation.
|
|
989
|
+
- Added Windows Task Scheduler examples.
|
|
990
|
+
- Added daemon usage examples for `--every`, `--max-runs`, `--sleep-first`, and `--prompt-file`.
|
|
991
|
+
|
|
992
|
+
### v0.5.0
|
|
993
|
+
|
|
994
|
+
- Added `opencode-loopd` background daemon.
|
|
995
|
+
- Added Windows Task Scheduler helper.
|
|
996
|
+
- Documented TUI loop vs daemon loop.
|
|
997
|
+
- Added background long-running loop examples.
|
|
998
|
+
|
|
999
|
+
### v0.4.3
|
|
1000
|
+
|
|
1001
|
+
- Added duplicate loop protection.
|
|
1002
|
+
- Quieted command markdown files.
|
|
1003
|
+
|
|
1004
|
+
## Notes and limits
|
|
1005
|
+
|
|
1006
|
+
- The TUI plugin is idle-driven. It does not run a background daemon while OpenCode is busy.
|
|
1007
|
+
- The TUI `/loop` command stops when OpenCode closes, the terminal closes, the machine sleeps, or the session stops emitting idle events.
|
|
1008
|
+
- For long-running work outside the TUI, use `opencode-loopd`.
|
|
1009
|
+
- `--timeout` is best-effort and relies on OpenCode's abort API.
|
|
1010
|
+
- `--verify`, `--preflight`, `--postrun`, and `--notify` run shell commands, so configure OpenCode permissions carefully.
|
|
1011
|
+
- `--until` scans common state files and a limited number of markdown/text/json/yaml files to avoid walking huge projects.
|
|
1012
|
+
- `--safe` reduces risk but does not replace careful OpenCode permissions.
|
|
1013
|
+
- For truly unattended multi-hour work, use a disposable branch or worktree and checkpoint patches.
|
|
1014
|
+
|
|
1015
|
+
## License
|
|
1016
|
+
|
|
848
1017
|
MIT
|