opencodekit 0.18.6 → 0.18.7
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/dist/index.js +1 -1
- package/dist/template/.opencode/AGENTS.md +9 -7
- package/dist/template/.opencode/dcp.jsonc +71 -81
- package/dist/template/.opencode/memory/project/gotchas.md +3 -3
- package/dist/template/.opencode/memory.db +0 -0
- package/dist/template/.opencode/memory.db-shm +0 -0
- package/dist/template/.opencode/memory.db-wal +0 -0
- package/dist/template/.opencode/opencode.json +1 -1
- package/dist/template/.opencode/package.json +1 -1
- package/dist/template/.opencode/pnpm-lock.yaml +71 -0
- package/dist/template/.opencode/skill/compaction/SKILL.md +19 -48
- package/dist/template/.opencode/skill/context-engineering/SKILL.md +1 -1
- package/dist/template/.opencode/skill/context-management/SKILL.md +16 -26
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -201,19 +201,21 @@ For major tracked work:
|
|
|
201
201
|
| Phase | Target | Action |
|
|
202
202
|
| ----------------- | ------- | ------------------------------------------ |
|
|
203
203
|
| Starting work | <50k | Load only essential AGENTS.md + task spec |
|
|
204
|
-
| Mid-task | 50-100k |
|
|
205
|
-
| Approaching limit | >100k | Aggressive
|
|
204
|
+
| Mid-task | 50-100k | Compress completed phases, keep active files |
|
|
205
|
+
| Approaching limit | >100k | Aggressive compression, sweep stale noise |
|
|
206
206
|
| Near capacity | >150k | Session restart with handoff |
|
|
207
207
|
|
|
208
|
-
###
|
|
208
|
+
### DCP Commands
|
|
209
209
|
|
|
210
|
-
- `
|
|
211
|
-
- `
|
|
210
|
+
- `/dcp context` — Show current context health and pressure
|
|
211
|
+
- `/dcp compress` — Compress completed conversation ranges (primary tool)
|
|
212
|
+
- `/dcp sweep` — Remove stale/noisy content according to DCP rules
|
|
213
|
+
- `/dcp stats` — Inspect pruning/compression activity
|
|
212
214
|
|
|
213
215
|
### Rules
|
|
214
216
|
|
|
215
|
-
1. **
|
|
216
|
-
2. **Batch
|
|
217
|
+
1. **Compress at phase boundaries** — not during active edits
|
|
218
|
+
2. **Batch cleanup** — use `/dcp sweep` for stale noise, not ad-hoc deletion
|
|
217
219
|
3. **Protected content** — AGENTS.md, .opencode/, .beads/, config files
|
|
218
220
|
|
|
219
221
|
---
|
|
@@ -1,83 +1,73 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
"supersedeWrites": {
|
|
74
|
-
"enabled": true,
|
|
75
|
-
},
|
|
76
|
-
// Purge error inputs after N turns
|
|
77
|
-
"purgeErrors": {
|
|
78
|
-
"enabled": true,
|
|
79
|
-
"turns": 4,
|
|
80
|
-
"protectedTools": [],
|
|
81
|
-
},
|
|
82
|
-
},
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/Opencode-DCP/opencode-dynamic-context-pruning/master/dcp.schema.json",
|
|
3
|
+
"enabled": true,
|
|
4
|
+
"debug": false,
|
|
5
|
+
// "minimal" shows prune activity without noise; "detailed" shows token counts
|
|
6
|
+
"pruneNotification": "detailed",
|
|
7
|
+
// "chat" (in-conversation) or "toast" (system notification)
|
|
8
|
+
"pruneNotificationType": "toast",
|
|
9
|
+
// Commands: /dcp context, /dcp stats, /dcp sweep, /dcp decompress, /dcp recompress
|
|
10
|
+
"commands": {
|
|
11
|
+
"enabled": true,
|
|
12
|
+
// Protect these from /dcp sweep
|
|
13
|
+
"protectedTools": ["observation", "memory-update", "memory-search"]
|
|
14
|
+
},
|
|
15
|
+
"turnProtection": {
|
|
16
|
+
"enabled": true,
|
|
17
|
+
"turns": 4
|
|
18
|
+
},
|
|
19
|
+
// Protected file patterns - never auto-prune reads of these files
|
|
20
|
+
"protectedFilePatterns": [
|
|
21
|
+
"**/.env*",
|
|
22
|
+
"**/AGENTS.md",
|
|
23
|
+
"**/.opencode/**",
|
|
24
|
+
"**/.beads/**",
|
|
25
|
+
"**/package.json",
|
|
26
|
+
"**/tsconfig.json",
|
|
27
|
+
"**/biome.json"
|
|
28
|
+
],
|
|
29
|
+
"compress": {
|
|
30
|
+
// v2.2.x beta: compress is the primary context management tool
|
|
31
|
+
"permission": "allow",
|
|
32
|
+
"showCompression": false,
|
|
33
|
+
"maxContextLimit": "80%",
|
|
34
|
+
"minContextLimit": 30000,
|
|
35
|
+
"flatSchema": false,
|
|
36
|
+
"protectUserMessages": true,
|
|
37
|
+
"protectedTools": [
|
|
38
|
+
"write",
|
|
39
|
+
"edit",
|
|
40
|
+
"memory-*",
|
|
41
|
+
"observation",
|
|
42
|
+
"skill",
|
|
43
|
+
"skill_mcp",
|
|
44
|
+
"task",
|
|
45
|
+
"batch",
|
|
46
|
+
"todowrite",
|
|
47
|
+
"todoread",
|
|
48
|
+
"tilth_*"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
// v2.2.5-beta0: experimental subagent support
|
|
52
|
+
"experimental": {
|
|
53
|
+
"allowSubAgents": true
|
|
54
|
+
},
|
|
55
|
+
// Auto strategies - TOP LEVEL, not under tools
|
|
56
|
+
"strategies": {
|
|
57
|
+
// Dedup = zero LLM cost, high impact - always enable
|
|
58
|
+
"deduplication": {
|
|
59
|
+
"enabled": true,
|
|
60
|
+
"protectedTools": []
|
|
61
|
+
},
|
|
62
|
+
// Supersede writes = zero cost, removes redundant write inputs after read
|
|
63
|
+
"supersedeWrites": {
|
|
64
|
+
"enabled": true
|
|
65
|
+
},
|
|
66
|
+
// Purge error inputs after N turns
|
|
67
|
+
"purgeErrors": {
|
|
68
|
+
"enabled": true,
|
|
69
|
+
"turns": 4,
|
|
70
|
+
"protectedTools": []
|
|
71
|
+
}
|
|
72
|
+
}
|
|
83
73
|
}
|
|
@@ -38,10 +38,10 @@ The edit tool (`str_replace`) is the #1 source of failures in LLM coding. Models
|
|
|
38
38
|
|
|
39
39
|
### Context Hygiene
|
|
40
40
|
|
|
41
|
-
-
|
|
42
|
-
-
|
|
41
|
+
- Compress completed work phases before moving on
|
|
42
|
+
- Use `/dcp sweep` after a closed phase to remove stale noise
|
|
43
43
|
- Token budget: <50k start → 50-100k mid → >150k restart session
|
|
44
|
-
- Subagent outputs can leak tokens —
|
|
44
|
+
- Subagent outputs can leak tokens — compress completed phases and sweep stale subagent noise
|
|
45
45
|
|
|
46
46
|
## OpenCode Config
|
|
47
47
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
lockfileVersion: '9.0'
|
|
2
|
+
|
|
3
|
+
settings:
|
|
4
|
+
autoInstallPeers: true
|
|
5
|
+
excludeLinksFromLockfile: false
|
|
6
|
+
|
|
7
|
+
importers:
|
|
8
|
+
|
|
9
|
+
.:
|
|
10
|
+
dependencies:
|
|
11
|
+
'@opencode-ai/plugin':
|
|
12
|
+
specifier: 1.2.22
|
|
13
|
+
version: 1.2.22
|
|
14
|
+
devDependencies:
|
|
15
|
+
'@types/node':
|
|
16
|
+
specifier: ^25.3.0
|
|
17
|
+
version: 25.3.5
|
|
18
|
+
bun-types:
|
|
19
|
+
specifier: ^1.3.9
|
|
20
|
+
version: 1.3.10
|
|
21
|
+
typescript:
|
|
22
|
+
specifier: ^5.9.3
|
|
23
|
+
version: 5.9.3
|
|
24
|
+
|
|
25
|
+
packages:
|
|
26
|
+
|
|
27
|
+
'@opencode-ai/plugin@1.2.22':
|
|
28
|
+
resolution: {integrity: sha512-vKVHymAGspLDBuObiJNSoCAQR+l6aMx6n21mgwNBa0BY4n0uzdJcM1rAN/Ksv/t6rsswMcsNeH0yMmj9Iokf7Q==}
|
|
29
|
+
|
|
30
|
+
'@opencode-ai/sdk@1.2.22':
|
|
31
|
+
resolution: {integrity: sha512-EXI1+Rc9dkzKo9uDj0EA4pLUCQJS2Qi8/xKwsT6RNZPBpSau05HVPWlZ+t8WyLW4fWymiho8jsXSErfKOpyCsw==}
|
|
32
|
+
|
|
33
|
+
'@types/node@25.3.5':
|
|
34
|
+
resolution: {integrity: sha512-oX8xrhvpiyRCQkG1MFchB09f+cXftgIXb3a7UUa4Y3wpmZPw5tyZGTLWhlESOLq1Rq6oDlc8npVU2/9xiCuXMA==}
|
|
35
|
+
|
|
36
|
+
bun-types@1.3.10:
|
|
37
|
+
resolution: {integrity: sha512-tcpfCCl6XWo6nCVnpcVrxQ+9AYN1iqMIzgrSKYMB/fjLtV2eyAVEg7AxQJuCq/26R6HpKWykQXuSOq/21RYcbg==}
|
|
38
|
+
|
|
39
|
+
typescript@5.9.3:
|
|
40
|
+
resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==}
|
|
41
|
+
engines: {node: '>=14.17'}
|
|
42
|
+
hasBin: true
|
|
43
|
+
|
|
44
|
+
undici-types@7.18.2:
|
|
45
|
+
resolution: {integrity: sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==}
|
|
46
|
+
|
|
47
|
+
zod@4.1.8:
|
|
48
|
+
resolution: {integrity: sha512-5R1P+WwQqmmMIEACyzSvo4JXHY5WiAFHRMg+zBZKgKS+Q1viRa0C1hmUKtHltoIFKtIdki3pRxkmpP74jnNYHQ==}
|
|
49
|
+
|
|
50
|
+
snapshots:
|
|
51
|
+
|
|
52
|
+
'@opencode-ai/plugin@1.2.22':
|
|
53
|
+
dependencies:
|
|
54
|
+
'@opencode-ai/sdk': 1.2.22
|
|
55
|
+
zod: 4.1.8
|
|
56
|
+
|
|
57
|
+
'@opencode-ai/sdk@1.2.22': {}
|
|
58
|
+
|
|
59
|
+
'@types/node@25.3.5':
|
|
60
|
+
dependencies:
|
|
61
|
+
undici-types: 7.18.2
|
|
62
|
+
|
|
63
|
+
bun-types@1.3.10:
|
|
64
|
+
dependencies:
|
|
65
|
+
'@types/node': 25.3.5
|
|
66
|
+
|
|
67
|
+
typescript@5.9.3: {}
|
|
68
|
+
|
|
69
|
+
undici-types@7.18.2: {}
|
|
70
|
+
|
|
71
|
+
zod@4.1.8: {}
|
|
@@ -13,7 +13,7 @@ dependencies: []
|
|
|
13
13
|
|
|
14
14
|
## When to Use
|
|
15
15
|
|
|
16
|
-
- Context is growing large and needs
|
|
16
|
+
- Context is growing large and needs compression/cleanup to continue.
|
|
17
17
|
|
|
18
18
|
## When NOT to Use
|
|
19
19
|
|
|
@@ -33,8 +33,8 @@ Long-running sessions accumulate context (tool outputs, code reads, exploration
|
|
|
33
33
|
| Context Usage | Status | Action |
|
|
34
34
|
| ------------- | ----------- | --------------------------------------------- |
|
|
35
35
|
| 0-50% | 🟢 Normal | Work freely |
|
|
36
|
-
| 50-70% | 🟡 Watch | Start
|
|
37
|
-
| 70-85% | 🟠 Compact | Actively compress
|
|
36
|
+
| 50-70% | 🟡 Watch | Start compressing completed explorations |
|
|
37
|
+
| 70-85% | 🟠 Compact | Actively compress and sweep stale noise |
|
|
38
38
|
| 85-95% | 🔴 Critical | Emergency compaction, prepare session handoff |
|
|
39
39
|
| 95%+ | ⛔ Limit | Session handoff required |
|
|
40
40
|
|
|
@@ -42,31 +42,17 @@ Long-running sessions accumulate context (tool outputs, code reads, exploration
|
|
|
42
42
|
|
|
43
43
|
Pay attention to these signals:
|
|
44
44
|
|
|
45
|
-
-
|
|
45
|
+
- Completed phases accumulating without being compressed
|
|
46
46
|
- Repeated file reads of the same content
|
|
47
47
|
- Large bash outputs from builds/tests
|
|
48
48
|
- Multiple exploration rounds without synthesis
|
|
49
49
|
|
|
50
50
|
## Compaction Strategies
|
|
51
51
|
|
|
52
|
-
### Strategy 1:
|
|
52
|
+
### Strategy 1: Phase Compression (Preferred)
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
Compress completed conversation phases into dense summaries. This is the primary DCP instrument in the installed beta.
|
|
55
55
|
|
|
56
|
-
```
|
|
57
|
-
WHEN: You've read a file and extracted what you need
|
|
58
|
-
DO: distill({ targets: [{ id: "X", distillation: "..." }] })
|
|
59
|
-
|
|
60
|
-
WHEN: Bash output gave you the answer you needed
|
|
61
|
-
DO: distill({ targets: [{ id: "Y", distillation: "..." }] })
|
|
62
|
-
|
|
63
|
-
WHEN: Search results identified the relevant files
|
|
64
|
-
DO: distill({ targets: [{ id: "Z", distillation: "..." }] })
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
**Key principle**: Distill when you're DONE with the raw output, not while you still need it.
|
|
68
|
-
|
|
69
|
-
### Strategy 2: Phase Compression
|
|
70
56
|
|
|
71
57
|
Compress completed conversation phases into dense summaries.
|
|
72
58
|
|
|
@@ -84,21 +70,18 @@ DO: compress({
|
|
|
84
70
|
|
|
85
71
|
**Key principle**: Only compress CLOSED chapters. Never compress active work.
|
|
86
72
|
|
|
87
|
-
### Strategy
|
|
73
|
+
### Strategy 2: Sweep Stale Noise
|
|
88
74
|
|
|
89
|
-
|
|
75
|
+
Use `/dcp sweep` after a phase is complete to remove stale/noisy content automatically.
|
|
90
76
|
|
|
91
77
|
```
|
|
92
|
-
WHEN:
|
|
93
|
-
DO:
|
|
94
|
-
|
|
95
|
-
WHEN: Earlier output is superseded by newer data
|
|
96
|
-
DO: prune({ ids: ["old_id"] })
|
|
78
|
+
WHEN: Wrong-target searches or superseded outputs are no longer needed
|
|
79
|
+
DO: /dcp sweep
|
|
97
80
|
```
|
|
98
81
|
|
|
99
|
-
**Key principle**:
|
|
82
|
+
**Key principle**: Sweep only after the relevant phase is closed. If in doubt, keep it.
|
|
100
83
|
|
|
101
|
-
### Strategy
|
|
84
|
+
### Strategy 3: Session Handoff
|
|
102
85
|
|
|
103
86
|
When context is too large to compact further, hand off to a new session.
|
|
104
87
|
|
|
@@ -117,9 +100,8 @@ DO:
|
|
|
117
100
|
Is context growing large?
|
|
118
101
|
├── NO → Continue working normally
|
|
119
102
|
└── YES → What type of content is consuming space?
|
|
120
|
-
├── Tool outputs I'm done with → DISTILL
|
|
121
103
|
├── Completed conversation phases → COMPRESS
|
|
122
|
-
├──
|
|
104
|
+
├── Stale/noisy closed-phase outputs → SWEEP
|
|
123
105
|
└── Everything is still relevant → SESSION HANDOFF
|
|
124
106
|
```
|
|
125
107
|
|
|
@@ -275,9 +257,8 @@ memory - search({ query: "auth implementation" });
|
|
|
275
257
|
|
|
276
258
|
This project uses `@tarquinen/opencode-dcp` for always-on context management (injected via `experimental.chat.system.transform`):
|
|
277
259
|
|
|
278
|
-
- **
|
|
279
|
-
-
|
|
280
|
-
- **prune**: Targeted removal of noise (last resort — batch wisely)
|
|
260
|
+
- **compress**: Phase-level conversation compression (primary DCP tool in the installed beta)
|
|
261
|
+
- **/dcp sweep**: Cleanup command for stale/noisy content after a phase is complete
|
|
281
262
|
- **Prunable-tools list**: Auto-injected into messages with token estimates
|
|
282
263
|
- **Nudge system**: Reminders every N tool calls + critical limit warnings
|
|
283
264
|
|
|
@@ -298,15 +279,6 @@ edit({ ... }) // Now you can't find the right location
|
|
|
298
279
|
|
|
299
280
|
**Fix**: Keep raw content while actively editing. Compress AFTER the edit phase.
|
|
300
281
|
|
|
301
|
-
### ❌ Lossy Distillation
|
|
302
|
-
|
|
303
|
-
```
|
|
304
|
-
// DON'T distill without capturing key details
|
|
305
|
-
distill({ distillation: "Read the auth file, it has some functions" })
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
**Fix**: Include function signatures, types, key logic, constraints — everything you'd need to avoid re-reading.
|
|
309
|
-
|
|
310
282
|
### ❌ Compressing Active Work
|
|
311
283
|
|
|
312
284
|
```
|
|
@@ -324,23 +296,22 @@ compress({ summary: "Explored auth options" })
|
|
|
324
296
|
// By the time you notice, emergency compaction loses information
|
|
325
297
|
```
|
|
326
298
|
|
|
327
|
-
**Fix**: Monitor regularly.
|
|
299
|
+
**Fix**: Monitor regularly. Compress at natural breakpoints and use `/dcp sweep` after closed phases.
|
|
328
300
|
|
|
329
301
|
## Checklist
|
|
330
302
|
|
|
331
303
|
Before compacting:
|
|
332
304
|
|
|
333
305
|
- [ ] Identified what type of content is consuming context
|
|
334
|
-
- [ ] Chosen appropriate strategy (
|
|
306
|
+
- [ ] Chosen appropriate strategy (compress/sweep/handoff)
|
|
335
307
|
- [ ] Verified raw content is no longer needed for active work
|
|
336
|
-
- [ ] Captured all key details in
|
|
308
|
+
- [ ] Captured all key details in the compression summary or handoff
|
|
337
309
|
- [ ] Saved important decisions as observations
|
|
338
310
|
- [ ] Created handoff document if switching sessions
|
|
339
311
|
|
|
340
312
|
During long sessions:
|
|
341
313
|
|
|
342
|
-
- [ ] Distilling tool outputs after extracting insights
|
|
343
314
|
- [ ] Compressing completed phases at natural breakpoints
|
|
344
|
-
- [ ]
|
|
315
|
+
- [ ] Sweeping stale/noisy outputs after phase completion
|
|
345
316
|
- [ ] Monitoring context usage trends
|
|
346
317
|
- [ ] Planning session handoff if approaching limits
|
|
@@ -62,7 +62,7 @@ Extend it by:
|
|
|
62
62
|
| Reading entire files | Use `lsp documentSymbol` for outline |
|
|
63
63
|
| Loading whole documents | Read specific line ranges |
|
|
64
64
|
| Flat file loading | Navigate AGENTS.md hierarchy |
|
|
65
|
-
| Keeping completed work |
|
|
65
|
+
| Keeping completed work | Compress closed phases, sweep stale noise (context-management) |
|
|
66
66
|
|
|
67
67
|
## Anti-Patterns
|
|
68
68
|
|
|
@@ -29,14 +29,14 @@ Use this skill to keep context useful from first turn to final handoff.
|
|
|
29
29
|
Prefer **phase-level compression** over reactive cleanup.
|
|
30
30
|
|
|
31
31
|
```text
|
|
32
|
-
compress >
|
|
32
|
+
compress > sweep > handoff
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
- **compress**: Best default when a phase is complete
|
|
36
|
-
- **
|
|
37
|
-
- **
|
|
36
|
+
- **sweep**: Use `/dcp sweep` to clean stale/noisy content after completion
|
|
37
|
+
- **handoff**: Use when context pressure remains high even after compression
|
|
38
38
|
|
|
39
|
-
## DCP
|
|
39
|
+
## DCP Command Usage
|
|
40
40
|
|
|
41
41
|
### `/dcp compress`
|
|
42
42
|
|
|
@@ -46,26 +46,17 @@ Use for completed chapters of work (research, implementation wave, review sweep)
|
|
|
46
46
|
- Lowest cognitive overhead on later turns
|
|
47
47
|
- Usually lowest risk of deleting needed details
|
|
48
48
|
|
|
49
|
-
### `/dcp
|
|
49
|
+
### `/dcp sweep`
|
|
50
50
|
|
|
51
|
-
Use
|
|
51
|
+
Use after a phase is complete to let DCP remove stale/noisy content automatically.
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
- function signatures
|
|
56
|
-
- constraints and assumptions
|
|
57
|
-
- file paths and key decisions
|
|
58
|
-
- verification outcomes
|
|
59
|
-
|
|
60
|
-
### `/dcp prune`
|
|
61
|
-
|
|
62
|
-
Use only for irrelevant/noise outputs:
|
|
53
|
+
Good candidates for sweep-driven cleanup:
|
|
63
54
|
|
|
64
55
|
- wrong-target searches
|
|
65
56
|
- failed dead-end exploration no longer needed
|
|
66
57
|
- duplicate or superseded junk output
|
|
67
58
|
|
|
68
|
-
Do **not**
|
|
59
|
+
Do **not** sweep because output is merely "long". Length alone is not noise.
|
|
69
60
|
|
|
70
61
|
## Session Lifecycle Protocol
|
|
71
62
|
|
|
@@ -82,7 +73,7 @@ Do **not** prune because output is "long". Length alone is not noise.
|
|
|
82
73
|
|
|
83
74
|
- Keep active files readable until edits are done
|
|
84
75
|
- At each natural boundary, evaluate compress candidates
|
|
85
|
-
-
|
|
76
|
+
- Compress completed phases before starting the next chapter
|
|
86
77
|
|
|
87
78
|
### 3) Pre-Handoff / Closeout
|
|
88
79
|
|
|
@@ -104,7 +95,7 @@ Use these thresholds as operational triggers:
|
|
|
104
95
|
| --- | --- | --- |
|
|
105
96
|
| <50k | Healthy start | Keep inputs minimal, avoid unnecessary reads |
|
|
106
97
|
| 50k–100k | Moderate growth | Compress completed phases, keep active files intact |
|
|
107
|
-
| >100k | High pressure | Aggressively compress by phase;
|
|
98
|
+
| >100k | High pressure | Aggressively compress by phase; run `/dcp sweep` on stale noise |
|
|
108
99
|
| >150k | Near capacity | Perform handoff and resume in a fresh session |
|
|
109
100
|
|
|
110
101
|
Secondary guardrails:
|
|
@@ -140,7 +131,7 @@ Carry forward decisions and constraints, not every intermediate log.
|
|
|
140
131
|
| Anti-Pattern | Why It Hurts | Correct Pattern |
|
|
141
132
|
| --- | --- | --- |
|
|
142
133
|
| Compressing active work areas (losing precision needed for edits) | Removes exact lines needed for safe edits | Keep active file/tool outputs until edit + verification complete |
|
|
143
|
-
|
|
|
134
|
+
| Sweeping content you still need | Forces rework and increases error risk | Keep active files/tool outputs until phase is complete |
|
|
144
135
|
| Not compressing completed exploration phases | Bloats context and degrades later turns | Compress immediately at phase completion |
|
|
145
136
|
| Session handoff without persisting key decisions to memory | Next session loses rationale and constraints | Write observations/memory updates before handoff |
|
|
146
137
|
|
|
@@ -151,7 +142,7 @@ Check context health: are completed phases compressed? Are active files still re
|
|
|
151
142
|
Before claiming cleanup done, confirm:
|
|
152
143
|
|
|
153
144
|
- Active edit targets are still present in readable form
|
|
154
|
-
- Completed phases are compressed
|
|
145
|
+
- Completed phases are compressed or intentionally kept for active work
|
|
155
146
|
- No critical decision exists only in transient tool output
|
|
156
147
|
- Handoff includes next actions and blockers
|
|
157
148
|
|
|
@@ -160,11 +151,10 @@ Before claiming cleanup done, confirm:
|
|
|
160
151
|
```text
|
|
161
152
|
1) Start turn: /dcp context
|
|
162
153
|
2) Identify completed phase ranges
|
|
163
|
-
3) compress completed ranges
|
|
164
|
-
4)
|
|
165
|
-
5)
|
|
166
|
-
6)
|
|
167
|
-
7) handoff/resume with focused rehydration
|
|
154
|
+
3) /dcp compress completed ranges
|
|
155
|
+
4) /dcp sweep stale/noisy outputs after phase completion
|
|
156
|
+
5) persist key decisions to memory
|
|
157
|
+
6) handoff/resume with focused rehydration
|
|
168
158
|
```
|
|
169
159
|
|
|
170
160
|
## See Also
|