Skip to content

Commit 3c9ce68

Browse files
committed
docs: simplify and align compress/system ID guidance
1 parent 362352d commit 3c9ce68

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

lib/prompts/compress.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,21 @@ Directly quote user messages when they are short enough to include safely. Direc
3434
COMPRESSED BLOCK PLACEHOLDERS
3535
When the selected range includes previously compressed blocks, use this exact placeholder format when referencing one:
3636

37-
- `{block_N}`
37+
- `(bN)`
38+
39+
Compressed block sections in context are clearly marked with a header:
40+
41+
- `[Compressed conversation section]`
42+
43+
Compressed block IDs always use the `bN` form (never `mNNNN`) and are represented in the same XML metadata tag format.
3844

3945
Rules:
4046

4147
- Include every required block placeholder exactly once.
4248
- Do not invent placeholders for blocks outside the selected range.
43-
- Treat `{block_N}` placeholders as RESERVED TOKENS. Do not emit `{block_N}` text anywhere except intentional placeholders.
44-
- If you need to mention a block in prose, use plain text like `compressed bN` (without curly braces).
45-
- Preflight check before finalizing: the set of `{block_N}` placeholders in your summary must exactly match the required set, with no duplicates.
49+
- Treat `(bN)` placeholders as RESERVED TOKENS. Do not emit `(bN)` text anywhere except intentional placeholders.
50+
- If you need to mention a block in prose, use plain text like `compressed bN` (not as a placeholder).
51+
- Preflight check before finalizing: the set of `(bN)` placeholders in your summary must exactly match the required set, with no duplicates.
4652

4753
These placeholders are semantic references. They will be replaced with the full stored compressed block content when the tool processes your output.
4854

@@ -51,7 +57,7 @@ When you use compressed block placeholders, write the surrounding summary text s
5157

5258
- Treat each placeholder as a stand-in for a full conversation segment, not as a short label.
5359
- Ensure transitions before and after each placeholder preserve chronology and causality.
54-
- Do not write text that depends on the placeholder staying literal (for example, "as noted in {block_2}").
60+
- Do not write text that depends on the placeholder staying literal (for example, "as noted in (b2)").
5561
- Your final meaning must be coherent once each placeholder is replaced with its full compressed block content.
5662

5763
Yet be LEAN. Strip away the noise: failed attempts that led nowhere, verbose tool outputs, back-and-forth exploration. What remains should be pure signal - golden nuggets of detail that preserve full understanding with zero ambiguity.
@@ -92,9 +98,7 @@ Rules:
9298

9399
ID SOURCES
94100

95-
- User messages include a text marker with their `mNNNN` ID.
96-
- Assistant messages usually include an XML metadata tag in the last tool output: `<dcp-message-id>mNNNN</dcp-message-id>`.
97-
- Assistant messages without tool outputs use a synthetic `context_info` marker instead.
101+
- There is always an ID available for each message in XML tags like `<dcp-message-id>...</dcp-message-id>`.
98102
- Compressed blocks are addressable by `bN` IDs.
99103

100104
Treat `<dcp-message-id>...</dcp-message-id>` as metadata only. It is not part of the tool result semantics.

lib/prompts/system.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Treat token counts and context growth as soft signals, not hard triggers.
2323
BOUNDARY MATCHING
2424
`compress` uses inclusive ID boundaries via `content.startId` and `content.endId`. IDs are injected in context as message refs (`mNNNN`) and compressed block refs (`bN`).
2525

26-
Assistant tool outputs may include metadata tags like `<dcp-message-id>mNNNN</dcp-message-id>`.
26+
Each message has an ID inside XML metadata tags like `<dcp-message-id>...</dcp-message-id>`.
2727
Treat these tags as boundary metadata only, not as tool result content.
2828

2929
Only choose IDs currently visible in context. Do not invent IDs.

0 commit comments

Comments
 (0)