X Research
by @aviclaw
General-purpose X/Twitter research agent. Searches X for real-time perspectives, dev discussions, product feedback, cultural takes, breaking news, and expert...
clawhub install x-researchπ About This Skill
name: x-research version: 1.0.0 description: > General-purpose X/Twitter research agent. Searches X for real-time perspectives, dev discussions, product feedback, cultural takes, breaking news, and expert opinions. Works like a web research agent but uses X as the source. Use when: (1) user says "x research", "search x for", "search twitter for", "what are people saying about", "what's twitter saying", "check x for", "x search", "/x-research", (2) user is working on something where recent X discourse would provide useful context (new library releases, API changes, product launches, cultural events, industry drama), (3) user wants to find what devs/experts/community thinks about a topic. NOT for: posting tweets, account management, or historical archive searches beyond 7 days.
X Research
General-purpose agentic research over X/Twitter. Decompose any research question into targeted searches, iteratively refine, follow threads, deep-dive linked content, and synthesize into a sourced briefing.
For X API details (endpoints, operators, response format): read references/x-api.md.
CLI Tool
All commands run from this skill directory:
cd ~/clawd/skills/x-research
source ~/.config/env/global.env
Search
bun run x-search.ts search "" [options]
Options:
--sort likes|impressions|retweets|recent β sort order (default: likes)--since 1h|3h|12h|1d|7d β time filter (default: last 7 days). Also accepts minutes (30m) or ISO timestamps.--min-likes N β filter by minimum likes--min-impressions N β filter by minimum impressions--pages N β pages to fetch, 1-5 (default: 1, 100 tweets/page)--limit N β max results to display (default: 15)--quick β quick mode: 1 page, max 10 results, auto noise filter (-is:retweet -is:reply), 1hr cache, cost summary--from β shorthand for from:username in query--quality β filter low-engagement tweets (β₯10 likes, post-hoc)--no-replies β exclude replies--save β save results to ~/clawd/drafts/x-research-{slug}-{date}.md--json β raw JSON output--markdown β markdown output for research docsAuto-adds -is:retweet unless query already includes it. All searches display estimated API cost.
Examples:
bun run x-search.ts search "BNKR" --sort likes --limit 10
bun run x-search.ts search "from:frankdegods" --sort recent
bun run x-search.ts search "(opus 4.6 OR claude) trading" --pages 2 --save
bun run x-search.ts search "$BNKR (revenue OR fees)" --min-likes 5
bun run x-search.ts search "BNKR" --quick
bun run x-search.ts search "BNKR" --from voidcider --quick
bun run x-search.ts search "AI agents" --quality --quick
Profile
bun run x-search.ts profile [--count N] [--replies] [--json]
Fetches recent tweets from a specific user (excludes replies by default).
Thread
bun run x-search.ts thread [--pages N]
Fetches full conversation thread by root tweet ID.
Single Tweet
bun run x-search.ts tweet [--json]
Watchlist
bun run x-search.ts watchlist # Show all
bun run x-search.ts watchlist add [note] # Add account
bun run x-search.ts watchlist remove # Remove account
bun run x-search.ts watchlist check # Check recent from all
Watchlist stored in data/watchlist.json. Use for heartbeat integration β check if key accounts posted anything important.
Cache
bun run x-search.ts cache clear # Clear all cached results
15-minute TTL. Avoids re-fetching identical queries.
Research Loop (Agentic)
When doing deep research (not just a quick search), follow this loop:
1. Decompose the Question into Queries
Turn the research question into 3-5 keyword queries using X search operators:
from: specific known experts(broken OR bug OR issue OR migration)(shipped OR love OR fast OR benchmark)url:github.com or url: specific domains-is:retweet (auto-added), add -is:reply if needed-airdrop -giveaway -whitelist if crypto topics flooding2. Search and Extract
Run each query via CLI. After each, assess:
from: specifically?thread command?web_fetch?3. Follow Threads
When a tweet has high engagement or is a thread starter:
bun run x-search.ts thread
4. Deep-Dive Linked Content
When tweets link to GitHub repos, blog posts, or docs, fetch with web_fetch. Prioritize links that:
5. Synthesize
Group findings by theme, not by query:
### [Theme/Finding Title][1-2 sentence summary]
@username: "[key quote]" (NL, NI) Tweet
@username2: "[another perspective]" (NL, NI) Tweet Resources shared:
Resource title β [what it is]
6. Save
Use --save flag or save manually to ~/clawd/drafts/x-research-{topic-slug}-{YYYY-MM-DD}.md.
Refinement Heuristics
-is:reply, use --sort likes, narrow keywordsOR, remove restrictive operators-$ -airdrop -giveaway -whitelistfrom: or --min-likes 50has:linksHeartbeat Integration
On heartbeat, can run watchlist check to see if key accounts posted anything notable. Flag to Frank only if genuinely interesting/actionable β don't report routine tweets.
File Structure
skills/x-research/
βββ SKILL.md (this file)
βββ x-search.ts (CLI entry point)
βββ lib/
β βββ api.ts (X API wrapper: search, thread, profile, tweet)
β βββ cache.ts (file-based cache, 15min TTL)
β βββ format.ts (Telegram + markdown formatters)
βββ data/
β βββ watchlist.json (accounts to monitor)
β βββ cache/ (auto-managed)
βββ references/
βββ x-api.md (X API endpoint reference)