Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Search the web or X/Twitter using xAI Grok server-side tools (web_search, x_search) via the xAI Responses API. Use when you need tweets/threads/users from X, want Grok as an alternative to Brave, or you need structured JSON + citations.
.claude/skills/sundial-org-grok-search/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-10 | ✗→✓ | ▲ Improved | -19% | 0% |
| case-11 | ✗→✓ | ▲ Improved | -29% | 0% |
| case-14 | ✗→✓ | ▲ Improved | -29% | 0% |
| case-15 | ✗→✓ | ▲ Improved | -19% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 2% | 0% |
Run xAI Grok locally via bundled scripts (search + chat + model listing). Default output for search is pretty JSON (agent-friendly) with citations.
The script looks for an xAI API key in this order:
XAI_API_KEY env var~/.clawdbot/clawdbot.json → env.XAI_API_KEY~/.clawdbot/clawdbot.json → skills.entries["grok-search"].apiKeyskills.entries["search-x"].apiKey or skills.entries.xai.apiKeyUse {baseDir} so the command works regardless of workspace layout.
node {baseDir}/scripts/grok_search.mjs "<query>" --webnode {baseDir}/scripts/grok_search.mjs "<query>" --xnode {baseDir}/scripts/chat.mjs "<prompt>"node {baseDir}/scripts/chat.mjs --image /path/to/image.jpg "<prompt>"node {baseDir}/scripts/models.mjsOutput:
--links-only print just citation URLs--text hide the citations section in pretty output--raw include the raw Responses API payload on stderr (debug)Common:
--max <n> limit results (default 8)--model <id> (default grok-4-1-fast)X-only filters (server-side via x_search tool params):
--days <n> (e.g. 7)--from YYYY-MM-DD / --to YYYY-MM-DD--handles @a,@b (limit to these handles)--exclude @bots,@spam (exclude handles)json{ "query": "...", "mode": "web" | "x", "results": [ { "title": "...", "url": "...", "snippet": "...", "author": "...", "posted_at": "..." } ], "citations": ["https://..."] }
citations are merged/validated from xAI response annotations where possible (more reliable than trusting the model’s JSON blindly).--x for tweets/threads, --web for general research.Other measured skills in the registry, with their headline benchmark lift.