Skip to content

Commit 15e4f17

Browse files
prompts
1 parent 8d21d58 commit 15e4f17

File tree

2 files changed

+40
-16
lines changed

2 files changed

+40
-16
lines changed

lib/prompts/compress.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,26 @@ One method, many scales:
1111
- focused compression for closed investigative slices
1212
- chapter compression for completed implementation phases
1313

14+
Default to micro and focused/meso ranges. Use chapter-scale compression occasionally when a larger phase is fully closed and bounded.
15+
16+
CADENCE, SIGNALS, AND LATENCY
17+
Use `compress` during work whenever a slice is summary-safe; do not wait for the user to send another message.
18+
19+
Treat token counts and context growth as soft signals, not hard triggers:
20+
21+
- no fixed threshold forces compression
22+
- a closed slice around ~20k tokens can be totally reasonable to compress
23+
- qualitative signals still matter most (stale exploration, noisy tool bursts, resolved branches)
24+
25+
Prefer smaller, regular compressions over infrequent massive compressions for better latency and better summary fidelity.
26+
1427
THE SUMMARY
1528
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.
1629

1730
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.
1831

1932
THE WAYS OF COMPRESS
20-
Compress when a chapter closes - when a phase of work is truly complete and the raw conversation has served its purpose:
33+
Compress when a range is genuinely closed and the raw conversation has served its purpose:
2134

2235
Research concluded and findings are clear
2336
Implementation finished and verified
@@ -33,10 +46,10 @@ You may need exact code, error messages, or file contents from the range in the
3346
Work in that area is still active or likely to resume immediately
3447
You cannot identify reliable boundaries yet
3548

36-
Before compressing, ask: _"Is this range closed enough to become summary-only?"_ Compression is irreversible. The summary replaces everything in the range.
49+
Before compressing, ask: _"Is this range closed enough to become summary-only right now?"_ Compression is irreversible. The summary replaces everything in the range.
3750

3851
BOUNDARY MATCHING
39-
You specify boundaries by matching unique text strings in the conversation. CRITICAL: In code-centric conversations, strings repeat often. Provide sufficiently unique text to match exactly once. If a match fails (not found or found multiple times), the tool will error - extend your boundary string with more surrounding context in order to make SURE the tool does NOT error.
52+
You specify boundaries by matching unique text strings in the conversation. CRITICAL: In code-centric conversations, strings repeat often. Provide sufficiently unique text to match exactly once. Be conservative and choose longer, highly specific boundaries when in doubt. If a match fails (not found or found multiple times), the tool will error - extend your boundary string with more surrounding context in order to make SURE the tool does NOT error.
4053

4154
WHERE TO PICK STRINGS FROM (important for reliable matching):
4255

lib/prompts/system.md

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,45 @@
11
<system-reminder>
22
<instruction name=compress_tool attention_level=high>
3-
You operate a context-constrained environment and MUST MANAGE IT to avoid bad context buildup and eventual leak. Efficient context management is paramount for your agentic performance, retrieval capacity and overall system health.
3+
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.
44

5-
The ONLY tool you have for context management is `compress` which squashes a contiguous portion of the conversation (inclusive) into a low-level technical summary you are to produce.
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.
66

7-
THE PHILOSOPHY BEHIND COMPRESSION
7+
OPERATING STANCE
88
Compression can operate at various scales. The method is the same regardless of range size, but strategic use case differs.
99

10+
You will default to micro and meso compressions
11+
1012
MICRO: ideal for low-latency noise disposal
1113
MESO: good to filter signal from noise of heavy tool outputs or decluttering the session from closed/resolved investigation paths
12-
MACRO: for completed phases, distilling entire chapters of conversation
14+
MACRO: more occasional, for truly closed chapters when smaller ranges are not sufficient
15+
16+
Use `compress` as steady housekeeping while you work.
1317

14-
A strategic and regular use of the `compress` tool is encouraged to maintain a focused context. Be proactive and deliberate in managing your context.
18+
CADENCE, SIGNALS, AND LATENCY
19+
Treat token counts and context growth as soft signals, not hard triggers.
20+
21+
- No fixed threshold mandates compression
22+
- A closed context slice around ~20k tokens can be reasonable to compress
23+
- Prefer smaller, regular compressions over infrequent massive compressions for better latency and summary quality
24+
- When multiple independent stale ranges are ready, batch compressions in parallel
1525

1626
BOUNDARY MATCHING
17-
`compress` uses inclusive string boundaries, matching a string at the start of a message or tool output will consume the entire item. You can use unique text from your own reasoning or text outputs, but be sure to provide more than enough surrounding context to ensure a unique match.
27+
`compress` uses inclusive string boundaries, matching a string at the start of a message or tool output will consume the entire item. Be conservative and precise: choose unique strings with enough surrounding context to avoid ambiguous matches or accidental range capture
1828

1929
THE SUMMARY STANDARD
2030
Your summary MUST be technical and specific enough to preserve FULL understanding of what transpired, such that NO ambiguity remains about what asked, found, planned, done, or decided - yet noise free
2131

22-
Preserve key details: file paths, symbols, signatures, constraints, decisions, outcomes... in order to produce a high fidelity, authoritative technical record
32+
Preserve key details: file paths, symbols, signatures, constraints, decisions, outcomes, commands, etc.. in order to produce a high fidelity, authoritative technical record
33+
34+
DO NOT COMPRESS IF
2335

24-
SAFEGUARDS
25-
Do NOT compress if
26-
raw context is still relevant and needed for edits or precise references
27-
the task in the target range is still actively in progress
36+
- raw context is still relevant and needed for edits or precise references
37+
- the task in the target range is still actively in progress
38+
- you cannot identify reliable boundaries yet
2839

29-
EVALUATE THE CONVERSATION SIGNAL TO NOISE RATIO REGULARLY AND USE `compress` PROACTIVELY. PARALLELIZE COMPRESSION WHEN POSSIBLE. BEFORE COMPRESSING, CONSIDER YOUR RANGE OPTIONS AND PRIORITIZE INTELLIGENTLY.
40+
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
3041

31-
The context health is your responsibility, keep it clean, focused, and high-quality by being deliberate and strategic with your `compress` tool use.
42+
It is of your responsibility to keep a sharp, high-quality context window for optimal performance
3243
</instruction>
3344

3445
<manual><instruction name=manual_mode policy_level=critical>

0 commit comments

Comments
 (0)