Skip to content

opencode-dynamic-context-pruning
Intelligent Context Pruning for OpenCode

Automatically reduces token usage in OpenCode by intelligently removing redundant tool calls from conversation history. Features zero-cost automatic strategies, LLM-driven pruning tools, and real-time statistics.

Why OpenCode DCP?

Reduce token costs and improve AI response quality through intelligent context management.

Zero-Cost Automatic Pruning

Deduplication, write superseding, and error purging strategies run automatically with zero LLM cost.

LLM-Driven Tools

AI autonomously invokes discard and extract tools to intelligently clean up completed task content.

Real-Time Statistics

View token usage distribution and pruning effects through /dcp context and /dcp stats commands.

Manual Control

Use /dcp sweep command to manually clean up specified number of tool calls when needed.

Multi-Level Configuration

Global, environment variable, and project-level configuration to flexibly adapt to different needs.

Protection Mechanisms

Turn protection, protected tools, and file patterns ensure critical content is never accidentally pruned.