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/prune-system-prompt.txt
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -8,14 +8,14 @@ PRUNE METHODICALLY - CONSOLIDATE YOUR ACTIONS
8
8
Every tool call adds to your context debt. You MUST pay this down regularly and be on top of context accumulation by pruning. Consolidate your prunes for efficiency; it is rarely worth pruning a single tiny tool output unless it is pure noise. Evaluate what SHOULD be pruned before jumping the gun.
9
9
10
10
WHEN TO PRUNE? THE THREE SCENARIOS TO CONSIDER
11
-
1. TASK COMPLETION: When work is done, quietly prune the tools that aren't needed anymore
11
+
### 1. TASK COMPLETION: When work is done, quietly prune the tools that aren't needed anymore and provide a summary in the `distillation` parameter (as an object).
12
12
2. NOISE REMOVAL: If outputs are irrelevant, unhelpful, or superseded by newer info, prune IMMEDIATELY. No distillation - gun it down
13
-
3. CONTEXT CONSOLIDATION: When pruning valuable context to the task at hand, you MUST ALWAYS distill key findings into your narrative BEFORE pruning. Be surgical and strategic in what you extract. THINK: high signal, low noise
13
+
3. CONTEXT CONSOLIDATION: When pruning valuable context to the task at hand, you MUST ALWAYS provide the key findings in the `distillation` parameter of the `prune` tool (as an object). Be surgical and strategic in what you extract. THINK: high signal, low noise
14
14
15
15
You WILL use the `prune` tool when ANY of these are true:
16
16
- Task or sub-task is complete
17
17
- You are about to start a new phase of work
18
-
- You have distilled enough information in your messages to prune related tools
18
+
- You have gathered enough information to prune related tools and preserve their value in the `distillation` parameter
19
19
- Context contains tools output that are unhelpful, noise, or made obsolete by newer outputs
20
20
- Write or edit operations are complete (pruning removes the large input content)
**When:** You have successfully completed a specific unit of work (e.g., fixed a bug, wrote a file, answered a question).
14
14
**Action:** Prune the tools used for that task.
15
-
**Distillation:** NOT REQUIRED. Since the task is done, the raw data is no longer needed. Simply state that the task is complete.
15
+
**Distillation:** Use the `distillation` parameter (as an object) to provide a final confirmation that the task is complete (e.g., `{ "status": "Tests passed, file updated" }`).
**When:** You have read files or run commands that turned out to be irrelevant, unhelpful, or outdated (meaning later tools have provided fresher, more valid information).
19
19
**Action:** Prune these specific tool outputs immediately.
20
-
**Distillation:** FORBIDDEN. Do not pollute the context by summarizing useless information. Just cut it out.
**When:** You have gathered useful information. Prune frequently as you work (e.g., after reading a few files), rather than waiting for a "long" phase to end.
24
24
**Action:** Convert raw data into distilled knowledge. This allows you to discard large outputs (like full file reads) while keeping only the specific parts you need (like a single function signature or constant).
25
-
**Distillation:** MANDATORY. Before pruning, you *must* explicitly summarize the key findings from *every* tool you plan to prune.
26
-
- **Extract specific value:** If you read a large file but only care about one function, record that function's details and prune the whole read.
27
-
- Narrative format: "I found X in file Y..."
25
+
**Distillation:** MANDATORY. Use the `distillation` parameter (MUST be an object) to explicitly summarize the key findings from *every* tool you plan to prune.
26
+
- **Extract specific value:** If you read a large file but only care about one function, record that function's details.
- Capture all relevant details (function names, logic, constraints).
29
-
- Once distilled into your response history, the raw tool output can be safely pruned.
29
+
- Once distilled into the `distillation` object, the raw tool output can be safely pruned.
30
30
- **Know when distillation isn't enough:** If you'll need to edit a file, grep for exact strings, or reference precise syntax, keep the raw output. Distillation works for understanding; implementation often requires the original.
31
31
- **Prefer keeping over re-fetching:** If uncertain whether you'll need the output again, keep it. The cost of retaining context is lower than the cost of redundant tool calls.
32
32
@@ -47,18 +47,18 @@ This file isn't relevant to the auth system. I'll remove it to clear the context
47
47
48
48
<example_consolidation>
49
49
Assistant: [Reads 5 different config files]
50
-
I have analyzed the configuration. Here is the distillation:
51
-
- 'config.ts' uses port 3000.
52
-
- 'db.ts' connects to mongo:27017.
53
-
- The other 3 files were defaults.
54
-
I have preserved the signals above, so I am now pruning the raw reads.
55
-
[Uses prune with ids: ["consolidation", "10", "11", "12", "13", "14"]]
50
+
I'll preserve the configuration details and prune the raw reads.
0 commit comments