Skip to content

Commit 3d8ff53

Browse files
prune
1 parent ec0ce1c commit 3d8ff53

1 file changed

Lines changed: 12 additions & 35 deletions

File tree

lib/prompts/prune.md

Lines changed: 12 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,18 @@
1-
Prunes tool outputs from context to manage conversation size and reduce noise.
1+
Use this tool to remove tool outputs from context entirely. No preservation - pure deletion.
22

3-
## IMPORTANT: The Prunable List
3+
THE PRUNABLE TOOLS LIST
4+
A <prunable-tools> will show in context when outputs are available for pruning. Each entry follows the format `ID: tool, parameter (~token usage)` (e.g., `20: read, /path/to/file.ts (~1500 tokens)`). You MUST select outputs by their numeric ID. THESE ARE YOUR ONLY VALID TARGETS.
45

5-
A `<prunable-tools>` list is provided to you showing available tool outputs you can prune when there are tools available for pruning. Each line has the format `ID: tool, parameter` (e.g., `20: read, /path/to/file.ts`). You MUST only use numeric IDs that appear in this list to select which tools to prune.
6+
THE WAYS OF PRUNE
7+
`prune` is a blunt instrument for eliminating noise (irrelevant or unhelpful outputs that provide no value), or superseded information (older outputs replaced by newer, more accurate data), wrong target (you read or accessed something that turned out to be irrelevant). Use it judiciously to maintain a clean and relevant context.
68

7-
## When to Use This Tool
9+
BE STRATEGIC! Prune is most effective when batched. Don't prune a single tiny output - wait until you have several items (depending on context occupation of those noisy outputs).
810

9-
Use `prune` for removing individual tool outputs that are no longer needed:
11+
Do NOT prune when:
12+
NEEDED LATER: You plan to edit the file or reference this context for implementation.
13+
UNCERTAINTY: If you might need to re-examine the original, keep it.
1014

11-
- **Noise:** Irrelevant, unhelpful, or superseded outputs that provide no value.
12-
- **Wrong Files:** You read or accessed something that turned out to be irrelevant.
13-
- **Outdated Info:** Outputs that have been superseded by newer information.
15+
Before pruning, ask: _"Will I need this output for upcoming work?"_ If yes, keep it. Pruning that forces re-fetching is a net loss.
1416

15-
## When NOT to Use This Tool
16-
17-
- **If the output contains useful information:** Keep it in context rather than pruning.
18-
- **If you'll need the output later:** Don't prune files you plan to edit or context you'll need for implementation.
19-
20-
## Best Practices
21-
22-
- **Strategic Batching:** Don't prune single small tool outputs (like short bash commands) unless they are pure noise. Wait until you have several items to perform high-impact prunes.
23-
- **Think ahead:** Before pruning, ask: "Will I need this output for upcoming work?" If yes, keep it.
24-
25-
## Format
26-
27-
- `ids`: Array of numeric IDs as strings from the `<prunable-tools>` list
28-
29-
## Example
30-
31-
<example_noise>
32-
Assistant: [Reads 'wrong_file.ts']
33-
This file isn't relevant to the auth system. I'll remove it to clear the context.
34-
[Uses prune with ids: ["5"]]
35-
</example_noise>
36-
37-
<example_superseded>
38-
Assistant: [Reads config.ts, then reads updated config.ts after changes]
39-
The first read is now outdated. I'll prune it and keep the updated version.
40-
[Uses prune with ids: ["20"]]
41-
</example_superseded>
17+
THE FORMAT OF PRUNE
18+
`ids`: Array of numeric IDs (as strings) from the `<prunable-tools>` list

0 commit comments

Comments
 (0)