explaingit

evilayman/opencode-raven

20TypeScriptAudience · developerComplexity · 2/5Setup · easy

TLDR

An opencode plugin that intercepts all AI search operations and hands them to a cheap model, so your expensive main coding AI only uses its context window for actual coding and reasoning.

Mindmap

mindmap
  root((opencode-raven))
    What it does
      Intercepts search calls
      Offloads to cheap model
      Saves main AI context
    Search Sources
      Local filesystem
      Context7 for docs
      Exa AI web search
      Grep.app for GitHub
    Configuration
      Toggle interception
      Change Raven model
      Exclude specific agents
    Setup
      npm or bun install
      One config line
      No API keys needed
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Reduce AI API costs in opencode by routing all file, web, and documentation searches through a free model instead of your paid one.

USE CASE 2

Keep your main coding AI's context window focused on code by offloading all search steps to a separate Raven model that your agent never sees.

USE CASE 3

Search GitHub code via Grep.app, web results via Exa AI, and library docs via Context7 from a single unified tool without setting up API keys.

Tech stack

TypeScriptopencodeContext7Exa AIGrep.app

Getting it running

Difficulty · easy Time to first run · 5min

Two steps: npm/bun install plus one config line, external search services work without API keys at default rate limits.

No license information was mentioned in the explanation.

In plain English

Opencode is an AI coding tool, and when you work with it, the AI agent frequently runs searches: looking through your local files, fetching documentation, scanning the web. Each of those searches consumes tokens and takes up space in the context window the AI uses to keep track of your conversation. Raven is a plugin for opencode that intercepts all those search operations and hands them off to a separate, cheaper AI model instead, so your main expensive model stays focused on actually writing and reasoning about code. The way it works is that Raven blocks the built-in search tools for your main agent and any sub-agents you are running. When those agents need to search something, they call a single unified tool called raven_seek instead. Raven then handles the search using a free or low-cost model, with access to your local filesystem plus three external research services: Context7 for library documentation, Exa AI for web search, and Grep.app for searching GitHub code. The main agent only sees the final result, not the internal steps Raven took to get there. Installing it takes two steps: add the package with npm or bun, then add one line to your opencode configuration file. After a restart it is active. You can turn interception on or off with slash commands, change which model Raven uses, adjust how long it waits before timing out, and check how many tokens it has processed for you across the current session and all time. The plugin is configurable enough to exclude specific agents or specific tools from being intercepted, which matters if you have a custom agent that needs direct search access. The three external MCP services it connects to all work without API keys at the default rate limits, though you can add keys to increase those limits. The core use case is cost and focus: run a capable free model for search, and let your paid model spend its context on the work that actually requires it.

Copy-paste prompts

Prompt 1
I want to install opencode-raven so my expensive Claude model stops using tokens on file searches. What are the exact npm install command and the one config line I need to add to opencode?
Prompt 2
How does opencode-raven intercept my main agent's search calls? Explain how raven_seek replaces the built-in search tools and what happens inside before the result is returned.
Prompt 3
I have a custom sub-agent in opencode that needs direct search access and should not be intercepted by Raven. How do I exclude that specific agent from interception?
Prompt 4
How do I check how many tokens opencode-raven has saved me across this session? What slash command shows the stats, and what do the numbers mean?
Open on GitHub → Explain another repo

← evilayman on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.