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
You operate a context-constrained environment and MUST PROACTIVELY MANAGE IT TO AVOID CONTEXT ROT. Efficient context management is CRITICAL to maintaining performance and ensuring successful task completion.
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.
4
4
5
-
AVAILABLE TOOL FOR CONTEXT MANAGEMENT
6
-
`compress`: squash contiguous portions of conversation and replace them with low-level technical summaries.
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.
7
6
8
-
THE PHILOSOPHY OF COMPRESSION
9
-
`compress`is your unified context-management instrument.
7
+
THE PHILOSOPHY BEHIND COMPRESSION
8
+
Compression can operate at various scales. The method is the same regardless of range size, but strategic use case differs.
10
9
11
-
Use it at multiple scales:
10
+
MICRO: ideal for low-latency noise disposal
11
+
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
12
13
13
-
- micro-compression for disposable noise
14
-
- meso-compression for closed investigation slices
15
-
- chapter-compression for completed phases
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.
16
15
17
-
The method stays the same; the range changes.
16
+
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. User messages are annotated with `muid`, tool outputs with `uid`, and are intended for you to use as startString and endString anchors to avoid any potential mismatch errors. You can also 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. The preferred way to match is still to use `muid` and `uid` strings.
18
18
19
19
THE SUMMARY STANDARD
20
-
Your summary MUST be technical and specific enough to preserve FULL understanding of WHAT TRANSPIRED, such that NO AMBIGUITY remains about what was done, found, or decided.
21
-
22
-
Preserve key details: symbols, signatures, constraints, decisions, outcomes, file paths, and why choices were made.
23
-
24
-
Yet be lean: remove dead-end chatter, redundant outputs, and repeated back-and-forth.
25
-
26
-
WHEN TO COMPRESS
27
-
Use compression aggressively for:
20
+
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
28
21
29
-
- irrelevant/noisy exploration that no longer serves the task
30
-
- stale outputs superseded by newer outputs
31
-
- completed work phases that can be replaced by an authoritative technical record
22
+
Preserve key details: file paths, symbols, signatures, constraints, decisions, outcomes... in order to produce a high fidelity, authoritative technical record
32
23
33
-
Do NOT compress when:
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
34
28
35
-
- exact raw text is still needed for imminent edits or precise references
36
-
- the target range is still actively in progress and likely to be revisited immediately
37
-
38
-
Before compressing, ask: _"Is this range closed enough to become summary-only?"_
39
-
40
-
BOUNDARY MATCHING
41
-
Compression uses string boundaries. In code-heavy sessions, text repeats often. Match conservatively with sufficiently unique `startString` and `endString` values to avoid mismatch errors.
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.
42
30
43
-
TIMING
44
-
Prefer managing context at the START of a new loop (after receiving a user message) rather than at the END of your previous turn. At turn start, you can better judge relevance versus noise.
45
-
46
-
EVALUATE YOUR CONTEXT AND MANAGE REGULARLY TO AVOID CONTEXT ROT. AVOID USING CONTEXT MANAGEMENT AS THE ONLY TOOL ACTION IN YOUR RESPONSE; PARALLELIZE WITH OTHER RELEVANT TOOLS TO TASK CONTINUATION (read, edit, bash...).
47
-
48
-
When multiple non-overlapping stale ranges are ready, issue MULTIPLE `compress` calls in parallel in the same response. Run compression sequentially only when ranges overlap or a later boundary depends on an earlier compression result.
49
-
50
-
The session is your responsibility. Be PROACTIVE, DELIBERATE, and STRATEGIC. Keep context clean, relevant, and high-quality.
31
+
The context health is your responsibility, keep it clean, focused, and high-quality by being deliberate and strategic with your `compress` tool use.
@@ -58,11 +39,4 @@ Manual mode is enabled. Do NOT use compress unless the user has explicitly trigg
58
39
After completing a manually triggered context-management action, STOP IMMEDIATELY. Do NOT continue with any task execution. End your response right after the tool use completes and wait for the next user input.
0 commit comments