npm install @tuanhung303/opencode-acpAdd to your OpenCode configuration:
Restart OpenCode to activate.
Use the context_prune tool to manage conversation context:
// Discard tool outputs
context_prune({ action: "discard", targets: [["44136f"]] })
// Distill with summary
context_prune({
action: "distill",
targets: [["01cb91", "Found 8 TypeScript files"]],
})
// Discard multiple by hash
context_prune({ action: "discard", targets: [["a1b2c3"], ["d4e5f6"], ["789abc"]] })Create .opencode/acp.jsonc:
{
"$schema": "https://raw.githubusercontent.com/tuanhung303/opencode-agent-context-pruning/master/acp.schema.json",
"enabled": true,
"autoPruneAfterTool": false,
"tools": {
"discard": { "enabled": true },
"distill": { "enabled": true },
},
}- Auto-Supersede: Automatic deduplication of tool calls, file operations, and todo updates
- Manual Pruning: Explicit
discardanddistilltools for agent control - Protected Tools: Critical tools exempt from pruning
- Token Savings: Up to 50% reduction in context size
Main pruning interface.
Parameters:
action:"discard"|"distill"targets: Array of[hash]or[hash, summary]tuples
Target Types:
- Tool outputs: 6 hex chars (e.g.,
44136f) - Thinking blocks: 6 hex chars
- Messages: 6 hex chars
- Multiple targets: Array of
[hash]or[hash, summary]tuples
/acp- Show ACP statistics and version/acp stats- Show ACP statistics and version
MIT