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
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ Every tool call adds to your context debt. You MUST pay this down regularly and
10
10
WHEN TO PRUNE? THE THREE SCENARIOS TO CONSIDER
11
11
1. TASK COMPLETION: When work is done, quietly prune the tools that aren't needed anymore. No distillation.
12
12
2. NOISE REMOVAL: If outputs are irrelevant, unhelpful, or superseded by newer info, prune. No distillation.
13
-
3. CONTEXT CONSOLIDATION: When pruning valuable context to the task at hand, you MUST ALWAYS provide the key findings in the `metadata.distillation` parameter of the `prune` tool (as an object). 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 `metadata.distillation` parameter of the `prune` tool (as an object). Your distillation must be high-fidelity and comprehensive, capturing technical details (signatures, logic, constraints) such that the raw output is no longer needed. THINK: high signal, complete technical substitute.
14
14
15
15
You WILL use the `prune` tool when ANY of these are true:
Copy file name to clipboardExpand all lines: lib/prompts/prune-tool-spec.txt
+29-12Lines changed: 29 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -23,17 +23,19 @@ You must use this tool in three specific scenarios. The rules for distillation (
23
23
**When:** You have gathered useful information. Wait until you have several items or a few large outputs to prune, rather than doing tiny, frequent prunes. Aim for high-impact prunes that significantly reduce context size.
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
25
**Distillation:** MANDATORY. You MUST provide the distilled findings in the `metadata.distillation` parameter of the `prune` tool (as an object).
26
-
- **Extract specific value:** If you read a large file but only care about one function, record that function's details.
27
-
- **Consolidate:** When pruning multiple tools, your distillation object MUST aggregate findings from ALL of them. Ensure you capture any information necessary to solve the current task.
28
-
- Structure: Map the `ID` from the `<prunable-tools>` list to its distilled findings.
- **Comprehensive Capture:** Distillation is not just a summary. It must be a high-fidelity representation of the technical details. If you read a file, the distillation should include function signatures, specific logic flows, constant values, and any constraints or edge cases discovered.
27
+
- **Task-Relevant Verbosity:** Be as verbose as necessary to ensure that the "distilled" version is a complete substitute for the raw output for the task at hand. If you will need to reference a specific algorithm or interface later, include it in its entirety within the distillation.
28
+
- **Consolidate:** When pruning multiple tools, your `distillation` object MUST contain a corresponding entry for EVERY ID being pruned. You must capture high-fidelity findings for each tool individually to ensure no signal is lost.
29
+
- Structure: Map EVERY `ID` from the `ids` array to its specific distilled findings.
30
+
Example: `{ "20": { ... }, "21": { ... } }`
30
31
- Capture all relevant details (function names, logic, constraints) to ensure no signal is lost.
31
32
- Prioritize information that is essential for the immediate next steps of your plan.
32
33
- Once distilled into the `metadata` object, the raw tool output can be safely pruned.
33
34
- **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.
34
35
- **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.
35
36
36
37
## Best Practices
38
+
- **Technical Fidelity:** Ensure that types, parameters, and return values are preserved if they are relevant to upcoming implementation steps.
37
39
- **Strategic Consolidation:** Don't prune single small tool outputs (like short bash commands) unless they are pure noise. Instead, wait until you have several items or large outputs to perform high-impact prunes. This balances the need for an agile context with the efficiency of larger batches.
38
40
- **Think ahead:** Before pruning, ask: "Will I need this output for an upcoming task?" If you researched a file you'll later edit, or gathered context for implementation, do NOT prune it.
39
41
@@ -46,16 +48,31 @@ This file isn't relevant to the auth system. I'll remove it to clear the context
46
48
</example_noise>
47
49
48
50
<example_consolidation>
49
-
Assistant: [Reads 5 different config files]
50
-
I'll preserve the configuration details and prune the raw reads.
Assistant: [Reads service implementation, types, and config]
52
+
I'll preserve the full technical specification and implementation logic before pruning.
53
+
[Uses prune with ids: ["10", "11", "12"], metadata: {
52
54
"reason": "consolidation",
53
55
"distillation": {
54
-
"10": "uses port 3000",
55
-
"11": "connects to mongo:27017",
56
-
"12": "defines shared constants",
57
-
"13": "export defaults",
58
-
"14": "unused fallback"
56
+
"10": {
57
+
"file": "src/services/auth.ts",
58
+
"signatures": [
59
+
"async function validateToken(token: string): Promise<User | null>",
60
+
"function hashPassword(password: string): string"
61
+
],
62
+
"logic": "The validateToken function first checks the local cache before calling the external OIDC provider. It uses a 5-minute TTL for cached tokens.",
63
+
"dependencies": ["import { cache } from '../utils/cache'", "import { oidc } from '../config'"],
64
+
"constraints": "Tokens must be at least 128 chars long. hashPassword uses bcrypt with 12 rounds."
0 commit comments