Getting more out of OpenCode

OpenCode feels rough out of the box, but a few setup tweaks make it far more capable for agentic coding

Written by Rico Sta. Cruz
(@rstacruz) · 19 Apr 2026

I get a lot of value out of OpenCode, but many people I recommend it to pass on it. It’s easy to see it as inferior to established tools like Claude Code. Out of the box, OpenCode can feel rough. But with the right setup, I’ve found it matches and exceeds other tools.

Screenshot of OpenCode implementing a dark mode feature across multiple tickets with subagents
OpenCode running a multi-ticket workflow with subagents, MCPs, and Copilot.

Agentic coding on a budget

Using frontier models in OpenCode is expensive. I don’t want to pay per API call. I want a subscription like Anthropic or OpenAI.

Reality: While you can’t use Anthropic subscriptions anymore, you can use subscriptions from OpenAI and GitHub Copilot and a lot more.

Solution: On a budget? Try GitHub Copilot. It’s probably the cheapest, best-value option for agentic coding right now. GitHub Copilot costs $10/month, plus $0.04 per additional “premium request” (a prompt you type in). In practice, I’ve gotten far more use out of this than a $20 Anthropic subscription.

Crucially: subagent calls are free with Copilot. You can use Sonnet to split a big task into 10 tickets and delegate them to 10 Opus subagents—all this will cost 1 premium request.

Fix context compaction

OpenCode with Copilot isn’t as good as Claude or Codex for big tasks. OpenCode compacts context too often.

Without plugins, this is mostly true. Copilot nerfs Anthropic’s context windows down to 128k, so context compacts too often. However, OpenCode has better compaction tools available as plugins.

Solution: Install the Dynamic Context Pruning plugin for significantly improved context management.

Screenshot of the OpenCode Dynamic Context Pruning plugin in use
Dynamic Context Pruning makes OpenCode do smaller compactions as a task goes so context is intelligently managed.

Improve web fetches with Exa

A key strength of tools like Claude Code is gathering context from the web. Need a library to manipulate colours? Ask Claude to “find 3 colour processing libraries supporting Node.js with CIELAB”—it searches and crawls automatically.

OpenCode’s webfetch tool isn’t as capable by default. It does the job, but searches are done by scraping google.com pages, and it sometimes hits limits with sites that don’t allow robots.

Solution: Enable free Exa searches. OpenCode’s Exa support is disabled by default. The OPENCODE_ENABLE_EXA flag enables web search with limited (but generous) rate limits:

~/.config/mise/config.toml
[env]
OPENCODE_ENABLE_EXA = "1"

Better solution: I recommend getting an Exa API key and using the Exa MCP. It’s free and gives you generous rate limits:

~/.config/mise/config.toml
[env]
EXA_API_KEY = "..."
# ~/.config/opencode/config.jsonc
{
"mcp": {
"exa": {
"type": "remote",
"url": "https://mcp.exa.ai/mcp?tools=web_search_exa,get_code_context_exa,crawling_exa&exaApiKey={env:EXA_API_KEY}",
"enabled": true
}
}
}
Screenshot of OpenCode using Exa-powered web research with multiple subagents
OpenCode can gather richer web context with Exa enabled.

Enable a better plan mode

Plan mode just works better in Claude.

OpenCode’s improved plan mode exists but isn’t on by default.

The default plan mode is thin—it’s just a preset that removes file editing tools. Other agentic tools write plans to Markdown files, which lets you ask subagents to review and revise them, save them for future reference, or start new conversations for implementation work.

Solution: Enable the experimental plan mode:

~/.config/mise/config.toml
[env]
OPENCODE_EXPERIMENTAL_PLAN_MODE=1

Try these MCPs

  • context7: Documentation on demand for libraries and frameworks
  • chrome-devtools: Essential for frontend work—take screenshots, inspect elements, run performance audits

Give it a go

If you already have GitHub Copilot or a ChatGPT subscription, OpenCode is worth trying. If you don’t have those subscriptions, consider getting Copilot. It’s perhaps the cheapest way to try agentic development today.

What OpenCode still does unusually well is let you mix and match different models in one workflow.

Written by Rico Sta. Cruz

I am a web developer helping make the world a better place through JavaScript, Ruby, and UI design. I write articles like these often. If you'd like to stay in touch, subscribe to my list.

Comments

More articles

← More articles