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: README.md
+4-93Lines changed: 4 additions & 93 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,23 +6,7 @@ Automatically reduces token usage in OpenCode by removing obsolete tool outputs
6
6
7
7
## What It Does
8
8
9
-
This plugin automatically optimizes token usage by identifying and removing redundant or obsolete tool outputs from your conversation history. It operates in two modes:
- Phase 1: Automatic duplicate removal (same as auto mode)
21
-
- Phase 2: AI analysis to identify obsolete outputs (superseded information, dead-end exploration, etc.)
22
-
- Maximum token savings
23
-
- Small LLM cost for analysis (reduced by deduplication first)
24
-
25
-
When your session becomes idle, the plugin analyzes your conversation and prunes tool outputs that are no longer relevant, saving tokens and reducing costs.
9
+
This plugin automatically optimizes token usage by identifying and removing redundant or obsolete tool outputs from your conversation history.
26
10
27
11
## Installation
28
12
@@ -39,6 +23,8 @@ Add to your OpenCode configuration:
39
23
}
40
24
```
41
25
26
+
> **Note:** OpenCode's `plugin` arrays are not merged between global and project configs—project config completely overrides global. If you have plugins in your global config and add a project config, include all desired plugins in the project config.
27
+
42
28
Restart OpenCode. The plugin will automatically start optimizing your sessions.
43
29
44
30
## Configuration
@@ -76,91 +62,16 @@ Example configuration:
76
62
77
63
The global config is automatically created on first run. Create project configs manually to override settings per-project:
78
64
79
-
```bash
80
-
mkdir -p .opencode
81
-
cat > .opencode/dcp.jsonc << 'EOF'
82
-
{
83
-
"debug": true,
84
-
"pruningMode": "auto"
85
-
}
86
-
EOF
87
-
```
88
-
89
65
After modifying configuration, restart OpenCode for changes to take effect.
90
66
91
-
### Choosing a Pruning Mode
92
-
93
-
**Use Auto Mode (`"auto"`) when:**
94
-
- Minimizing costs is critical (zero LLM inference for pruning)
95
-
- You have many repetitive tool calls (file re-reads, repeated commands)
96
-
- You want predictable, deterministic behavior
97
-
- You're debugging or testing and need consistent results
98
-
99
-
**Use Smart Mode (`"smart"`) when:**
100
-
- You want maximum token savings (recommended for most users)
101
-
- Your workflow has both duplicates and obsolete exploration
102
-
- You're willing to incur small LLM costs for comprehensive pruning
103
-
- You want the plugin to intelligently identify superseded information
0 commit comments