@qdang46/opencode-dcp-plugin
NAPI-RS native Dynamic Context Pruning plugin for OpenCode
Forked from @tarquinen/opencode-dcp (AGPL-3.0). Rewritten with a Rust native addon for the core DCP logic while keeping the TypeScript plugin architecture and TUI from the original.
Installation
opencode plugin @qdang46/opencode-dcp-plugin@latest --globalRestart OpenCode and run /dcp to open the DCP panel.
Usage
| Slash Command | Description |
|---|---|
/dcp |
Open the DCP panel |
/dcp context |
Show token usage breakdown |
/dcp stats |
Show pruning statistics |
/dcp sweep |
Flush pending prune strategies |
/dcp manual <on|off> |
Toggle manual mode |
/dcp decompress <id> |
Restore a compressed block |
/dcp recompress <id> |
Re-activate a decompressed block |
/dcp-compress [focus] |
Trigger manual compression |
Configuration
Config cascades through 4 tiers (later wins per key):
- Built-in defaults (compiled)
- Global:
~/.config/dynamic_context_pruning/config.jsonc - Custom:
$DCP_CONFIG_DIR/config.jsonc - Project:
.dynamic_context_pruning/config.jsonc
See the reference docs for full config schema.
Development
cd opencode-dcp-plugin
npm run build # Build Rust native addon
npx tsc # Compile TypeScriptCredits
Based on @tarquinen/opencode-dcp (AGPL-3.0) by tarquinen. The core DCP logic (pruning, compression, token counting, config cascade) is implemented as a Rust NAPI-RS native addon for maximum performance.
License
MIT — see LICENSE.