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: lib/prompts/compress.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,24 +5,24 @@ THE PHILOSOPHY OF COMPRESS
5
5
6
6
Think of compression as phase transitions: raw exploration becomes refined understanding. The original context served its purpose; your summary now carries that understanding forward.
7
7
8
-
One method, many scales:
8
+
One method, many safe ranges:
9
9
10
-
-micro-range compression for disposable noise
11
-
-focused compression for closed investigative slices
12
-
-chapter compression for completed implementation phases
10
+
-short, closed ranges for disposable noise
11
+
-short, closed ranges for resolved investigative slices
12
+
-short, closed ranges for completed implementation chunks
13
13
14
-
Default to micro and focused/meso ranges. Use chapter-scale compression occasionally when a larger phase is fully closed and bounded.
14
+
Default to multiple short, bounded compressions. Prefer several safe range compressions over one large sweep whenever independent ranges are available.
15
15
16
16
CADENCE, SIGNALS, AND LATENCY
17
17
Use `compress` during work whenever a slice is summary-safe; do not wait for the user to send another message.
18
18
19
19
Treat token counts and context growth as soft signals, not hard triggers:
20
20
21
21
- no fixed threshold forces compression
22
-
-a closed slice around ~20k tokens can be totally reasonable to compress
22
+
-prioritize closedness and independence over raw range size
23
23
- qualitative signals still matter most (stale exploration, noisy tool bursts, resolved branches)
24
24
25
-
Prefer smaller, regular compressions over infrequent massive compressions for better latency and better summary fidelity.
25
+
PREFER smaller, regular compressions OVER infrequent large compressions for better latency and better summary fidelity.
26
26
27
27
THE SUMMARY
28
28
Your summary must be EXHAUSTIVE. Capture file paths, function signatures, decisions made, constraints discovered, key findings... EVERYTHING that maintains context integrity. This is not a brief note - it is an authoritative record so faithful that the original conversation adds no value.
@@ -88,7 +88,7 @@ CRITICAL: AVOID USING TOOL INPUT VALUES
88
88
NEVER use tool input schema keys or field names as boundary strings (e.g., "startString", "endString", "filePath", "content"). These may be transformed by the AI SDK and are not reliable. The ONLY acceptable use of tool input strings is a SINGLE concrete field VALUE (not the key), and even then, prefer using assistant text, user messages, or tool result outputs instead. When in doubt, choose boundaries from your own assistant responses or distinctive user message content.
89
89
90
90
PARALLEL COMPRESS EXECUTION
91
-
When multiple independent ranges are ready and their boundaries do not overlap, launch MULTIPLE `compress` calls in parallel in a single response. Run compression sequentially only when ranges overlap or when a later range depends on the result of an earlier compression.
91
+
When multiple independent ranges are ready and their boundaries do not overlap, launch MULTIPLE `compress` calls in parallel in a single response. This is the PREFERRED pattern over a single large-range compression when the work can be safely split. Run compression sequentially only when ranges overlap or when a later range depends on the result of an earlier compression.
Copy file name to clipboardExpand all lines: lib/prompts/nudge.md
+4-6Lines changed: 4 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,12 +24,10 @@ DOOOOO IT!!!
24
24
25
25
Avoid unnecessary context build-up with targeted uses of the `compress` tool. Start with low hanging fruits and clearly identified ranges that can be compressed with minimal risk of losing critical information. Look BACK on the conversation history and avoid compressing the newest ranges until you have exhausted older ones
26
26
27
-
SCALE PRIORITY (MANDATORY)
28
-
Use MICRO first.
29
-
Escalate to MESO when MICRO is insufficient.
30
-
Use MACRO only as a last resort when a larger chapter is truly closed and bounded.
31
-
Do not jump directly to MACRO when independent MICRO/MESO ranges are available.
32
-
When multiple independent stale ranges are ready, batch MICRO/MESO compressions in parallel.
27
+
RANGE STRATEGY (MANDATORY)
28
+
Prefer multiple short, closed range compressions.
29
+
When multiple independent stale ranges are ready, batch those short compressions in parallel.
30
+
Do not jump to a single broad range when the same cleanup can be done safely with several bounded ranges.
33
31
34
32
If you are performing a critical atomic operation, do not interrupt it, but make sure to perform context management rapidly
Copy file name to clipboardExpand all lines: lib/prompts/system.md
+5-8Lines changed: 5 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,21 +5,18 @@ You operate in a context-constrained environment. Manage context continuously to
5
5
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.
6
6
7
7
OPERATING STANCE
8
-
Compression can operate at various scales. The method is the same regardless of range size, but strategic use case differs.
8
+
Prefer short, closed, summary-safe ranges.
9
+
When multiple independent stale ranges exist, prefer several short compressions (in parallel when possible) over one large-range compression.
9
10
10
-
You will default to micro and meso compressions
11
-
12
-
MICRO: ideal for low-latency operations, should aim to compress a range of AT LEAST 5000 tokens to justify the tool call.
13
-
MESO: good to filter signal from noise of heavy tool outputs or decluttering the session from closed/resolved investigation paths, aim for AT LEAST 10000 tokens
14
-
MACRO: more occasional, for truly closed chapters when smaller ranges are not sufficient, aim for 20000+ tokens
11
+
NEVER COMPRESS MORE THAN 20000 TOKENS IN A SINGLE COMPRESS CALL - if you identify a larger stale range, split it into multiple compressions with non-overlapping boundaries.
15
12
16
13
Use `compress` as steady housekeeping while you work.
17
14
18
15
CADENCE, SIGNALS, AND LATENCY
19
16
Treat token counts and context growth as soft signals, not hard triggers.
20
17
21
18
- No fixed threshold mandates compression
22
-
-A closed context slice around ~20k tokens can be reasonable to compress
19
+
-Prioritize closedness and independence over raw range size
23
20
- Prefer smaller, regular compressions over infrequent massive compressions for better latency and summary quality
24
21
- When multiple independent stale ranges are ready, batch compressions in parallel
25
22
@@ -46,7 +43,7 @@ DO NOT COMPRESS IF
46
43
- the task in the target range is still actively in progress
47
44
- you cannot identify reliable boundaries yet
48
45
49
-
Evaluate conversation signal-to-noise regularly. Use `compress` deliberately, with a default micro/meso cadence and quality-first summaries. Priorotize ranges intelligently to maintain a high-signal context window that supports your agency
46
+
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
50
47
51
48
It is of your responsibility to keep a sharp, high-quality context window for optimal performance
0 commit comments