A Claude Code skill that provides real-time X/Twitter social data and insights via a configurable backend plus optional direct calls to the official X API.
- Tweets: Fetch recent tweets from any user
- Hot/Trending: Find trending tweets by time, region, and tag
- Ghost Tweets: Detect deleted tweets
- Profile Traces: Track profile change history (bio, name, avatar)
- Social Tracking: Monitor follow/unfollow actions
- KOL Ranking: Deep account analysis with rankings and MBTI
- Tweet Detail: Get full details of any tweet by URL or ID
- Content Draft: Generate tweet ideas from viral topics
- Node.js
- Third-party API Key: Set
XFETCH_API_KEYfor the configurable backend - Official X API Token: Set
XFETCH_X_BEARER_TOKENfor directapi.x.comcalls - Optional API Host Override: Set
XFETCH_API_HOSTto a bare hostname only - Legacy env fallback disabled by default:
XCLAW_API_KEYandCRYPTOHUNT_API_KEYare only read whenXFETCH_ALLOW_LEGACY_ENV=1
- Do not inline tokens in the command line or commit them to config files.
- Keep third-party backend credentials separate from official X API bearer tokens unless you explicitly intend to reuse them.
XFETCH_API_HOSTrejects localhost,.local, and URL-style values with protocol or path.- Network requests time out after 15 seconds and large responses are capped.
Copy the xfetch.js and SKILL.md files into your Claude Code skills directory:
mkdir -p ~/.claude/skills/xfetch
cp xfetch.js SKILL.md ~/.claude/skills/xfetch/# Fetch recent tweets
node xfetch.js tweets CryptoPainter_X 20
# Trending tweets (last 24h, CN region)
node xfetch.js hot 24 cn AI
# Deleted tweets
node xfetch.js ghost elonmusk
# Profile change history
node xfetch.js traces CryptoPainter_X
# Follow/unfollow tracking
node xfetch.js social CryptoPainter_X
# Deep KOL analysis
node xfetch.js rank CryptoPainter_X
# Tweet detail
node xfetch.js detail 1234567890
# Content ideation from viral topics
node xfetch.js draft 24 cn--full: Include raw text and HTML content in output--verbose: Backend-specific expansion flag. It is ignored for directapi.x.comtweet fetches.
All commands output formatted JSON to stdout. The tweets and hot commands use a "slim" format by default that extracts: author, title, abstract, engagement metrics, time, and link.
MIT