# OpenCode Plugins Reference

Top plugins for token optimization, workflow, safety, and observability.

## Core Optimization (Install These First)

| Plugin | Install | Token Savings | Notes |
|--------|---------|---------------|-------|
| **openslimedit** | `npm install openslimedit@latest` | 21-45% | Compresses tool descriptions, compacts read output, line-range edit. Zero config. |
| **opencode-context-cache** | Download .mjs from GitHub | ~98% cache hit rate | Stable SHA256 key per project. Requires `setCacheKey: true` on provider. Provider-agnostic. |
| **Dynamic Context Pruning (DCP)** | `opencode plugin @tarquinen/opencode-dcp@latest --global` | Variable (auto-compaction) | Compresses stale context, deduplicates repeated tool calls, purges error inputs after N turns. 3.5K ★. Has `/dcp` TUI panel. Config in `dcp.jsonc`. |

## Safety

| Plugin | Install | What It Does |
|--------|---------|-------------|
| **opencode-ignore** | `npm install opencode-ignore` | Blocks AI read/write/edit on files matching `.ignore` patterns. Gitignore-style syntax, supports negation. |
| **Envsitter Guard** | npm | Prevents agents from reading/editing `.env*` files (safe inspection only). |
| **CC Safety Net** | npm | Catches destructive git/filesystem commands before execution. |

## Notifications

| Plugin | What It Does |
|--------|-------------|
| **@whisperopencode/push** | Push notifications to mobile when long-running tasks complete. |
| **OpenCode Notify** | OS-level notifications (native desktop). |

## Workflow Enhancement

| Plugin | What It Does |
|--------|-------------|
| **Oh My OpenCode Slim** | Lightweight: background agents, LSP/AST tools, MCP support, Claude Code compat |
| **Context Analysis** | Detailed token usage analysis per session |
| **OpenCode WakaTime** | Track OpenCode usage metrics |
| **Autotitle** | AI-powered automatic session naming |
| **OpenQueue** | Queue follow-up messages while model is thinking |

## Web & Research

| Plugin | What It Does |
|--------|-------------|
| **OpenCode Websearch Cited** | Native websearch with inline citations and source lists |
| **Google AI Search** | Query Google AI Mode (SGE) as a native tool |

## GitHub Integration

| Plugin/MCP | What It Does |
|--------|-------------|
| **GitHub MCP Server** | Remote: `https://api.githubcopilot.com/mcp/` — PRs, issues, repos. Needs PAT. Heavy on context — restrict to dedicated agents. |
| **GitHub Release** | Automated semantic releases with auto-generated notes |

## Subagents & Custom Tools (Not Plugins, But Important)

Create `.md` files in `~/.config/opencode/agents/` for custom subagents. Create `.ts` files in `~/.config/opencode/tools/` for custom tools. These don't need plugin installation — OpenCode discovers them automatically.

Common subagents to define: `code-reviewer` (deny edit/bash), `test-writer`, `doc-generator`, `debug-agent`. Assign cheap local models to each.

## Memory & Persistence

| Plugin | What It Does |
|--------|-------------|
| **Harness Memory** | Persistent project memory with 4-layer activation, 73% fewer tokens than CLAUDE.md |
| **Agent Memory** | Letta-inspired persistent memory blocks |
| **OpenCode Supermemory** | Persistent memory across sessions/projects |

## Advanced

| Plugin | What It Does |
|--------|-------------|
| **Magic Context** | Lossless context management with background compression and cross-session memory |
| **GoopSpec** | Spec-driven development: 5-phase workflow, 12 subagents, wave execution |
| **FlowDeck** | Multi-agent workflow orchestrator: 25 specialist agents, 24 skills, 17 commands |
| **Morph Fast Apply** | 10,500+ tokens/sec code editing via Morph's Fast Apply API |

## Benchmarks: openslimedit Token Savings

| Model | Baseline | openslimedit | Savings |
|-------|----------|-------------|---------|
| GPT 5.3 Codex | 77,494 | 42,509 | **-45.1%** |
| Claude Opus 4.6 | 60,841 | 47,590 | **-21.8%** |
| Claude Sonnet 4.5 | 120,884 | 81,471 | **-32.6%** |
| GPT 5.2 Codex | 39,185 | 28,713 | **-26.7%** |
| Minimax M2.5 Free | 28,031 | 21,073 | **-24.8%** |

Measured across 4 edit tasks; separate sessions, no prompt caching.
