Post to X (Twitter) from Claude Code
Claude Code can write, schedule, and publish X posts through Postiz. Add the Postiz MCP server with one terminal command, sign in with OAuth, and then ask Claude Code to tweet, split a launch note into a thread, restrict who can reply, or post into an X Community, all without leaving your codebase.
Please make sure there is always a human in the loop.
Last updated: September 2026
How to post to X from Claude Code
Add the Postiz MCP server to Claude Code once, sign in with OAuth, connect X in Postiz, and then describe the post in plain language. Setup takes about a minute.
Setup once, then just ask
# One-time setup: add the Postiz MCP server (OAuth, no API key)
claude mcp add --transport http postiz https://mcp.postiz.com/mcp-oauth-dynamic
# Or install the Postiz skill instead
npx skills add gitroomhq/postiz-agent
export POSTIZ_API_KEY=your_api_key
# Then ask Claude Code:
> Turn CHANGELOG.md into a 5-tweet thread
about v2.4 and schedule it on X for
tomorrow at 9am, everyone can reply
Claude Code: Done! 5-tweet thread scheduled
on X for tomorrow at 9:00 AM.What can Claude Code do on X?
On X, Claude Code can publish single tweets, ordered threads, media posts, and X Community posts, and it can set who is allowed to reply to each one.
Reply Controls
Control who can reply to your posts: everyone, people you follow, mentioned users, subscribers, or verified accounts only.
Thread Support
Ask for a thread and Claude Code splits it into separate tweets, posted in order.
Community Posting
Post directly to X Communities by providing a community URL. Reach targeted audiences with relevant content.
Simple Text Posts
Quickly publish text-only tweets with hashtags, mentions, and links. No media upload required for basic posts.
Media Attachments
Attach images or videos to your posts. Upload media through Postiz and include it seamlessly in your scheduled tweets.
Scheduled Posting
Schedule posts with precise timestamps. Queue up a week of content in minutes and let Postiz handle the publishing.
How does Claude Code post to X through Postiz?
You describe what you want in plain language and Claude Code handles the Postiz calls for you. Here is how a typical conversation goes.
Find Your X Integration
Ask Claude Code whether your X account is connected. It also checks which options the platform supports.
Example conversation
> Is my X account connected to Postiz?
Claude Code: Yes โ your X account is connected
and ready. Want me to post something?Compose Your Content
Describe your tweet or thread. Ask for a thread and Claude Code splits it into separate tweets; mention an image or video and it uploads it for you.
Example conversation
> Draft an X post about our new
feature launch
Claude Code: Here's a draft for X:
"We just shipped something big..."
Want me to add media and schedule it?Schedule & Publish
Schedule your post for a specific time or publish immediately. Set reply controls and optionally target an X Community.
Example conversation
> Yes โ add screenshot.png and schedule
it for tomorrow at 9am
Claude Code: Done! Scheduled on X for
tomorrow at 9:00 AM.X Settings Reference
Mention any of these in plain language and Claude Code sets them for you. These are the X options it can apply to any post.
| Field | Type | Description |
|---|---|---|
__type | string | Must be "x" |
who_can_reply_post | string | Who can reply: everyone, following, mentionedUsers, subscribers, verified |
community | string | X Community URL to post into |
Common Configurations
Ask Claude Code for any of these common X scenarios and it applies the matching settings.
Public Post โ Everyone Can Reply
Just ask
> Post it with: Public Post โ Everyone Can Reply
Claude Code: Got it. Applying:
who_can_reply_post: everyoneFollowers Only Replies
Just ask
> Post it with: Followers Only Replies
Claude Code: Got it. Applying:
who_can_reply_post: followingCommunity Post with Verified Replies
Just ask
> Post it with: Community Post with Verified Replies
Claude Code: Got it. Applying:
who_can_reply_post: verified
community: https://x.com/i/communities/1234567890Mentioned Users Only
Just ask
> Post it with: Mentioned Users Only
Claude Code: Got it. Applying:
who_can_reply_post: mentionedUsersExample prompts for X in Claude Code
These are prompts you can type into a Claude Code session, or pass to claude -p in a script. Claude Code reads your repo, calls Postiz, and confirms before publishing.
Launch thread from your repo
Claude Code
> Read README.md and write a 6-tweet thread
introducing the project. Schedule it on X
for Monday 10am with ./assets/hero.png on
the first tweet.
Claude Code: Drafted 6 tweets (each under 280
characters). Uploaded hero.png. Scheduled
on X for Monday 10:00 AM.Community post with limited replies
Claude Code
> Post "New release: v2.4 is out with dark mode
and 2x faster builds" to my X account and
the community https://x.com/i/communities/123,
only verified accounts can reply
Claude Code: Posted to X with
who_can_reply_post: verified and the
community link attached.Headless from a release script
Claude Code
$ claude -p "Summarize the git log since the last
tag as one tweet and schedule it on X via
Postiz for today at 4pm."
# Runs without an interactive session,
# ideal for a GitHub Action or cron jobX limits and gotchas to know
X enforces a few rules that Claude Code and Postiz respect automatically, but knowing them helps you phrase requests.
- โStandard X accounts are limited to 280 characters per post. Ask for a thread when the message is longer and Claude Code splits it into ordered tweets.
- โwho_can_reply_post is required on every X post. If you do not mention reply controls, Claude Code uses everyone.
- โTo post into an X Community, give Claude Code the full community URL; it goes into the community setting.
- โMedia is uploaded through Postiz first, so reference a local file path (./assets/hero.png) and Claude Code handles the upload.
- โClaude Code asks for permission before it publishes. Keep that prompt on for anything that goes live.
What is Claude Code?
Claude Code is Anthropic's agentic coding tool that lives in your terminal. It handles software engineering tasks โ writing features, fixing bugs, and answering questions about your codebase โ and it can run shell commands and MCP tools like Postiz.
Not the same as Claude Cowork (Anthropic's desktop agent for knowledge workers) or the Postiz connector for Claude.ai (chat in the browser or desktop app). Claude Code runs in your terminal and IDE and can read your repository while it writes X posts.
Terminal & IDE Native
Claude Code runs in your terminal, with extensions for VS Code and JetBrains. You type what you want in plain English and it handles Postiz for you.
Agentic Execution
Claude Code plans and works through multi-step tasks on its own โ discovering channels, uploading media, and scheduling posts โ and asks for permission before it acts.
Parallel Tasks
Run several Claude Code sessions side by side, or spawn subagents in one. Schedule posts to different platforms while it handles other coding work.
How Postiz Works with Claude Code
Claude Code discovers Postiz through the Postiz skill or the Postiz MCP server. It reads the SKILL.md (or the MCP tool list) to learn what it can do, then chains calls together for social media workflows.
- โInstall the Postiz skill, or add the Postiz MCP server with claude mcp add
- โClaude Code discovers the Postiz tools over MCP, or reads SKILL.md when you use the skill
- โMCP route: sign in with OAuth, no API key. Skill route: set POSTIZ_API_KEY
- โClaude Code asks for permission before running commands
- โWorks alongside your coding tasks in parallel
Install Postiz
# Option A: add the Postiz MCP server
claude mcp add --transport http postiz https://mcp.postiz.com/mcp-oauth-dynamic
# Option B: install the Postiz skill
npx skills add gitroomhq/postiz-agent
export POSTIZ_API_KEY=your_api_key
# Then just ask
claude "list my social media integrations"X Posting with Claude Code
Tell Claude Code what to post from your terminal or IDE โ it discovers your integrations via Postiz and handles the entire publishing workflow.
Just Ask Claude Code
Terminal and IDE integration
Tell Claude Code what to post from your terminal or IDE โ it discovers your integrations via Postiz and handles the entire publishing workflow.
Claude Code CLI
$ claude "Post to X about our
new feature launch, schedule for
tomorrow at 9am"
Claude Code: I'll handle that.
Found your X integration.
Composing and scheduling the post.
Done! Your post is scheduled.
Post ID: abc-123Parallel Tasks
Multiple tasks at once
Claude Code runs headless with claude -p, so several tasks can run in parallel. Schedule posts to different platforms while it works on other coding tasks.
Claude Code Parallel Tasks
# Run multiple posting tasks in parallel
$ claude -p "Schedule a post about our
launch to X for tomorrow 9am" &
$ claude -p "Write a LinkedIn article
about our new feature and schedule
for tomorrow noon" &
$ claude -p "Fix the bug in auth.ts"
# All three tasks run simultaneouslyWhy Claude Code + Postiz for X
Claude Code's autonomous execution makes Postiz a natural fit. The agent reads the SKILL.md to understand every available command, then autonomously chains them together for X workflows.
- โRuns in your terminal or IDE โ just type what you want
- โPermission-based execution โ you stay in control
- โParallel task support โ post while coding
- โReads SKILL.md for automatic command discovery
- โCross-post to X + other platforms in a single session
- โPowered by Claude โ Anthropic's most capable models
SKILL.md (auto-discovered)
---
name: postiz
description: Social media automation
CLI for scheduling posts across
30+ platforms including X
metadata:
claude-code:
requirements:
env:
- POSTIZ_API_KEY
binaries:
- postiz
---
# Available Commands
- postiz integrations:list
- postiz integrations:settings <id>
- postiz posts:create
- postiz upload <file>
- postiz analytics:platform <id>
# X Settings
who_can_reply_post, communityAlso Works with Claude Cowork
Postiz works with any AI agent that can run commands or call MCP tools. That includes Claude Cowork, Anthropic's desktop agent, and the Claude.ai connector. See the agents overview for every supported agent.
Claude Cowork
by Anthropic
Claude Cowork reads the Postiz skill so it knows what it can do, then autonomously discovers your X integration, composes your tweet or thread, applies reply settings, and schedules the post.
Claude Cowork
> Post a thread about our product launch
on X, schedule for tomorrow, everyone
can reply
Claude Cowork: Done! Scheduled on X for
tomorrow at 9:00 AM.Post to X and other platforms from Claude Code
One request can schedule the same content to X and other channels, and each platform keeps its own settings. Every platform below has its own Claude Code guide.
Example
> Post "Excited to announce our new feature!" to
X and LinkedIn tomorrow at 9am, then schedule
a daily tip on X every weekday at 10am
Claude Code: Done! Scheduled:
- X + LinkedIn: tomorrow 9:00 AM
- Daily tips on X: Mon-Fri 10:00 AMSee all 25 platforms in the Claude Code social media guide, compare agents on the AI agents overview, read about the Postiz MCP server, or check pricing. For the channel itself, seeX scheduling features in Postiz.
Reply Options
Everyone
everyoneFollowing
followingMentioned Users
mentionedUsersSubscribers
subscribersVerified
verifiedX and Claude Code: frequently asked questions
How do I post to X from Claude Code?
Run claude mcp add --transport http postiz https://mcp.postiz.com/mcp-oauth-dynamic once, sign in to Postiz in the browser, and connect your X account in Postiz. Then type a plain-language request in Claude Code, such as asking for a scheduled tweet. Claude Code calls the Postiz tools, applies X settings, and confirms the scheduled time.
Can Claude Code post a thread on X?
Yes. Ask for a thread and Claude Code splits the content into separate tweets under 280 characters each, keeps them in order, and can attach different media to each tweet. Postiz publishes them as a native X thread at the scheduled time, so you do not have to paste tweets one by one.
Which X settings can Claude Code control through Postiz?
Two settings are exposed for X: who_can_reply_post (everyone, following, mentionedUsers, subscribers, or verified) and community (an X Community URL). Mention either in plain language, for example asking that only verified accounts reply, and Claude Code sets the matching field before it schedules the post.
Can I tweet from CI or a cron job with Claude Code and Postiz?
Yes. Claude Code has a headless mode, claude -p, that runs a single prompt and exits. Call it from a shell script, a cron entry, or a GitHub Action after a release, and Postiz publishes the tweet at the time you asked for. The MCP server or skill must already be configured on that machine.
Do I need an X API key to use Claude Code with Postiz?
No. You connect your X account inside Postiz once with OAuth, and Claude Code authenticates to Postiz over OAuth when you add the MCP server. There is no X developer key, bearer token, or API key to paste. If you prefer the Postiz skill route, the only key is your POSTIZ_API_KEY.
Is posting to X from Claude Code different from using the Claude.ai connector?
The workflow is the same idea, but Claude Code runs in your terminal or IDE and can read your repo while writing tweets. The Claude.ai directory connector works in chat and lacks image, video, and clipping tools. Adding the custom MCP link in Claude Code gives you the full Postiz toolset.
Start posting to X
Install Postiz Agent and automate your X content strategy with AI-powered scheduling and publishing.