DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to hand multistep code searches to a subagent with Opencode

Call the built-in general subagent with @general to run complex searches across a repo.

Short answer: Run npm i -g @opencode/cli@latest; then Change into the project folder and start OpenCode with opencode; type a message that starts with @general and describe the search, for example where a setting is read and written. All steps.

Who it is forA developer tracing a bug or behavior across many files who does not want to run each search by hand.

The problemComplex searches across a repo take many steps, and it is slow to do each one manually.

The outcomeThe general subagent returns the search results it found, so you can decide the next change.

What you need first

  • A terminal on macOS, Linux, or Windows, or the desktop app installer for your platform
  • One package manager available: npm, bun, pnpm, yarn, or brew
  • A local project folder you want the agent to work in
  • Configuration for OpenCode as described in the docs at opencode.ai/docs (the README only links to them)

Steps

  1. Run npm i -g @opencode/cli@latest.
  2. Change into the project folder and start OpenCode with opencode. (inferred, check the README)
  3. Type a message that starts with @general and describe the search, for example where a setting is read and written.
  4. Review the results it returns and ask follow-up questions in the same session.

Prompt for your agent

In the anomalyco/opencode CLI, send a message beginning with @general asking it to find every place <symbol-or-setting> is read or written in <project-path>. Expected output: a list of file paths and line references with a one-line note on each. Verify by opening two of the listed files and confirming the references match.

Caveat. The README says the general subagent is used internally, so do not expect a documented way to configure it beyond invoking it with @general.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for anomalyco/opencode and "Hand multistep code searches to a subagent"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer