Skip to content

Commit 68a094b

Browse files
committed
update(prompts): refine compress and nudge prompt wording
1 parent 074184e commit 68a094b

5 files changed

Lines changed: 7 additions & 37 deletions

File tree

lib/prompts/compress-message.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ When a selected message contains user intent, preserve that intent with extra ca
88
Directly quote short user instructions when that best preserves exact meaning.
99
1010
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.
11+
If a message contains no significant technical decisions, code changes, or user requirements, produce a minimal one-line summary rather than a detailed one.
1112
1213
MESSAGE IDS
1314
You specify individual raw messages by ID using the injected IDs visible in the conversation:
@@ -17,27 +18,18 @@ You specify individual raw messages by ID using the injected IDs visible in the
1718
Each message has an ID inside XML metadata tags like \`<dcp-message-id priority="high">m0007</dcp-message-id>\`.
1819
The ID tag appears at the end of the message it belongs to — each ID covers all the content above it back to the previous ID.
1920
Treat these tags as message metadata only, not as content to summarize. Use only the inner \`mNNNN\` value as the \`messageId\`.
20-
The \`priority\` attribute indicates relative context cost. Prefer higher-priority closed messages before lower-priority ones.
21+
The \`priority\` attribute indicates relative context cost. When using the compress tool, if there are high-priority messages they MUST be compressed if all of their information is not vital to the task at hand.
22+
If there are previous messages with compress tool results, these MUST be compressed with a minimal summary.
2123
Messages marked as \`<dcp-message-id>BLOCKED</dcp-message-id>\` cannot be compressed.
2224
2325
Rules:
2426
2527
- Pick each \`messageId\` directly from injected IDs visible in context.
2628
- Only use raw message IDs of the form \`mNNNN\`.
2729
- Ignore XML attributes such as \`priority\` when copying the ID; use only the inner \`mNNNN\` value.
28-
- Do NOT use compressed block IDs like \`bN\`.
2930
- Do not invent IDs. Use only IDs that are present in context.
30-
- Do not target prior compressed blocks or block summaries.
3131
3232
BATCHING
3333
Select MANY messages in a single tool call when they are independently safe to compress.
3434
Each entry should summarize exactly one message, and the tool can receive as many entries as needed in one batch.
35-
When several messages are equally safe to compress, prefer higher-priority messages first.
36-
37-
Because each message is compressed independently:
38-
39-
- Do not describe ranges
40-
- Do not use start/end boundaries
41-
- Do not use compressed block placeholders
42-
- Do not reference prior compressed blocks with \`(bN)\`
4335
`

lib/prompts/context-limit-nudge.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,12 @@ You MUST use the \`compress\` tool now. Do not continue normal exploration until
77
88
If you are in the middle of a critical atomic operation, finish that atomic step first, then compress immediately.
99
10-
RANGE STRATEGY (MANDATORY)
11-
Prioritize one large, closed, high-yield compression range first.
12-
This overrides the normal preference for many small compressions.
13-
Only split into multiple compressions if one large range would reduce summary quality or make boundary selection unsafe.
14-
15-
RANGE SELECTION
10+
SELECTION PROCESS
1611
Start from older, resolved history and capture as much stale context as safely possible in one pass.
17-
Avoid the newest active working slice unless it is clearly closed.
18-
Use visible injected boundary IDs for compression (\`mNNNN\` for messages, \`bN\` for compressed blocks), and ensure \`startId\` appears before \`endId\`.
12+
Avoid the newest active working messages unless it is clearly closed.
1913
2014
SUMMARY REQUIREMENTS
21-
Your summary must cover all essential details from the selected range so work can continue without reopening raw messages.
15+
Your summary MUST cover all essential details from the selected messages so work can continue.
2216
If the compressed range includes user messages, preserve user intent exactly. Prefer direct quotes for short user messages to avoid semantic drift.
2317
</dcp-system-reminder>
2418
`

lib/prompts/iteration-nudge.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@ export const ITERATION_NUDGE = `<dcp-system-reminder>
22
You've been iterating for a while after the last user message.
33
44
If there is a closed portion that is unlikely to be referenced immediately (for example, finished research before implementation), use the compress tool on it now.
5-
6-
Prefer multiple short, closed ranges over one large range when several independent slices are ready.
75
</dcp-system-reminder>
86
`

lib/prompts/system.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,6 @@ THE PHILOSOPHY OF COMPRESS
1010
1111
Think of compression as phase transitions: raw exploration becomes refined understanding. The original context served its purpose; your summary now carries that understanding forward.
1212
13-
OPERATING STANCE
14-
Prefer short, closed, summary-safe compressions.
15-
When multiple independent stale sections exist, prefer several focused compressions (in parallel when possible) over one broad compression.
16-
17-
Use \`compress\` as steady housekeeping while you work.
18-
19-
CADENCE, SIGNALS, AND LATENCY
20-
21-
- No fixed threshold mandates compression
22-
- Prioritize closedness and independence over raw size
23-
- Prefer smaller, regular compressions over infrequent massive compressions for better latency and summary quality
24-
- When multiple independent stale sections are ready, batch compressions in parallel
25-
2613
COMPRESS WHEN
2714
2815
A section is genuinely closed and the raw conversation has served its purpose:

lib/prompts/turn-nudge.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
export const TURN_NUDGE = `<dcp-system-reminder>
22
Evaluate the conversation for compressible ranges.
33
4-
If any range is cleanly closed and unlikely to be needed again, use the compress tool on it.
4+
If any messages are cleanly closed and unlikely to be needed again, use the compress tool on them.
55
If direction has shifted, compress earlier ranges that are now less relevant.
66
7-
Prefer small, closed-range compressions over one broad compression.
87
The goal is to filter noise and distill key information so context accumulation stays under control.
98
Keep active context uncompressed.
109
</dcp-system-reminder>

0 commit comments

Comments
 (0)