planpo.st
FeaturesFor AI agentsRevenue trackingPlatformsPricingBlogSupport
Sign inStart free trial →
planpo.st

Social scheduling with revenue built in. One platform for creators and businesses who treat social as a growth engine.

Product

SchedulerFor creatorsFor agenciesCompare toolsAlternativesPricing

Channels

InstagramLinkedInX (Twitter)ThreadsFacebookYouTubeTikTokAll channels →

AI agents

MCP serverFor AI agentsClaude CodeCursorChatGPTGemini CLIAll agents →

Revenue

Revenue trackingRevenue attributionStripeShopifyRevenueCatAll integrations →

Resources

DocsMCP toolsAPI referenceBlogAboutSupportContactPrivacyTerms

Compare planpo.st

  • planpo.st vs Postiz
  • planpo.st vs Buffer
  • planpo.st vs Hootsuite
  • planpo.st vs Later
  • planpo.st vs Sprout Social
  • planpo.st vs SocialBee
  • planpo.st vs Planable
  • planpo.st vs Metricool
  • planpo.st vs Loomly
  • planpo.st vs Publer
  • planpo.st vs Post Bridge
  • planpo.st vs Mixpost
  • planpo.st vs Blotato
  • planpo.st vs Typefully
  • planpo.st vs RecurPost
  • planpo.st vs Post Planner
  • All comparisons →
  • Alternatives →
© 2026 planpo.st · all rights reservedstatus: ● all systems normal
  1. Home
  2. /AI agents
  3. /Claude Code
  4. /X (Twitter)
Claude Code · X (Twitter)

How to post to X (Twitter) from Claude Code

This is the pairing I use most. The repo is already open, so the post about a release is written from the commits that made it, and because planpo.st sends no links to X, Claude Code writes copy that stands without a URL.

Start 7-day free trial →Claude Code setup docs
On this pageStepsWhat worksSettingsPromptsLimitsRevenueFAQ

How do I post to X from Claude Code?

Add the planpo.st MCP server to Claude Code, connect X once in the dashboard, then ask. The first three steps are one-time.

  1. 1

    Create an API key and add planpo.st to Claude Code

    Make a scoped key in planpo.st under Settings. Run one claude mcp add command. The hosted form points at mcp.planpo.st and installs nothing. The local form runs the planpost-mcp package through npx, needs Node 18 or newer, and keeps the API key on your machine.

  2. 2

    Confirm the server is connected

    Run claude mcp list and check that planpost shows as connected.

  3. 3

    Connect X

    Connect the X account in the planpo.st dashboard under Connections. OAuth needs a person at a browser, so the agent cannot do this part alone; it can call get_connection_link and hand you the URL to open.

  4. 4

    Know what the post needs

    An X post needs text of 280 characters or fewer with no URL in it. That includes bare domains such as example.com, which X turns into links by itself. Nothing in platformSettings is required.

  5. 5

    Ask in your terminal

    Say what to post and when. Claude Code finds the X connection, creates the post, and tells you whether it was scheduled or kept as a draft, with the reason.

Hosted, nothing to install
claude mcp add --transport http planpost https://mcp.planpo.st/mcp \
  --header "Authorization: Bearer pk_live_xxx"
Local, key stays on your machine
claude mcp add planpost -e PLANPOST_API_KEY=pk_live_xxx -- npx -y planpost-mcp

Replace pk_live_xxx with your own key.

Hosted or local for Claude Code?

For Claude Code I use the hosted one. It is a single command, there is nothing to keep updated, and a new tool on the server shows up the next time Claude Code starts. Pick local when a policy says the key must not leave the machine in a config that points at someone else's server.

  • Run `claude mcp list` afterwards to confirm the server is connected.
  • The local route needs Node 18 or newer.

The full walkthrough is on the Claude Code setup page.

What can Claude Code do on X?

It can schedule single posts and threads, reply to or quote an existing post, and keep a separate X version of a post that also goes to other networks. It cannot attach media or include a link.

Single post

280

Text up to 280 characters. If the shared text is longer, put a shorter cut in platformContent.twitter and the other networks keep the long one.

Thread

2 to 25

postType "thread" with threadSegments, each segment 1 to 280 characters. A thread post can target X and nothing else, so the other networks get their own post.

Reply or quote

platformSettings.twitter.replyToId publishes the post as a reply to that post ID, quoteTweetId as a quote of it.

Not available

limits

Images, video, polls and links. Attachments on a post that targets X are left out of the X version and the text goes out alone.

There is nothing to upload for X, since posts go out as text. When the same post also targets a network that takes images, Claude Code sets platformMedia so the picture goes there and X gets the words.

Which settings does a X post take?

X has two optional settings and no required ones. Most of what shapes an X post sits outside platformSettings, in the post type and the per-network text, so those rows are listed too.

FieldAllowed valuesIf you leave it outWorth knowing
platformContent.twitterText, 280 characters or fewer, no URLThe shared contentOver 280 here is rejected with a 400. If the shared content is over 280 and this is absent, the post is saved as a draft with char_limit.
postType"post" or "thread""post""thread" with any network other than X in connectionIds returns 400: Thread can only publish to X (Twitter).
threadSegments2 to 25 strings, each 1 to 280 charactersNoneRequired when postType is "thread". Fewer than 2 segments or a segment over 280 returns 400.
platformSettings.twitter.replyToIdID of the post to reply toNot a replyIgnored for threads, which chain their own replies.
platformSettings.twitter.quoteTweetIdID of the post to quoteNot a quoteSent as quote_tweet_id on a single post.
media, platformMedia.twitterNot usedText onlyAttachments are skipped at publish. The post still goes out, without them.

What do I type to post to X from Claude Code?

Plain requests work. Each example lists the tool calls Claude Code makes in response.

1. One post, no link

You say

Read the commits since Monday. Write one post about the most interesting part and schedule it on X for tomorrow 09:00 Europe/Warsaw. Keep every URL and domain name out of it.

Tool calls

list_connections()
create_post({ content: "<240 characters, no URL>", connectionIds: ["<x id>"], schedule: "tomorrow 09:00 Europe/Warsaw" })

One scheduled post. If a link slips into the text, create_post saves it as a draft and returns link_in_x_post with the offending URL, so the fix is a rewrite and an update_post.

2. A thread

You say

Open CHANGELOG.md in this repo. Turn it into a five-post thread for X, one point per post, and schedule it for Thursday 17:00.

Tool calls

create_post({ content: "<first segment>", postType: "thread", threadSegments: ["<1>", "<2>", "<3>", "<4>", "<5>"], connectionIds: ["<x id>"], schedule: "thursday 17:00" })

A thread of five posts, each checked against 280 characters when it is created. The segments publish in order as replies to the one before.

3. Link on the other networks, clean cut on X

You say

Use the notes in docs/launch.md. Post it to LinkedIn, Threads and X at 10:00 tomorrow. LinkedIn and Threads get the link, X gets a version without it.

Tool calls

create_post({ content: "<text with https://...>", platformContent: { twitter: "<same idea, no URL>" }, connectionIds: ["<linkedin id>", "<threads id>", "<x id>"], schedule: "tomorrow 10:00" })
preview_post({ id: "<post id>" })

One post, three networks. preview_post shows the text each one receives and its character count, so you can see the X version is link-free before the slot arrives.

What stops a X post from Claude Code?

The tag on a card is the code that comes back in the tool result.

No links, anywhere

link_in_x_post

The X API bills a post with a URL at $0.20 and one without at $0.015, and every thread segment is billed as its own post. planpo.st rejects links in anything it sends to X instead of passing a 13 times surcharge on.

Bare domains count

X links example.com with no https in front, so the check catches it too. Writing "planpo.st" in an X post trips it.

280 characters per post

char_limit

Counted on the text X receives: platformContent.twitter when it is set, the shared content when it is not. Threads are checked per segment.

Text only

Images and video are not attached to X posts today. The post publishes without them and the other networks on the same post keep theirs.

A thread is its own post

A thread cannot share a post with LinkedIn or Threads. Create the thread for X, then a second post for the rest.

A thread can stop halfway

If a segment fails, the ones before it are already live. The result is marked failed and lists the IDs that did publish.

Check the server before the prompt

Claude Code

If Claude Code says it has no tool for posting, the server is not connected. claude mcp list tells you in one line, and it is faster than rephrasing the request.

Can Claude Code tell me what a X post earned?

On X, mostly no, and I would sooner say so. Revenue is matched to a post through the tracked link in it, and planpo.st sends no links to X, so an X post has no click to match a payment to. get_revenue_overview still returns your totals and recent transactions. The practical setup is to let the same idea carry its tracked link on LinkedIn or Threads, where links are clickable, and read the per-post numbers there.

Stripe integration How revenue attribution works

Claude Code and X: questions people ask

Can Claude Code attach an image to an X post?
No. planpo.st publishes X posts as text only today. An attachment on a post that targets X is left out of the X version, and the other networks on the same post still receive it.
Why does planpo.st reject links in X posts?
Cost. The X API charges $0.20 for a post that contains a URL and $0.015 for one that does not. Each reply and each thread segment is billed the same way, so moving the link into a reply only adds a request. The API returns the reason and the URL it found.
How long can a thread be?
2 to 25 segments, each 1 to 280 characters. A thread post targets X only.
What happens when Claude Code sends a X post that breaks a rule?
It is told at once. The usual case on X is a URL in the X copy: the post is kept as a draft and the tool result carries link_in_x_post plus the fix, which Claude Code applies with update_post.
Do I need the hosted or the local server to post to X?
Either. Both expose the same tools and both can publish to X. Hosted is one command with nothing installed; local keeps the key in your own environment and needs Node 18 or newer.
Can I run this from a script or a scheduled job?
Yes. Claude Code runs non-interactively with a prompt as its argument, so a weekly job can ask for the X posts and exit. Use a scoped API key for it and keep new posts on draft or approval until you trust the output.

Keep going

X from other agents

Cursor to XClaude Desktop to XChatGPT to XGemini CLI to XCodex CLI to XGoogle Antigravity to XHermes Agent to X

Other networks from Claude Code

Claude Code to ThreadsClaude Code to LinkedInClaude Code to InstagramClaude Code to FacebookClaude Code to YouTubeClaude Code to TikTok

Background

Claude Code overviewClaude Code setupX scheduling guideMCP tool reference