</>MCP Agents Market
Plugin

opencode-dynamic-context-pruning

by Opencode-DCP4.1kTypeScriptUpdated 2026-08-16

Dynamic context pruning plugin for OpenCode - intelligently manages conversation context to optimize token usage

Claude Code

The opencode-dynamic-context-pruning plugin intelligently manages conversation context in Claude Code by automatically compressing, deduplicating, and pruning conversation history to reduce token consumption. It provides a compress tool that lets the AI model replace closed conversation segments with high-fidelity technical summaries, along with automatic deduplication of repeated tool calls and removal of errored tool inputs. The plugin preserves important information through protected tools and file patterns while significantly reducing context size in long coding sessions, helping developers stay within token budgets and reduce API costs.

Key Features

Compress tool with range and message modes for AI-controlled context compression into technical summaries
Automatic deduplication removes repeated tool calls with identical arguments, keeping only the most recent output
Configurable error pruning removes inputs from failed tool calls after a set number of turns
Protected tools and file patterns ensure critical information is never lost during compression
Nested compression preserves information through multiple compression layers rather than diluting it
Per-model context limit configuration with percentage-based or absolute token thresholds
Manual mode for explicit control via slash commands (/dcp, /dcp-compress) with TUI panel
Customizable prompts for compression behavior and editable protection rules

Use Cases

  • 01Reducing token costs in long coding sessions by compressing stale conversation history
  • 02Managing context limits when using smaller models like GitHub Copilot or local LLMs
  • 03Preventing context overflow in extended debugging sessions with large log files
  • 04Optimizing prompt cache efficiency while maintaining relevant conversation state
  • 05Surgical context management by compressing specific message ranges or individual messages
  • 06Preserving critical tool outputs from subagents and skills while pruning verbose conversation

Related Plugins

View more

opencode-dynamic-context-pruning — FAQ

What is the opencode-dynamic-context-pruning plugin?+

It is a Claude Code plugin that automatically manages conversation context by compressing, deduplicating, and pruning conversation history to reduce token usage. The plugin exposes a compress tool that the AI model can invoke to replace closed conversation segments with technical summaries while preserving important information.

How do I install the dynamic context pruning plugin in Claude Code?+

Install it globally from the Claude Code CLI using the command 'opencode plugin @tarquinen/opencode-dcp@latest --global'. This installs the package and adds it to your global Claude Code configuration automatically.

Which AI clients support this context pruning plugin?+

This plugin is specifically designed for Claude Code (previously known as OpenCode). The developer also offers Sleev, a local proxy that works with Claude Code, Codex, and other clients with similar context-management features.

Does the plugin require any API keys or prerequisites?+

No API keys are required. You only need Claude Code installed and a working Node.js environment to install the npm package. Configuration is optional and stored in JSONC files in your config directory or project folder.

Is the dynamic context pruning plugin free to use?+

Yes, the plugin is open source under the AGPL-3.0-or-later license and available for free. The developer accepts voluntary support via Ko-fi.

How does context pruning affect prompt caching?+

Pruning changes message content, which invalidates cached prefixes from that point forward, reducing cache hit rates from approximately 90% to 85% in testing. However, the token savings from reduced context size typically outweigh the cache miss costs in long sessions.

How do I install opencode-dynamic-context-pruning?+

Open the source repository on GitHub and follow its README. opencode-dynamic-context-pruning is a plugin — MCP Agents Market links you directly to the official repo.

Is opencode-dynamic-context-pruning free?+

opencode-dynamic-context-pruning is an open-source project hosted on GitHub. Check the repository for its license and any usage requirements.

Related searches