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
exportconstCOMPRESS_MESSAGE=`Collapse selected individual messages in the conversation into detailed summaries.
2
+
3
+
THE PHILOSOPHY OF MESSAGE COMPRESS
4
+
\`compress\` in message mode transforms specific stale messages into dense, high-fidelity summaries. This is not cleanup - it is crystallization. Your summary becomes the authoritative record of what each selected message contributed.
5
+
6
+
Think of compression as phase transitions: raw exploration becomes refined understanding. The original message served its purpose; your summary now carries that understanding forward.
7
+
8
+
THE SUMMARY
9
+
Your summary must be EXHAUSTIVE. Capture file paths, function signatures, decisions made, constraints discovered, key findings, tool outcomes, and user intent details that matter... EVERYTHING that preserves the value of the selected message after the raw message is removed.
10
+
11
+
USER INTENT FIDELITY
12
+
When a selected message contains user intent, preserve that intent with extra care. Do not change scope, constraints, priorities, acceptance criteria, or requested outcomes.
13
+
Directly quote short user instructions when that best preserves exact meaning.
14
+
15
+
Yet be LEAN. Strip away the noise: failed attempts that led nowhere, verbose tool output, and repetition. What remains should be pure signal - golden nuggets of detail that preserve full understanding with zero ambiguity.
16
+
17
+
MESSAGE IDS
18
+
You specify individual raw messages by ID using the injected IDs visible in the conversation:
19
+
20
+
- \`mNNNN\` IDs identify raw messages
21
+
22
+
Each message has an ID inside XML metadata tags like \`<dcp-message-id>...</dcp-message-id>\`.
23
+
Treat these tags as message metadata only, not as content to summarize.
24
+
25
+
Rules:
26
+
27
+
- Pick each \`messageId\` directly from injected IDs visible in context.
28
+
- Only use raw message IDs of the form \`mNNNN\`.
29
+
- Do NOT use compressed block IDs like \`bN\`.
30
+
- Do not invent IDs. Use only IDs that are present in context.
31
+
- Do not target prior compressed blocks or block summaries.
32
+
33
+
THE WAYS OF MESSAGE COMPRESS
34
+
Compress when an individual message is genuinely closed and unlikely to be needed verbatim again:
35
+
36
+
Research findings have already been absorbed into later work
37
+
Tool-heavy assistant updates are no longer needed in raw form
38
+
Earlier planning or analysis messages are now stale but still important to retain as summary
39
+
40
+
Do NOT compress when:
41
+
You may need the exact raw message text, code, or error output in the immediate next steps
42
+
The message is still actively being referenced or edited against
43
+
The target is a prior compressed block or block summary rather than a raw message
44
+
45
+
Before compressing, ask: _"Is this message closed enough to become summary-only right now?"_
46
+
47
+
BATCHING
48
+
Do not call the tool once per message. Select MANY messages in a single tool call when they are independently safe to compress.
49
+
Each entry should summarize exactly one message, and the tool can receive as many entries as needed in one batch.
50
+
51
+
THE FORMAT OF MESSAGE COMPRESS
52
+
53
+
~~~json
54
+
{
55
+
"topic": "overall batch label",
56
+
"content": [
57
+
{
58
+
"messageId": "m0001",
59
+
"topic": "short message label",
60
+
"summary": "Complete technical summary replacing that one message"
61
+
}
62
+
]
63
+
}
64
+
~~~
65
+
66
+
Because each message is compressed independently:
67
+
68
+
- Do not describe ranges
69
+
- Do not use start/end boundaries
70
+
- Do not use compressed block placeholders
71
+
- Do not reference prior compressed blocks with \`(bN)\`
Copy file name to clipboardExpand all lines: lib/prompts/compress-range.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
exportconstCOMPRESS=`Collapse a range in the conversation into a detailed summary.
1
+
exportconstCOMPRESS_RANGE=`Collapse a range in the conversation into a detailed summary.
2
2
3
3
THE PHILOSOPHY OF COMPRESS
4
4
\`compress\` transforms verbose conversation sequences into dense, high-fidelity summaries. This is not cleanup - it is crystallization. Your summary becomes the authoritative record of what transpired.
You operate in a context-constrained environment. Manage context continuously to avoid buildup and preserve retrieval quality. Efficient context management is paramount for your agentic performance.
3
3
4
-
The ONLY tool you have for context management is \`compress\`. It replaces a contiguous portion of the conversation (inclusive) with a technical summary you produce.
4
+
The ONLY tool you have for context management is \`compress\`. It replaces older conversation content with technical summaries you produce. Depending on the configured mode, it may compress closed ranges or selected individual messages.
5
5
6
6
\`<dcp-message-id>\` and \`<dcp-system-reminder>\` tags are environment-injected metadata. Do not output them.
7
7
8
8
OPERATING STANCE
9
-
Prefer short, closed, summary-safe ranges.
10
-
When multiple independent stale ranges exist, prefer several short compressions (in parallel when possible) over one large-range compression.
9
+
Prefer short, closed, summary-safe compressions.
10
+
When multiple independent stale sections exist, prefer several focused compressions (in parallel when possible) over one broad compression.
11
11
12
12
Use \`compress\` as steady housekeeping while you work.
13
13
14
14
CADENCE, SIGNALS, AND LATENCY
15
15
16
16
- No fixed threshold mandates compression
17
-
- Prioritize closedness and independence over raw range size
17
+
- Prioritize closedness and independence over raw size
18
18
- Prefer smaller, regular compressions over infrequent massive compressions for better latency and summary quality
19
-
- When multiple independent stale ranges are ready, batch compressions in parallel
19
+
- When multiple independent stale sections are ready, batch compressions in parallel
20
20
21
21
DO NOT COMPRESS IF
22
22
23
23
- raw context is still relevant and needed for edits or precise references
24
-
- the task in the target range is still actively in progress
24
+
- the target content is still actively in progress
25
25
26
-
Evaluate conversation signal-to-noise REGULARLY. Use \`compress\` deliberately with quality-first summaries. Prefer multiple short, independent range compressions before considering broader ranges, and prioritize ranges intelligently to maintain a high-signal context window that supports your agency
26
+
Evaluate conversation signal-to-noise REGULARLY. Use \`compress\` deliberately with quality-first summaries. Prefer multiple short, independent compressions before considering broader ones, and prioritize stale content intelligently to maintain a high-signal context window that supports your agency
27
27
28
28
It is of your responsibility to keep a sharp, high-quality context window for optimal performance
0 commit comments