x-search
Skill0 starsChanged 6 months agoMITView on GitHub
Use when the task needs sources from X/Twitter — real-time posts, threads, reactions, what people are saying right now — and fresh general-web context only as a fallback. Triggers on "on X", "on Twitter", "what's trending", "latest reactions to", "replies to", "who said", "recent posts about", or any query where X is the primary index and stale training data would mislead. Returns cited JSON.
- Reads credentials
- Installs packages
7 other projects use a version of this.
Adopted by
Most recently taken up by
- arch3rPro/ark-spacetheir own version, first seen Nov 8, 2026
- jeroromano/claude-code-orchestration-templatetheir own version, first seen Nov 1, 2026
- schroneko/skillstheir own version, first seen Oct 29, 2026
- lleqsnoom/xskillstheir own version, first seen Sep 20, 2026
- lloyd3126/chenchungnien-skillstheir own version, first seen Aug 25, 2026
- glidea/supersearch-skillstheir own version, first seen Aug 2, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- glidea/supersearch-skills★ 4same name
- lleqsnoom/xskills★ 2same name
- arch3rPro/ark-space★ 1same name
- jeroromano/claude-code-orchestration-template★ 1same name
- schroneko/skills★ 1same name
- lloyd3126/chenchungnien-skills★ 0same name
- trapple/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 1 is distinctive, and 5 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Not on npm. The x-search binary must already be on PATH — if it isn't, ask the user to follow the project README (clone + npm install && …
- Distinctive: line 20
No route flag, no other flags for agents.
- Very specific: line 68
Don't double-shell-quote: If your query contains double quotes, wrap it in single quotes: x-search search 'site:example.com "claude opus"' …
- Very specific: line 70
answer === "No results."is a real terminal state: Don't retry the same query. - Very specific: line 71
--prettyoutput is not machine-stable: Never invoke with --pretty from another agent or pipeline — parse the default JSON. - Very specific: line 106
If $? is non-zero, the JSON is an error envelope — parse .error.code to branch (bad_args → fix call, missing_api_key → set env var, …
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
x-search
A CLI (x-search) that forces Grok to run an X-first search and return cited JSON. One call hands the model two tools — x_search (X/Twitter, primary) and web_search (general web, fallback) — and the model is instructed to prefer X and only reach for the web when X is insufficient. Use it when value comes from the X index or from an LLM-synthesized answer with citations rather than raw URLs.
Install
Not on npm. The x-search binary must already be on PATH — if it isn't, ask the user to follow the project README (clone + npm install && npm run build && npm link).
Call
x-search search "<query>"No route flag, no other flags for agents. The single search is always X-first with web fallback. Everything (model selection, token caps, timeout, caching, parallelism) is baked in at the cost/cache/efficiency-optimal default — do not look for knobs, there aren't any.
Pass --pretty only when output is going to a human. Default JSON is the stable contract; --pretty is not.
Output (compact JSON, one line on stdout)
{
"query": "...",
"results": [
{"url": "...", "title": "...", "snippet": "...", "date": "2026-05-22", "source": "x"}
],
"answer": "<1–3 sentence synthesis grounded in results>",
"citations": [{"url": "...", "quote": "..."}],
"cost_usd": 0.0021
}| Field | Meaning |
results[] | Raw hits in the order the model encountered them. Each carries source: "x" (from X/Twitter) or source: "web" (from the web-search fallback) |
answer | Short synthesis. Will be exactly "No results." if the search came up empty |
citations[] | URLs (+ short quote) that the answer drew from |
cost_usd | Actual call cost. Estimate computed locally from a pricing table — treat as approximate if providers change prices |
Required env
| Var | Used for |
XAI_API_KEY | the single Grok call (x_search + web_search) |
Pass directly; do not rely on a .env file unless you explicitly set XSEARCH_DOTENV=1 first.
Exit codes
| Code | Meaning |
| 0 | OK |
| 2 | Bad args (missing/empty query) |
| 3 | Missing API key |
| 4 | Provider error (network, HTTP error, rate limit) |
On non-zero exit, stdout contains {"error":{"code":"...","message":"...","provider":"..."}}.
Gotchas
- Always pays for one LLM round-trip. Even when you only want URLs, the model is forced to call its search tool and emit a synthesis. There's no "URLs-only" mode. Don't use
x-searchif you just need a generic web lookup and an LLM in the loop is overkill. - X-first, not web-first. The model prioritizes
x_search. If your query is really a generic web lookup with no X angle, expect mostlysource: "web"results — and consider whether a plain web search would serve you better. - Don't double-shell-quote. If your query contains double quotes, wrap it in single quotes:
x-search search 'site:example.com "claude opus"'— not nested doubles. - X results return x.com URLs. They're typically
x.com/<user>/status/<id>. External links inside posts are not separately enumerated — they appear inline insnippet. answer === "No results."is a real terminal state. Don't retry the same query; rephrase.--prettyoutput is not machine-stable. Never invoke with--prettyfrom another agent or pipeline — parse the default JSON.- No
--route,--full,--cost,--timeout,--model,--max-tokens, etc. exist. Don't pass them; cac will reject the invocation. The defaults are deliberate.
When NOT to use
- Query is answerable from training data (definitions, math, well-known general knowledge older than ~6 months).
- You need a non-search action (file edits, code generation, shell ops, calculations).
- You need raw URLs and no LLM synthesis —
x-searchalways burns an LLM round-trip. - The user wants Reddit / HN / Stack Overflow specifically — use a dedicated skill (
reddit-search,hn-search) if available.
Examples
# What people on X are saying about a release
x-search search "reactions to Claude 4.7 release on X"
# Real-time replies in a Twitter thread
x-search search "replies to elonmusk latest tweet about Grok"
# X-first, but the model may fall back to web docs if X is thin
x-search search "what people are saying about the B200 release notes"Recipe: parse the JSON
result=$(x-search search "reactions to Claude 4.7 on X")
echo "$result" | jq -r '.answer' # the synthesis
echo "$result" | jq -r '.results[].url' # all source URLs
echo "$result" | jq -r '.results[] | select(.source=="x") | .url' # X-only hits
echo "$result" | jq -r '.citations[].url' # only URLs the answer cited
echo "$result" | jq -r '.cost_usd' # log to your budget trackerIf $? is non-zero, the JSON is an error envelope — parse .error.code to branch (bad_args → fix call, missing_api_key → set env var, provider_error → retry).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

