You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-17Lines changed: 22 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,9 +28,14 @@ DCP reduces context size through a compress tool and automatic cleanup. Your ses
28
28
29
29
### Compress
30
30
31
-
Compress is a tool exposed to your model that selects a conversation range and replaces it with a technical summary. You can think of this as a much smarter version of Opencode's compaction process. Instead of triggering statically when your session reaches its maximum context and on the entire coding session, Compress allows the model to pick when to activate based on task completion, and to only compress a subset of messages containing the completed task. This allows the summaries replacing the session content to be much more focused and precise than Opencode's native compaction.
31
+
Compress is a tool exposed to your model that replaces closed, stale conversation content with high-fidelity technical summaries. You can think of this as a much smarter version of Opencode's compaction process. Instead of triggering statically when your session reaches its maximum context and on the entire coding session, Compress allows the model to pick when to activate based on task completion, and to only compress the specific messages that are no longer needed verbatim.
32
32
33
-
When a new compression overlaps an earlier one, the earlier summary is nested inside the new one — so information is preserved through layers of compression rather than diluted away. Additionally, protected tool outputs (such as subagents and skills) and protected file patterns are always kept in compression summaries, ensuring that the most important information is never lost. You can also enable `protectUserMessages` to preserve your messages verbatim during compression, though note that large prompts (e.g. copy-pasting log files in the prompt) will then never be compressed away.
33
+
DCP supports two compression modes:
34
+
35
+
-`range` mode compresses contiguous spans of conversation into one or more summaries.
36
+
-`message` mode (experimental) compresses individual raw messages independently, letting the model manage context much more surgically.
37
+
38
+
In `range` mode, when a new compression overlaps an earlier one, the earlier summary is nested inside the new one so information is preserved through layers of compression rather than diluted away. In both modes, protected tool outputs (such as subagents and skills) and protected file patterns are kept in compression summaries, ensuring that the most important information is never lost. You can also enable `protectUserMessages` to preserve your messages verbatim during compression, though note that large prompts (e.g. copy-pasting log files in the prompt) will then never be compressed away.
34
39
35
40
### Deduplication
36
41
@@ -50,6 +55,9 @@ DCP uses its own config file, searched in order:
50
55
51
56
Each level overrides the previous, so project settings take priority over global. Restart OpenCode after making config changes.
52
57
58
+
> [!NOTE]
59
+
> If you use models with smaller context windows, such as GitHub Copilot models or local models, lower `compress.minContextLimit` and `compress.maxContextLimit` in your configuration to match the available context.
60
+
53
61
> [!IMPORTANT]
54
62
> Defaults are applied automatically. Expand this if you want to review or override settings.
55
63
@@ -99,14 +107,19 @@ Each level overrides the previous, so project settings take priority over global
99
107
"protectedFilePatterns": [],
100
108
// Unified context compression tool and behavior settings
101
109
"compress": {
110
+
// Compression mode: "range" (compress spans into block summaries)
111
+
// or experimental "message" (compress individual raw messages)
112
+
"mode":"range",
102
113
// Permission mode: "allow" (no prompt), "ask" (prompt), "deny" (tool not registered)
103
114
"permission":"allow",
104
115
// Show compression content in a chat notification
105
116
"showCompression":false,
117
+
// Let active summary tokens extend the effective maxContextLimit
// compression nudges (based on nudgeFrequency), so compression is
108
121
// much more likely. Accepts: number or "X%" of model context window.
109
-
"maxContextLimit":150000,
122
+
"maxContextLimit":100000,
110
123
// Soft lower threshold for reminder nudges: below this, turn/iteration
111
124
// reminders are off (compression less likely). At/above this, reminders
112
125
// are on. Accepts: number or "X%" of model context window.
@@ -133,8 +146,6 @@ Each level overrides the previous, so project settings take priority over global
133
146
// Controls how likely compression is after user messages
134
147
// ("strong" = more likely, "soft" = less likely)
135
148
"nudgeForce":"soft",
136
-
// Flat tool schema: improves tool call reliability but uglier in the TUI
137
-
"flatSchema":false,
138
149
// Tool names whose completed outputs are appended to the compression
139
150
"protectedTools": [],
140
151
// Preserve your messages during compression.
@@ -149,10 +160,6 @@ Each level overrides the previous, so project settings take priority over global
149
160
// Additional tools to protect from pruning
150
161
"protectedTools": [],
151
162
},
152
-
// Prune write tool inputs when the file has been subsequently read
153
-
"supersedeWrites": {
154
-
"enabled":true,
155
-
},
156
163
// Prune tool inputs for errored tools after X turns
157
164
"purgeErrors": {
158
165
"enabled":true,
@@ -176,16 +183,17 @@ DCP provides a `/dcp` slash command:
176
183
-`/dcp stats` — Shows cumulative pruning statistics across all sessions.
177
184
-`/dcp sweep` — Prunes all tools since the last user message. Accepts an optional count: `/dcp sweep 10` prunes the last 10 tools. Respects `commands.protectedTools`.
178
185
-`/dcp manual [on|off]` — Toggle manual mode or set explicit state. When on, the AI will not autonomously use context management tools.
179
-
-`/dcp compress [focus]` — Trigger a single compress tool execution. Optional focus text directs what range to compress.
186
+
-`/dcp compress [focus]` — Trigger a single compress tool execution. Optional focus text directs what content to compress, following the active `compress.mode`.
180
187
-`/dcp decompress <n>` — Restore a specific active compression by ID (for example `/dcp decompress 2`). Running without an argument shows available compression IDs, token sizes, and topics.
181
188
-`/dcp recompress <n>` — Re-apply a user-decompressed compression by ID (for example `/dcp recompress 2`). Running without an argument shows recompressible IDs, token sizes, and topics.
182
189
183
190
### Prompt Overrides
184
191
185
-
DCP exposes five editable prompts:
192
+
DCP exposes six editable prompts:
186
193
187
194
-`system`
188
-
-`compress`
195
+
-`compress-range`
196
+
-`compress-message`
189
197
-`context-limit-nudge`
190
198
-`turn-nudge`
191
199
-`iteration-nudge`
@@ -198,17 +206,14 @@ To customize behavior, add a file with the same name under an overrides director
198
206
199
207
To reset an override, delete the matching file from your overrides directory.
200
208
201
-
> [!NOTE]
202
-
> `compress` prompt changes apply after plugin restart because tool descriptions are registered at startup.
203
-
204
209
### Protected Tools
205
210
206
211
By default, these tools are always protected from pruning:
The `protectedTools` arrays in `commands` and `strategies` add to this default list.
210
215
211
-
For the `compress` tool, `compress.protectedTools` ensures specific tool outputs are appended to the compressed summary. It defaults to an empty array `[]` but always inherently protects`task`, `skill`, `todowrite`, and `todoread`.
216
+
For the `compress` tool, `compress.protectedTools` ensures specific tool outputs are appended to the compressed summary. By default it includes`task`, `skill`, `todowrite`, and `todoread`.
"description": "Configuration for the unified compress tool",
129
129
"additionalProperties": false,
130
130
"properties": {
131
+
"mode": {
132
+
"type": "string",
133
+
"enum": ["range", "message"],
134
+
"default": "range",
135
+
"description": "Compression mode. 'range' compresses spans into block summaries, 'message' compresses individual raw messages."
136
+
},
131
137
"permission": {
132
138
"type": "string",
133
139
"enum": ["ask", "allow", "deny"],
@@ -139,9 +145,14 @@
139
145
"default": false,
140
146
"description": "Show compression summaries in notifications"
141
147
},
148
+
"summaryBuffer": {
149
+
"type": "boolean",
150
+
"default": true,
151
+
"description": "When enabled, active summary tokens extend the effective maxContextLimit used for context-limit nudges."
152
+
},
142
153
"maxContextLimit": {
143
154
"description": "Soft upper threshold. Above this, DCP keeps sending strong compression nudges (based on nudgeFrequency), so the model is pushed to compress. Accepts number or \"X%\" of the model context window.",
144
-
"default": 150000,
155
+
"default": 100000,
145
156
"oneOf": [
146
157
{
147
158
"type": "number"
@@ -213,11 +224,6 @@
213
224
"default": "soft",
214
225
"description": "Controls how likely compression is after user messages. 'strong' is more likely, 'soft' is less likely."
215
226
},
216
-
"flatSchema": {
217
-
"type": "boolean",
218
-
"default": false,
219
-
"description": "When true, the compress tool schema uses 4 flat string parameters (topic, startId, endId, summary) instead of the nested content object. This simplifies tool calls but changes TUI display."
220
-
},
221
227
"protectedTools": {
222
228
"type": "array",
223
229
"items": {
@@ -231,6 +237,19 @@
231
237
"default": false,
232
238
"description": "When enabled, your messages are never lost during compression"
233
239
}
240
+
},
241
+
"default": {
242
+
"mode": "range",
243
+
"permission": "allow",
244
+
"showCompression": false,
245
+
"summaryBuffer": true,
246
+
"maxContextLimit": 100000,
247
+
"minContextLimit": 50000,
248
+
"nudgeFrequency": 5,
249
+
"iterationNudgeThreshold": 15,
250
+
"nudgeForce": "soft",
251
+
"protectedTools": [],
252
+
"protectUserMessages": false
234
253
}
235
254
},
236
255
"strategies": {
@@ -258,18 +277,6 @@
258
277
}
259
278
}
260
279
},
261
-
"supersedeWrites": {
262
-
"type": "object",
263
-
"description": "Replace older write/edit outputs when new ones target the same file",
264
-
"additionalProperties": false,
265
-
"properties": {
266
-
"enabled": {
267
-
"type": "boolean",
268
-
"default": true,
269
-
"description": "Enable supersede writes strategy"
270
-
}
271
-
}
272
-
},
273
280
"purgeErrors": {
274
281
"type": "object",
275
282
"description": "Remove tool outputs that resulted in errors",
0 commit comments