|
1 | 1 | <system-reminder> |
2 | 2 | <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. |
4 | 4 |
|
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. |
6 | 6 |
|
7 | | -THE PHILOSOPHY BEHIND COMPRESSION |
| 7 | +OPERATING STANCE |
8 | 8 | Compression can operate at various scales. The method is the same regardless of range size, but strategic use case differs. |
9 | 9 |
|
| 10 | +You will default to micro and meso compressions |
| 11 | + |
10 | 12 | MICRO: ideal for low-latency noise disposal |
11 | 13 | 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. |
13 | 17 |
|
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 |
15 | 25 |
|
16 | 26 | 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 |
18 | 28 |
|
19 | 29 | THE SUMMARY STANDARD |
20 | 30 | 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 |
21 | 31 |
|
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 |
23 | 35 |
|
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 |
28 | 39 |
|
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 |
30 | 41 |
|
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 |
32 | 43 | </instruction> |
33 | 44 |
|
34 | 45 | <manual><instruction name=manual_mode policy_level=critical> |
|
0 commit comments