Guide · Agent skill
How to use the X (Twitter) Operations agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The X skill lets an AI agent act on your X (Twitter) account through the official X API v2 and the xurl command-line tool. It can post single tweets, threads and media, publish long-form X Articles, search recent tweets, fetch your bookmarks, look up profiles and read tweets. This guide explains what the skill does, how to install it, how to trigger it with plain requests, and what setup and safety checks you need before it touches a live account.
Quick start
- 1Download and unzip the skill. Download the ZIP from this page and unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder. In the Claude apps, upload the ZIP under Settings → Capabilities → Skills.
- 2Install Bun and xurl. The tools need the Bun runtime to run the TypeScript files, and xurl is the official X command-line tool that the skill calls.
- 3Create your X developer app and grant. Register an X developer app, put its client ID and secret in ~/.claude/.env, and complete an OAuth 2.0 user grant with the bookmark, tweet, users and media scopes.
- 4Create Config.md and choose a token store. Create LIFEOS/USER/CUSTOMIZATIONS/SKILLS/X/Config.md and select local or cloudflare-kv in its yaml block, following Setup.md.
- 5Run the dry run and status check. Run the post dry run and expect the success line with exit code 0. Run bookmarks.ts status and expect READY as the last line.
- 6Make a first request. Ask the agent in plain words, such as searching recent posts, and confirm any draft it shows you before approving a live post.
What the X skill makes the agent do
An agent skill is a folder of instructions and tools that an AI agent loads when your request matches the skill's triggers. This one covers X operations: posting, reading, searching, profile lookups, Articles and bookmarks.
Other skills in the same library delegate their X work to it, so credentials and the OAuth 2.0 token store are kept in one place rather than in each skill.
- Post single tweets, threads and media (video, image or GIF)
- Publish long-form X Articles, with drafts created by default
- Search recent tweets and read tweets by ID or URL
- Look up user profiles, optionally with recent tweets and their engagement metrics
- Fetch bookmarks, and sweep new bookmarks into GitHub idea-issues with LifeOS Upgrade analysis
- Delete tweets by ID
Install the X skill from the download
Download the ZIP from the skill's page in this directory and unzip it into one of two locations. Use ~/.claude/skills/ for a personal install available to all your projects, or a project's .claude/skills/ folder to limit it to that project.
If you use the Claude apps instead of Claude Code, upload the ZIP under Settings → Capabilities → Skills.
- Personal install: unzip into ~/.claude/skills/
- Project install: unzip into the project's .claude/skills/ folder
- Claude apps: Settings → Capabilities → Skills, then upload the ZIP
Set up X credentials and the token store
Before any posting or bookmark work, you need an X developer app with a client ID and client secret, and an OAuth 2.0 user grant that includes the bookmark, tweet, users and media scopes. The secrets go in ~/.claude/.env, and the skill never hardcodes them.
Create LIFEOS/USER/CUSTOMIZATIONS/SKILLS/X/Config.md with a yaml block that chooses the token store. The local option keeps a 0600 file on your machine that the skill refreshes. The cloudflare-kv option stores tokens in a KV namespace that another process, such as a scheduled Worker, refreshes. The Setup.md file in the skill covers the field table and a first-run check.
Without Config.md, reads still work on the bearer token and posting falls back to OAuth 1.0a text-only. Media, Articles, bookmarks and delete all stop with an error that points you to Setup.md.
- Required: Bun runtime and the xurl CLI
- Required: X developer app with TWITTER_CLIENT_ID and TWITTER_CLIENT_SECRET
- Required: X_BEARER_TOKEN for reads
- Optional: OAuth 1.0a keys for text-only posting fallback
- Required for the bookmark sweep: GitHub repository access
Check that the setup works
Run the dry run first. It validates tweet text without posting anything. If it prints the success line and exits with code 0, tweet validation works.
For bookmarks, run the status check. It is read-only and prints the names and states of settings, never their values. The last line should be READY. If it says NOT READY and exits with code 1, a config file, a required secret or the OAuth 2.0 grant is missing.
- Expected dry-run output: "Dry run — all tweets valid. No posts sent." with exit code 0
- Expected status result: last line READY; NOT READY means something is missing
bun "${CLAUDE_CONFIG_DIR:-$HOME/.claude}/skills/X/Tools/post.ts" --dry-run "Testing my X setup"
bun "${CLAUDE_CONFIG_DIR:-$HOME/.claude}/skills/X/Tools/bookmarks.ts" statusHow to trigger the skill with natural requests
You do not need to type commands. Ask in plain language and the agent routes the request to the right intent. Phrases such as "post to X", "tweet", "post thread", "search X", "fetch bookmarks", "read tweet", "X article", "lookup user" and "authorize X" are the main triggers.
The skill asks for your confirmation before anything reaches your account. A post is reported as done only after the agent reads it back and checks the text and links.
- "Post this thread to X: ..." for a multi-tweet thread
- "Search X for recent posts about ..." to find tweets
- "What have I bookmarked this week?" to fetch bookmarks
- "Check bookmarks for upgrades" to run the sweep into idea-issues
- "Who is @username on X?" for a profile lookup
- "Read this tweet: <URL>" to fetch a tweet by link
Use the xurl CLI and other commands directly
The xurl CLI is the official X command-line tool. The skill uses it for quick API calls that no tool covers. These examples come from the skill's documentation.
For posting, the skill recommends its own post tool for threads. Articles are drafted by default; the --publish flag makes them public, and publishing cannot be undone through the API. Media uploads use the media tool, and tweets can be deleted by ID.
- xurl /2/users/me for your own account details
- xurl /2/tweets/<id> to read a tweet
- Articles: create a draft from a markdown file, then publish only when you are sure
- Media: upload a clip with the media tool
- Delete: pass one or more tweet IDs to the delete tool
xurl /2/users/me
xurl /2/tweets/1234567890
xurl "/2/tweets/search/recent?query=from:<username>&max_results=10"
bun run article.ts create --file piece.md
bun run media.ts upload clip.mp4
bun run delete.ts <id> [<id> ...]What people use it for
- A creator drafts a thread in their agent, reviews it, and posts it with media to X.
- Someone who saves many posts runs a bookmark sweep that turns relevant bookmarks into GitHub idea-issues for a project tracker.
- A developer with an X app pulls a profile with recent tweets and engagement metrics into a script or report.
- A writer drafts a long-form X Article as a draft, reviews it, and publishes it once it is final.
Frequently asked questions
Is the X agent skill free to use?
The skill is released under the MIT licence. Using the X API itself is governed by X's own plans and terms, and the skill's source does not list prices, so check your X developer account for current limits.
What do I need before I can install the X skill?
You need the Bun runtime, the xurl CLI, and an X developer app with a client ID and secret. You also need an OAuth 2.0 user grant with bookmark, tweet, users and media scopes, plus a Config.md file that chooses a token store.
How do I install the X skill for Claude?
Download the ZIP from the skill's page and unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder. In the Claude apps, upload the ZIP under Settings → Capabilities → Skills.
Can the agent post to X without my approval?
No. The skill is designed to ask for your confirmation before anything is published, and it reports a post as done only after reading it back. Posting is irreversible, so review the text and links first.
What should I do if the bookmark status says NOT READY?
Read the status output to see which item is missing, such as the config file, a secret or the OAuth 2.0 grant. If the grant is missing or revoked, run the bookmarks authorize step and open the consent URL it shows you.
Is there an alternative if I want to post the same content to several platforms?
Yes. The skill itself says multi-platform posting is handled by a different skill, named Broadcast in its source. Social copywriting is also out of scope and needs a copywriting skill.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Choose this skill if you already have an X developer app and want your agent to draft and post tweets, threads or Articles, or to triage your bookmarks into a project tracker. Skip it if you have no developer app, want to post to several platforms at once, or need bulk collection of X data beyond what the X API plan allows.
Download the skill