OpenAIClaudeGoogle AI SearchPerplexity
Ask AI →
TL;DR
Instagram carousels drive 3-5x more engagement than single-image posts, but designing them traditionally means hours in Canva or Figma. Claude Code can generate production-ready carousel slides programmatically — handling everything from layout to typography to image generation. Here’s the complete workflow, from prompt engineering to PNG export, including the exact scripts you can run today.
The best Instagram carousel isn’t the one with the prettiest design. It’s the one that makes someone stop scrolling, swipe through all ten slides, and save it for later. Claude Code lets you build to that standard — programmatically.
— Chief Content Marketer

The Problem With Manual Carousel Creation

Instagram carousels are the highest-engagement content format on the platform. According to Meta’s own data, carousel posts generate 3.1x more engagement than single images and 1.4x more reach. But the creation process is broken. The typical workflow — open Canva, find a template, customize colors, write copy, export slides, realize the font sizes don’t match, re-export, and repeat — eats 45-90 minutes per carousel. For content teams publishing 3-5 carousels per week, that’s 4-8 hours of design work that adds zero strategic value.

Claude Code changes this completely. Because Claude Code has access to your file system, can execute Python scripts, and can generate images programmatically, it can produce an entire 10-slide carousel from a single prompt — with consistent branding, proper typography, and custom visuals. The output is a folder of PNG files ready to upload. The process takes about 5 minutes.

Step by Step: Building Your First Claude Code Carousel

Here’s the complete workflow. You’ll need Claude Code installed, Python 3 with Pillow (PIL), and 10 minutes.

1
Define Your Carousel Structure
Before touching code, map out your 10 slides. A high-performing B2B carousel structure: Slide 1 = hook (bold statement or question), Slides 2-3 = the problem, Slides 4-7 = the framework/steps, Slide 8 = proof/data, Slide 9 = key takeaway, Slide 10 = CTA + your brand. Write this outline in a text file and pass it to Claude Code as the creative brief.
2
Generate a Python Slide Builder Script
Ask Claude Code to write a Python script that generates each slide as a 1080×1080 PNG using Pillow. Specify your brand colors, fonts, and layout preferences. Claude Code handles the math — margins, font sizes, text wrapping, alignment. The script loops through your slide content array and outputs numbered PNG files.
3
Add Visual Elements With Image Generation
For slides that need illustrations, icons, or background imagery, Claude Code can call image generation tools directly. Prompt for on-brand visual style (“modern B2B, violet-indigo palette, clean geometric shapes, no photorealism”) and Claude Code generates the images, then composes them into your slide layout.
4
Review, Iterate, Export
Claude Code shows you the generated PNGs. Request adjustments conversationally — “make the headline larger on slide 1,” “swap the chart colors to match our brand palette.” Each iteration takes seconds. When you’re satisfied, the final PNGs are ready to upload to Instagram.
Pro Tip
Build a reusable carousel template script once, then feed Claude Code new content for each carousel. The script becomes your production line. The prompt becomes: “Using my carousel template at scripts/carousel.py, generate a 10-slide carousel about [topic]. Here’s the slide outline: [paste outline]. Use brand colors #2E1065, #A855F7, #F43F5E. Output to /carousels/topic-name/.”
Prompt
Write a Python script that generates a 10-slide Instagram carousel. 
Each slide is 1080x1080 PNG. Use Pillow.

Brand: #2E1065 (primary), #A855F7 (accent), #F43F5E (cta), #FAFAF9 (bg)
Fonts: Use default system fonts, bold for headlines, regular for body
Layout: 80px margins, headline at top, body centered, slide number bottom-right

Slide content array:
[
  {"type": "title", "headline": "The AI Content Strategy Playbook", "subtitle": "10 frameworks that actually work"},
  {"type": "text", "headline": "The Problem", "body": "76% of B2B teams use AI for content. But only 12% have a strategy."},
  ...
]

Output to /output/carousel-slide-01.png through carousel-slide-10.png

Adding Charts, Data Viz, and Custom Typography

Once you’ve mastered basic text slides, Claude Code can level up your carousels with data visualization. Ask it to generate bar charts, donut charts, or comparison tables directly in the slide — using matplotlib or Pillow drawing primitives. You can also use Claude Code to download and install custom fonts (like Inter or Space Grotesk) so your carousels match your brand typography perfectly.

The workflow for a data-driven carousel: pull stats from your research or analytics → Claude Code formats them into chart code → charts are rendered into slide canvases → text overlays are added for context → export. A carousel that shows proprietary data with branded visuals is the kind of content people screenshot and share — exactly the outcome you want.

Build Once, Ship Forever

The real power of this approach isn’t saving time on one carousel. It’s building a repeatable production system. Your first carousel script takes 10 minutes to get right. Your tenth takes 60 seconds — you paste the content, Claude Code runs the template, and you have 10 slides. A content team that was spending 6 hours a week on carousel design now spends 20 minutes. That’s 5+ hours recovered every week for strategy, research, and distribution — the work that actually moves the needle.

The Instagram algorithm rewards consistency. Claude Code makes consistency trivial. That’s the kind of unfair advantage worth building.

Get the Carousel Builder Script.
We’re sharing our production carousel template + prompt library with newsletter subscribers. Works with Claude Code out of the box. Drop in your content, get 10 branded slides.
Subscribe Free →