x-research
X Research
Agentic research over X/Twitter via Composio. Search, follow threads, deep-dive profiles, monitor accounts -- all at zero API cost.
CLI Tool
All commands run from this skill directory:
cd ~/clawd/skills/x-research
Search
bun run x-search.ts search "<query>" [options]
Options:
--sort likes|impressions|retweets|recent-- sort order (default: likes)--since 1h|3h|12h|1d|7d-- time filter (default: last 7 days)--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)--no-replies-- exclude replies--save-- save results to~/clawd/drafts/x-research-{slug}-{date}.md--json-- raw JSON output--markdown-- markdown output for research docs
Examples:
bun run x-search.ts search "to:xBenJamminx" --sort likes --since 1d
bun run x-search.ts search "from:xBenJamminx" --sort recent
bun run x-search.ts search "(claude code OR cursor) automation" --pages 2 --save
bun run x-search.ts search "@CortanaOps" --min-likes 5
Profile
bun run x-search.ts profile <username> [--count N] [--replies] [--json]
Fetches recent tweets from a specific user (excludes replies by default).
Thread
bun run x-search.ts thread <tweet_id> [--pages N]
Fetches full conversation thread by root tweet ID.
Single Tweet
bun run x-search.ts tweet <tweet_id> [--json]
Watchlist
bun run x-search.ts watchlist # Show all
bun run x-search.ts watchlist add <user> [note] # Add account
bun run x-search.ts watchlist remove <user> # Remove account
bun run x-search.ts watchlist check # Check recent from all
Watchlist stored in data/watchlist.json.
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:
- Core query: Direct keywords for the topic
- Expert voices:
from:specific known experts - Pain points: Keywords like
(broken OR bug OR issue OR migration) - Positive signal: Keywords like
(shipped OR love OR fast OR benchmark) - Links:
url:github.comorurl:specific domains
2. Search and Extract
Run each query via CLI. After each, assess:
- Signal or noise? Adjust operators.
- Key voices worth searching
from:specifically? - Threads worth following via
threadcommand? - Linked resources worth deep-diving with
web_fetch?
3. Follow Threads
When a tweet has high engagement or is a thread starter:
bun run x-search.ts thread <tweet_id>
4. Synthesize
Group findings by theme, not by query. Include engagement data and direct links.
5. Save
Use --save flag or save manually to ~/clawd/drafts/x-research-{topic-slug}-{YYYY-MM-DD}.md.
Reply Monitoring
To check replies to Ben:
bun run x-search.ts search "to:xBenJamminx" --sort likes --since 1d --limit 20
To check mentions of CortanaOps:
bun run x-search.ts search "@CortanaOps" --since 1d
File Structure
skills/x-research/
├── SKILL.md (this file)
├── x-search.ts (CLI entry point)
├── lib/
│ ├── api.ts (Composio API wrapper)
│ ├── 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)
Credits
Forked from rohunvora/x-research-skill. Adapted to use Composio instead of X API bearer token for zero-cost operation.