From stackoverflow-search
How to effectively search Stack Overflow using the stackoverflow-cli (`sof-cli`) tool. Use this skill whenever the user wants to look up an error, debug a problem, or find solutions on Stack Overflow from the terminal. Trigger this skill when the user mentions searching Stack Overflow, troubleshooting an error with the CLI, running `stackoverflow search`, or asks how to use `sof-cli` effectively — even if they don't explicitly say "skill" or "guide". Also trigger when the user pastes an error message and seems to want a CLI-based lookup strategy.
How this skill is triggered — by the user, by Claude, or both
Slash command
/stackoverflow-search:stackoverflow-searchThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
The `sof-cli` tool lets you search Stack Overflow from the terminal. Getting good results
sof-cliThe sof-cli tool lets you search Stack Overflow from the terminal. Getting good results
requires thinking carefully about what you search and how you filter the results.
There are three steps: sanitize the query, run the right command, and evaluate what comes back.
Raw error messages from your project are full of noise that hurts search quality — file paths, table names, variable names, and IDs that are unique to your environment. Strip those out before searching.
Remove:
/Users/alice/project/src/db/users.tsthis.prisma.myCustomTable.upsert()job_id=abc123Keep:
Error 404, ECONNREFUSED, ER_DUP_ENTRYExample:
# Raw (bad — too specific)
PrismaClientKnownRequestError: Invalid `this.prisma.userProfile.upsert()` invocation in
/Users/alice/myapp/src/services/userService.ts:42:5
# Sanitized (good — searchable)
PrismaClientKnownRequestError Invalid prisma upsert invocation
Build your query in this order:
[Language/Framework + Version] [Core Error Message] [Specific Context]
For exact phrase matching, wrap critical parts of the error string in double quotes:
stackoverflow search '"PrismaClientKnownRequestError" upsert'
Combine the free-text query with --tagged to pin the technology:
stackoverflow search '"cannot read properties of undefined" reading map' --tagged "javascript;react"
| Goal | Option | Example |
|---|---|---|
| Pin a technology | --tagged "tag1;tag2" | --tagged "python;django" |
| Exclude noisy tags | --nottagged "tags" | --nottagged "javascript" |
| Match title exactly | --title "text" | --title "upsert conflict" |
| Only answered questions | --accepted | --accepted |
| Require at least N answers | --answers 1 | --answers 2 |
| More results | --limit 10 | --limit 10 |
| Sort by votes | --sort votes | --sort votes --order desc |
| Only recent results | --fromdate YYYY-MM-DD | --fromdate 2022-01-01 |
# TypeScript error — exact phrase + tag
stackoverflow search '"Property does not exist on type"' --tagged "typescript" --accepted
# Python import error with version context
stackoverflow search 'python 3.11 "ModuleNotFoundError" no module named' --tagged "python"
# React hook rule violation — recent only
stackoverflow search '"Rules of Hooks" cannot call inside callback' \
--tagged "javascript;react" --fromdate 2021-01-01 --sort votes
# Django ORM error — only questions with accepted answers and decent engagement
stackoverflow search 'django "RelatedObjectDoesNotExist" get() returned more than one' \
--tagged "python;django" --accepted --answers 1
The search command returns a list of questions with their score (net upvotes),
answered status, and link. Use these to triage quickly:
To read the full question and its top answers:
stackoverflow get <question_id>
# Get more answers (default is 3)
stackoverflow get <question_id> --max-answers 5
For scripting or piping results into another tool:
stackoverflow search '"ECONNREFUSED" redis connect' --json
stackoverflow get 11828270 --json
If the first search returns poor results:
upsert → insert or update)--accepted or tighten --tagged if results are too broad--sort votes to surface highly-rated classic answersInstall sof-cli globally via your package manager:
# npm
npm install -g sof-cli
# pnpm
pnpm add -g sof-cli
# yarn
yarn global add sof-cli
Verify the installation:
stackoverflow --version
Requires Node.js >= 16.
By default you get 300 API requests/day. Register a free Stack Exchange App Key at stackapps.com and configure it once:
stackoverflow init --key <YOUR_APP_KEY>
# → 10,000 requests/day
npx claudepluginhub greatsumini/stackoverflow-cli --plugin stackoverflow-searchSearches Stack Overflow for Agents (SOFA) for peer-verified solutions before solving unfamiliar errors, APIs, libraries, or patterns from scratch. Acts as a research shortcut for debugging and integration tasks.
Researches technical problems across GitHub issues, Stack Overflow, Reddit, and documentation. Gathers structured solutions from multiple sources with executive summaries, options, and references. Useful for debugging and finding examples.
Searches GitHub repos, issues, PRs, and code for proven solutions to concrete engineering problems, errors, integration failures, and implementation blockers.