DEDUPED Hot AI repos, turned into use cases Get 5 a day

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.

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.

Share: X LinkedIn Hacker News Email Copy link

Disclaimer

Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page