
x-research
Search-driven X/Twitter research skill that brings real-time posts into Claude Code sessions.
- version
- 1.0.0
- GitHub stars
- 537
What it does
- Adds an
x-researchskill backed by the X API v2 for searches, profiles, threads, and watchlists - Covers keyword search with engagement sorting and time filtering, plus a quick mode for cheap lookups
- Caches results for 15 minutes to avoid repeat API charges on identical queries
- Designed for developers who need live product feedback, dev discussion, or breaking news from X
Searches X/Twitter for real-time perspectives, dev discussions, product feedback, breaking news, and expert opinions using the X API v2
Add marketplace
/plugin marketplace add trailofbits/skills-curatedRun it inside Claude Code once, then install the plugin below.
Install
/plugin install x-research@skills-curatedRun it inside Claude Code after adding the marketplace.
Files
Discovered from sourceX Research
Agentic research over X/Twitter. Decompose research questions into targeted searches, iteratively refine, follow threads, deep-dive linked content, and synthesize sourced briefings.
For X API details (endpoints, operators, response format): read
{baseDir}/skills/x-research/references/x-api.md.
Prerequisites
- X API Bearer Token -- set
X_BEARER_TOKEN(orXAI_API_KEY) env var - Python 3.11+ and uv (
pip install uvor https://docs.astral.sh/uv/)
CLI Tool
All commands use uv run for automatic dependency management:
Search
uv run {baseDir}/skills/x-research/scripts/x_search.py 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)--quick-- quick mode: 1 page, max 10 results, auto noise filter, 1hr cache--from-user <username>-- shorthand forfrom:usernamein query--quality-- filter low-engagement tweets (min 10 likes, post-hoc)--no-replies-- exclude replies--save-- save results to~/x-research-output/--json-- raw JSON output--markdown-- markdown output for research docs
Auto-adds -is:retweet unless query already includes it. All searches display estimated API cost.
Examples:
uv run {baseDir}/skills/x-research/scripts/x_search.py search "claude code" --sort likes --limit 10
uv run {baseDir}/skills/x-research/scripts/x_search.py search "from:anthropic" --sort recent
uv run {baseDir}/skills/x-research/scripts/x_search.py search "(cursor OR windsurf) AI editor" --pages 2 --save
uv run {baseDir}/skills/x-research/scripts/x_search.py search "AI agents" --quick
uv run {baseDir}/skills/x-research/scripts/x_search.py search "AI agents" --quality --quick
Profile
uv run {baseDir}/skills/x-research/scripts/x_search.py profile <username> [--count N] [--replies] [--json]
Fetches recent tweets from a specific user (excludes replies by default).
Thread
uv run {baseDir}/skills/x-research/scripts/x_search.py thread <tweet_id> [--pages N]
Fetches full conversation thread by root tweet ID.
Single Tweet
uv run {baseDir}/skills/x-research/scripts/x_search.py tweet <tweet_id> [--json]
Watchlist
uv run {baseDir}/skills/x-research/scripts/x_search.py watchlist # Show all
uv run {baseDir}/skills/x-research/scripts/x_search.py watchlist add <user> [note] # Add account
uv run {baseDir}/skills/x-research/scripts/x_search.py watchlist remove <user> # Remove
uv run {baseDir}/skills/x-research/scripts/x_search.py watchlist check # Check recent
Watchlist stored in {baseDir}/skills/x-research/data/watchlist.json.
Cache
uv run {baseDir}/skills/x-research/scripts/x_search.py cache clear
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 - Noise reduction:
-is:retweet(auto-added), add-is:replyif needed - Spam filter: Add
-airdrop -giveaway -whitelistfor crypto-adjacent topics
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
WebFetch?
3. Follow Threads
When a tweet has high engagement or is a thread starter:
uv run {baseDir}/skills/x-research/scripts/x_search.py thread <tweet_id>
4. Deep-Dive Linked Content
When tweets link to GitHub repos, blog posts, or docs, fetch with WebFetch. Prioritize links that:
- Multiple tweets reference
- Come from high-engagement tweets
- Point to technical resources directly relevant to the question
5. Synthesize
Group findings by theme, not by query:
### [Theme/Finding Title]
[1-2 sentence summary]
- @username: "[key quote]" (NL, NI) [Tweet](url)
- @username2: "[another perspective]" (NL, NI) [Tweet](url)
Resources shared:
- [Resource title](url) -- [what it is]
6. Save
Use --save flag or save manually.
Refinement Heuristics
- Too much noise? Add
-is:reply, use--sort likes, narrow keywords - Too few results? Broaden with
OR, remove restrictive operators - Spam flooding results? Add
-$ -airdrop -giveaway -whitelist - Expert takes only? Use
from:or--min-likes 50 - Substance over hot takes? Search with
has:links
When to Use
- Researching what developers/experts/community thinks about a topic
- Getting real-time perspectives on breaking news or product launches
- Finding technical discussions about libraries, frameworks, or APIs
- Monitoring what key accounts are posting about
- Gathering sourced evidence for competitive analysis or market research
- Quick pulse check on a topic before deeper investigation
When NOT to Use
- Posting tweets, replying, or managing an X account (read-only tool)
- Historical research beyond 7 days (uses recent search endpoint only)
- Searching non-X platforms (use web search tools instead)
- Tasks where web search provides better results (X is best for real-time opinions, discussions, and breaking news -- not reference docs)
Cost Awareness
X API uses pay-per-use pricing ($0.005/post read, $0.01/user lookup). Quick mode
keeps costs under ~$0.50/search. Always check the cost display after each search.
Cache prevents duplicate charges. See references/x-api.md for full pricing.
File Structure
skills/x-research/
SKILL.md (this file)
scripts/
x_search.py (CLI entry point, run with uv)
x_api.py (X API wrapper)
x_cache.py (file-based cache, 15min TTL)
x_format.py (terminal + markdown formatters)
data/
watchlist.json (accounts to monitor)
cache/ (auto-managed)
references/
x-api.md (X API endpoint reference)
Readme
x-research
X/Twitter research agent for Claude Code. Search, filter, monitor -- all from the terminal.
Install
/plugin install trailofbits/skills-curated/plugins/x-research
Prerequisites
- X API Bearer Token -- get one from the X Developer Portal
- Python 3.11+ and uv -- https://docs.astral.sh/uv/
- Set
X_BEARER_TOKENorXAI_API_KEYenvironment variable
What It Covers
- Search with engagement sorting, time filtering, noise removal
- Quick mode for cheap, targeted lookups (~$0.50/search)
- Profiles -- recent tweets from any user
- Threads -- full conversation by root tweet ID
- Watchlists for monitoring accounts
- Cache to avoid repeat API charges (15min TTL)
- Agentic research loop -- decompose questions, search iteratively, follow threads, synthesize
Usage
Natural language (just talk to Claude):
- "What are people saying about Claude Code?"
- "Search X for React Server Components"
- "Check what @anthropic posted recently"
CLI (via the agent):
uv run scripts/x_search.py search "your query" --sort likes --limit 10
uv run scripts/x_search.py search "AI agents" --quick
uv run scripts/x_search.py profile anthropic
uv run scripts/x_search.py thread TWEET_ID
uv run scripts/x_search.py watchlist check
Cost
X API uses pay-per-use pricing ($0.005/post read). Quick mode keeps costs under ~$0.50/search. Cache prevents duplicate charges. 24-hour deduplication at the API level means re-running searches within a day costs less.
Credits
Imported from rohunvora/x-research-skill. Original TypeScript implementation by rohunvora, converted to Python for this plugin. License: MIT.
Details
- Marketplace
- trailofbits/skills-curated
- Source
- plugins/x-research
- Author
- rohunvora
- Category
- Community
- Listed since
- Apr 7, 2026
More from trailofbits/skills-curated
All 29- ffuf-web-fuzzingv1.0.0
- ghidra-headlessv1.0.0
- humanizerv2.2.0
- last30daysv1.0.0
- openai-cloudflare-deployv1.0.0
- openai-develop-web-gamev1.0.0
- openai-docv1.0.0
- openai-gh-address-commentsv1.0.0
- openai-gh-fix-civ1.0.0
- openai-jupyter-notebookv1.0.0
- openai-netlify-deployv1.0.0
- openai-pdfv1.0.0
- openai-playwrightv1.0.0
- openai-screenshotv1.0.0
- openai-security-best-practicesv1.0.0
- openai-security-ownership-mapv1.0.0
- openai-security-threat-modelv1.0.0
- openai-sentryv1.0.0
- openai-spreadsheetv1.0.0
- openai-yeetv1.0.0
- planning-with-filesv1.0.0
- productivityv1.0.0
- python-code-simplifierv1.0.0
- react-pdfv1.0.0
Similar to x-research
More Social Media
X (Twitter) MCP Server by XquikMCP serverxquik-dev229 starsStructured X (Twitter) data and actions via Xquik's REST API, with search, profiles, and bulk exports.
last30daysPlugintrailofbits/skills-curated537 starsResearches any topic from the last 30 days across Reddit, X, and the web, surfacing real community discussions with engagement metrics
twitterSkillstarchild-ai-agent/official-skills7.9K installsRead-only Twitter/X data access for tweets, user profiles, followers, search, and trends through twitterapi.io.
blog-discourseSkillagricidaniel/claude-blog2.6K installsResearch what people are saying about a topic across Reddit, X, YouTube, HN, and dev.to, API-free.
socai-social-researchPluginsocai-io/socai258 starsResearch public posts, comments, creators, and trends on Xiaohongshu, Douyin, TikTok, Instagram, LinkedIn, and X/Twitter with the local socai CLI and the user's
social-media-research-skillsPluginScrapeCreators/social-media-research-skills6.7K starsPractical social media research workflows powered by ScrapeCreators: find outlier posts, mine comments, analyze transcripts, research competitors, and tear down