How to make Instagram carousels with Claude Code

Claude Code can write the slides, lay them out as HTML and render them to images. The hard parts are fixed sizes, text that fits, JPEG export and posting through Meta's API. You can build that yourself, or connect Claude Code to hookflock's local MCP server and let the app handle rendering and posting.

What a carousel pipeline needs

  1. BriefWho it is for, the problem, one feature.
  2. CopyHook, body slides, last slide. Claude Code is good at this.
  3. LayoutOne HTML page per slide at 1080 x 1350.
  4. RenderHeadless browser to JPEG, under 8 MB.
  5. PostMeta app, token, public image URLs, three API calls.
Five steps from idea to a scheduled post. Claude Code is good at the first two; the last three are plumbing.

The do-it-yourself way

1. Write the copy

Give Claude Code a short brief: who the app is for, the problem, one feature, the tone. Ask for a hook under 10 words, 5 to 8 body slides with one idea each, and a last slide that earns the save.

A prompt that works
Write an Instagram carousel for Receiptly, an iPhone app that scans receipts for freelancers.
Slide 1: a hook under 10 words with a number.
Slides 2-6: one tip each, 6 to 20 words, same structure every slide.
Slide 7: a one-line takeaway and "Comment SCAN for the link".
No em dashes, no hashtags on slides, no promises about money saved.

2. Lay out the slides as HTML

Ask for one HTML file per slide at exactly 1080 x 1350 CSS pixels, with your fonts and colours. Tell it to keep 60 px margins and to shrink the text if a line overflows.

3. Render to JPEG

A headless browser (Playwright or Puppeteer) screenshots each page. Save as JPEG, not PNG: the Instagram API takes JPEG only, at most 8 MB per image.

Render one slide with Playwright (Node)
import { chromium } from 'playwright'
const browser = await chromium.launch()
const page = await browser.newPage({ viewport: { width: 1080, height: 1350 } })
await page.goto('file://' + process.cwd() + '/slide-1.html')
await page.screenshot({ path: 'slide-1.jpg', type: 'jpeg', quality: 90 })
await browser.close()

4. Post it

Posting by API needs a Meta app, a Business or Creator account, an access token with publishing permission, and a public HTTPS URL for every slide that Meta can download. Then you create one container per slide, a carousel container that lists them, and publish it. Most people stop here and post by hand from their phone.

Where the DIY way breaks

  • Fonts: a font that loads late renders as the fallback in the screenshot.
  • Text overflow: a long tip runs off the slide, and nobody notices until it is posted.
  • Sizes: a square slide 1 crops every other slide to a square.
  • Tokens: Instagram tokens expire and need refreshing, and they should never sit in a project folder an agent can read.
  • Hosting: slide URLs must stay up until Meta has fetched them, and short-lived links fail with error 9004 / 2207052.

The hookflock way: connect Claude Code to the app

hookflock runs a local MCP server on your Mac. Claude Code calls its tools to read your product, pick a format, write drafts, check originality and schedule posts. The app renders the slides at the right size, and the Instagram token stays on our server, never in your terminal.

Add the server once (Terminal). The app shows your real token.
claude mcp add --transport http hookflock http://127.0.0.1:41751/mcp --header "Authorization: Bearer <token from hookflock>"

You can also install the hookflock skill for Claude Code from the app's Settings. It teaches Claude the workflow: product, then results, then a blueprint, a draft, an originality check and the queue. See the MCP server page for every client.

Prompts to try

  • "Make three carousels for my app from the tips-list blueprint and put them in the queue."
  • "Check which of last month's posts got the most saves and make the next draft in that format."
  • "Remake this post's idea for my app, then run the originality check."

Making, editing and exporting drafts through the MCP server works today, for free. Posting and scheduling are rolling out once Meta approves the app.

Receiptly5 receipts freelancers forget to keep
1The co-working day pass you paid in cash
2The app you pay for every month and never think about
3The train ticket to a client meeting
Save thisSnap each one the day you pay. Comment SCAN for the app.
Output from the prompt above, rendered by the app at 1080 x 1350 for a fictional app.

Which way to choose

Do it yourselfhookflock
CostYour time, plus hostingFree to make; one payment to post
Slide sizes and JPEG exportYou write and test itBuilt in
Text that fitsYou check every slideChecked before export
Posting through the APIYour own Meta app and reviewOur approved app (once Meta approves it)
Works withClaude CodeClaude Code, Codex, Gemini CLI, Cursor

Either way, keep the slide count between 6 and 10 (Instagram allows up to 20) and read the hooks guide before you write slide 1.

Questions

Can Claude Code post to Instagram by itself?
Not without help. Posting needs a Meta app, an access token and public image URLs. An MCP server such as the one in the Mac app can do that part for it.
Do I need an Anthropic API key?
No. hookflock runs the Claude Code you already have, signed in the way you already use it.
Does this work with Codex or Gemini CLI?
Yes. The same local MCP server works with Codex, Gemini CLI, Cursor and other MCP clients.

Sources

Facts checked against these pages on . Meta changes its docs often; tell us at hookflock@ascodelabs.com if something is out of date.

hookflock is a Mac app that makes original carousels for your app with the AI tools you already use. Making and exporting is free. Posting them on schedule rolls out once Meta approves the app.