| name | x |
| description | Automate X (Twitter) for research, video understanding, and content creation. Use when navigating X, searching posts, analyzing videos, or creating content. |
| allowed-tools | Bash |
X Automation
Quick Reference
| Task | Trigger | Description |
|---|
| Navigate | "open x.com" | Open X, verify login |
| Search | "research posts about" | Search keyword, Top/Latest |
| Download video | "download video from" | Download with yt-dlp |
| Understand video | "understand this video" | Analyze with frames or audio |
| Compose | "create post about" | Draft content |
| Post | "post it" | Publish (requires approval) |
Navigate to X
When asked to open X or navigate to Twitter:
- Get browser tab:
mcp__claude-in-chrome__tabs_context_mcp(createIfEmpty: true)
- Create new tab:
mcp__claude-in-chrome__tabs_create_mcp()
- Navigate:
mcp__claude-in-chrome__navigate(url: "https://x.com", tabId: <id>)
- Wait for load:
mcp__claude-in-chrome__computer(action: "wait", duration: 3, tabId: <id>)
- Screenshot to verify:
mcp__claude-in-chrome__computer(action: "screenshot", tabId: <id>)
- Check for compose button = logged in
Error: If login page appears, stop and inform user to log in manually.
Search Posts
When asked to search or research posts:
- Find search box:
mcp__claude-in-chrome__find(query: "search bar", tabId: <id>)
- Click it:
mcp__claude-in-chrome__computer(action: "left_click", ref: <ref>, tabId: <id>)
- Type keyword:
mcp__claude-in-chrome__computer(action: "type", text: "$ARGUMENTS", tabId: <id>)
- Submit:
mcp__claude-in-chrome__computer(action: "key", text: "Enter", tabId: <id>)
- Wait:
mcp__claude-in-chrome__computer(action: "wait", duration: 2, tabId: <id>)
- Switch to Latest:
mcp__claude-in-chrome__find(query: "Latest tab") → click
- Read results:
mcp__claude-in-chrome__read_page(tabId: <id>)
Read Post Content
When navigating to a specific post URL:
- Navigate to post URL
- Wait for load:
mcp__claude-in-chrome__computer(action: "wait", duration: 2, tabId: <id>)
- Take screenshot:
mcp__claude-in-chrome__computer(action: "screenshot", tabId: <id>)
- Read DOM:
mcp__claude-in-chrome__read_page(tabId: <id>)
- Extract: author, text, timestamp, media type, engagement metrics
Download Video
When a post contains video and you need to understand it:
yt-dlp -o "downloads/%(id)s.%(ext)s" "<post_url>"
If download fails, try with browser cookies:
yt-dlp --cookies-from-browser chrome "<post_url>"
Check Video Audio
After downloading, check for audio:
ffprobe -v error -select_streams a -show_entries stream=codec_type -of csv=p=0 "<video_path>"
- Output contains "audio" → Has audio, use transcription
- Empty output → No audio, use frame extraction
Understand Silent Video (No Audio)
- Get duration:
ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "<video>"
- Extract frames every 3 seconds:
ffmpeg -i "<video>" -vf "fps=1/3" "frames/frame_%04d.png"
-
Read each frame visually with Claude
-
Synthesize what the video shows
-
Cleanup:
rm frames/*.png
Understand Video with Audio
- Extract audio:
ffmpeg -i "<video>" -vn -acodec mp3 "audio/temp.mp3"
- Transcribe with Whisper:
whisper "audio/temp.mp3" --model base --output_format txt --output_dir "transcripts/"
-
Read transcript and summarize content
-
Cleanup:
rm "audio/temp.mp3"
Compose Post
When creating content:
- Find compose button:
mcp__claude-in-chrome__find(query: "compose tweet button", tabId: <id>)
- Click it:
mcp__claude-in-chrome__computer(action: "left_click", ref: <ref>, tabId: <id>)
- Wait:
mcp__claude-in-chrome__computer(action: "wait", duration: 1, tabId: <id>)
- Type content:
mcp__claude-in-chrome__computer(action: "type", text: "<content>", tabId: <id>)
If uploading media:
5. Find media button: mcp__claude-in-chrome__find(query: "add photo", tabId: <id>)
6. Click it and upload file
7. Wait for upload: mcp__claude-in-chrome__computer(action: "wait", duration: 3, tabId: <id>)
CRITICAL: Do NOT click post button yet. Show user the draft first.
Post (Requires Approval)
NEVER post without explicit user approval.
- Show user the composed content
- Ask: "Should I post this to X?"
- Wait for explicit "yes" or approval
- Only then: find post button and click
Upload Image to Post
- Ensure compose dialog is open
- Find media button:
mcp__claude-in-chrome__find(query: "media upload", tabId: <id>)
- Click:
mcp__claude-in-chrome__computer(action: "left_click", ref: <ref>, tabId: <id>)
- Find file input in DOM:
mcp__claude-in-chrome__read_page(filter: "interactive", tabId: <id>)
- Set file:
mcp__claude-in-chrome__form_input(ref: <file_input>, value: "<image_path>", tabId: <id>)
- Wait for upload preview:
mcp__claude-in-chrome__computer(action: "wait", duration: 3, tabId: <id>)
- Verify image appears in compose box
Analyze Post Engagement
When researching what's performing well:
- Read post metrics from DOM
- Extract: replies, reposts, likes, views, bookmarks
- Calculate engagement rate
- Identify high-performing content patterns
Extract Trending Topics
When researching trends:
- Search for keyword
- Read multiple posts (5-10)
- Identify common themes, hashtags, phrases
- Summarize trending topics for content creation
Generate Content Ideas
Based on research:
- Analyze trending topics from research
- Identify humor patterns, meme formats in use
- Generate 2-3 content ideas
- Present to user for selection
Create Meme Concept
For meme creation:
- Based on selected idea, describe meme concept:
- Top text
- Bottom text
- Image description
- Use external tool (Gemini/Nano Banana Pro) to generate image
- Save to output directory
- Present to user for approval before uploading
Composite Workflows
Research and Post Workflow
Trigger: "research X and post about it"
- Navigate to X
- Search for keyword (Latest tab)
- For each post: read content, check for video, analyze engagement
- Extract trending topics
- Generate content ideas
- Present ideas to user
- Create meme concept
- Compose with content
- Upload meme image
- GET USER APPROVAL
- Post
Quick Research Workflow
Trigger: "what's trending about X"
- Navigate to X
- Search for keyword (Top tab)
- Read top 5 posts
- Summarize findings
- Return summary (no posting)
Video Understanding Workflow
Trigger: "understand the video in this post"
- Navigate to post URL
- Download video with yt-dlp
- Check if video has audio
- If audio: extract and transcribe with Whisper
- If no audio: extract frames every 3 seconds
- Analyze content (transcript or frames)
- Summarize key takeaways
- Cleanup temporary files
Safety Rules
- NEVER auto-post without explicit user approval
- Always show composed content before posting
- Log all posting actions
- Respect X rate limits - pause if limited
- Read-only by default - posting requires explicit command
Error Recovery
Page Not Loading
- Retry navigation 3 times
- Increase wait duration each attempt
Element Not Found
- Try alternative query terms
- Scroll page and retry
- Take screenshot to diagnose
Login Required
- Stop immediately
- Inform user: "Please log into X manually, then retry"
Video Download Failed
- Try with --cookies-from-browser chrome
- Check if post is accessible
- Inform user of failure
Whisper Failed
- Fall back to visual frame analysis
- Inform user transcription unavailable