Post to Instagram from Claude Code

One plugin install and Claude Code can render, caption and publish to Instagram from the same terminal session the creative was built in.

Hermoso is a marketing MCP server: 830+ tools over one OAuth’d endpoint that let an agent research the ads already running in a market, generate finished image and video ads, publish them, and build the paid campaigns behind them. Claude Code reaches all of it through one connection. This page is about one slice of that — what Claude Code can actually do on Instagram, and what Instagram will not let it do.

Connect Hermoso to Claude Code

  1. One command, and no key.
    claude plugin marketplace add hermoso-ai/hermoso && claude plugin install hermoso@hermoso
    Already inside a session? Type /plugin marketplace add hermoso-ai/hermoso, then /plugin install hermoso@hermoso. It installs four Hermoso skills (research, ad-from-brand, generate, product-photoshoot) that run the hermoso command through npx, so no tool list is loaded into your sessions and nothing costs context until it runs.
  2. Sign in once.
    npx -y hermoso auth login
    It opens a browser sign-in on loopback, the way gh does, and stores an owner-only credential in ~/.hermoso/config.json. Claude Code runs it for you the first time it needs Hermoso. No browser on that machine, say CI, a remote box or a container? Create a key under Settings → Agents & API keys and run npx -y hermoso auth login --token hmk_…. A key carries real spend authority, so treat it like a password.
  3. Optional: the MCP server as well. If you also want Hermoso’s tools in Claude Code’s own tool list, run claude mcp add hermoso -- npx -y hermoso mcp after signing in. It reads the same stored credential, so no key goes into .claude.json. The skills reach every tool without it.
  4. Ask Claude Code for something. “Pull my three closest competitors’ longest-running ads and remix the best hook into a 9:16 video,” or “post this render to the channel.” The agent picks the tools; you approve the spend.

The plugin and the optional MCP server reach the same tools and the same account. The difference is context: a tool list is loaded into every session before you type anything, while the skills cost nothing until a command runs.

Then connect Instagram itself, once, under Settings → Connectors in Hermoso. That is an OAuth consent screen, so it is the one step that needs a browser — everything after it is a tool call.

The Instagram tools Claude Code gets

  • post_to_meta — publishes to Instagram with target: "instagram". Instagram is a visual channel and the API agrees — a post needs an image or a video.
  • schedule_post — queues it on the shared calendar, with a per-channel caption if the copy should differ from your Facebook or LinkedIn version.
  • list_meta_comments / reply_to_meta_comment / moderate_meta_comment — read, reply and moderate under a post.
  • meta_page_insights / meta_post_insights — reach, impressions, saves and engagement, per account and per post.
  • search_instagram — keyword search across public Instagram Reels — research, not publishing.

Two Instagram facts worth knowing before you automate anything. There is no native Instagram scheduling in Meta’s API, so a schedule is Hermoso’s queue rather than Instagram’s, and passing Facebook’s scheduleAt for Instagram is refused rather than silently posted now. And an Instagram caption cannot be edited once the post is live: the only thing Meta lets you change on a published post is whether comments are enabled. Deleting one is supported — manage_meta_post removes ordinary posts, Stories, Reels and entire carousel albums, though never a single card out of an album.

Instagram limits worth knowing before you automate anything

TextAn Instagram caption is capped at 2,200 characters. It is enforced when the post is created or queued — refused while you are still there to fix it, rather than silently cut on the way out.
VisibilityPublic only. Meta’s Content Publishing API publishes, full stop — “Instagram publishes immediately when it publishes at all — it has no unlisted, private or draft post.” If you want a review step on Instagram, it has to happen before the call, not after.
Carousel2 to 10 slides, and images and video may be mixed. That upper bound is Meta’s own, quoted in the capability table it enforces: “Carousels are limited to 10 images, videos, or a mix of the two.” The floor of 2 is ours, because one slide is not a carousel on any platform — a single-slide ask publishes as an ordinary post rather than being refused.
Which accountpageId — Instagram publishes through the connected Facebook Page, so the same identity field selects it.

Try it in Claude Code

Ask for it in ordinary language — these are sentences, not a DSL:

“Build a 5-slide carousel from ./assets/slides, check each one is under Instagram's limits, publish it, and save the permalink to the release notes.”

That walks search_instagramplan_adrender_adpost_to_meta (target: "instagram"). Claude Code asks before it runs a tool, and the transcript is right there in the terminal — so a publish step is a line you can read before you press y.

Claude Code on Instagram: the part that bites

An Instagram caption cannot be edited once the post is live, so build the assertion into the script rather than the apology: have Claude Code show you the slide order and the caption, and only then call the publish tool. If a render turns out wrong, manage_meta_post deletes the whole post, albums included. Order matters more than people expect — slide 2 must follow slide 1, and Hermoso preserves the order you pass exactly.

The plugin carries no tool manifest, which matters most on a long unattended run: the agent shells out to the hermoso command per step, and --json on any command gives it machine output to assert on.

Research Instagram before you post

search_meta_ads covers Instagram placements as well as Facebook — it is one library. For organic, search_instagram searches public Reels by keyword, which is the surface where the format actually moves; profile and hashtag pulls go through fetch_social_data and search_instagram_hashtag.

The paid half

Instagram placements are bought through the same Meta campaign tree as Facebook: create_meta_campaigncreate_meta_adsetcreate_meta_ad, with placements selectable per platform and position. preview_meta_ad shows the real rendered ad per placement before you spend, and meta_insights breaks results down by age, gender, placement and country — which is the input to the next creative, not just a total.

What Claude Code cannot do on its own

An agent with a budget is only useful if the blast radius is bounded, so the fence is in the server rather than in a prompt. Every ad campaign, ad set, ad group and ad is created paused, and the status switches that arm real money refuse to run without an explicit confirmation flag. Every render is quoted first — hermoso_capabilities publishes each model’s exact credit cost before anything spends — and credits are reserved before the first provider call and settled at the exact cost afterwards, so a failed dispatch refunds rather than leaving you billed for nothing. Deletes are confirm-gated too, and every campaign tree is read back from the ad platform before your agent tells you what it built.

One step is deliberately not headless: linking an account is an OAuth consent screen, so you connect the channel once in a browser. Everything after that is a tool call.

The rest of the matrix

From Claude Code, post to: Facebook · Threads · TikTok · YouTube · X · LinkedIn · Pinterest — or see everything Claude Code can publish to.

Post to Instagram from: Claude · ChatGPT · Cursor · Codex · Cline · OpenClaw · Grok Bot · Hermes · Claude Code marketing

Frequently asked questions

Can Claude Code post to Instagram?

Yes, with Hermoso's Claude Code plugin. One command: claude plugin marketplace add hermoso-ai/hermoso && claude plugin install hermoso@hermoso, or inside a session /plugin marketplace add hermoso-ai/hermoso then /plugin install hermoso@hermoso. It installs four Hermoso skills that drive the hermoso CLI, so no tool list is loaded into your sessions. Sign in once with npx -y hermoso auth login, which opens a browser and stores the credential itself, so there is no key to create and none to paste. Claude Code then has 830+ tools, including the ones that publish to Instagram — and the ones that research the ads already running in your market and render the creative in the first place.

How do I connect Instagram to Claude Code?

Two steps, once each. One command: claude plugin marketplace add hermoso-ai/hermoso && claude plugin install hermoso@hermoso, or inside a session /plugin marketplace add hermoso-ai/hermoso then /plugin install hermoso@hermoso. It installs four Hermoso skills that drive the hermoso CLI, so no tool list is loaded into your sessions. Sign in once with npx -y hermoso auth login, which opens a browser and stores the credential itself, so there is no key to create and none to paste. Then connect Instagram inside Hermoso under Settings → Connectors, which is an OAuth consent screen in a browser. After that Claude Code publishes to Instagram as an ordinary tool call.

Does Claude Code need my Instagram password?

No. You connect Instagram to Hermoso once through an OAuth consent screen in a browser, and Claude Code then reaches it as a tool call. Linking an account is the one step that is not headless; nothing after it needs a password, and no credential is ever handed to the model.

Can Claude Code schedule a Instagram post for later?

Yes. schedule_post queues it on one calendar shared with every other channel, with a per-channel caption if the copy should differ, and list_scheduled and cancel_scheduled read and pull it back. Instagram is one of the ten channels that queue.

Start free — 30 credits at signup and 250+ more to earn, and every feature on every plan.

Start free   See pricing