Noureddine RAMDI / Open Carrusel: a local AI-powered Instagram carousel builder with Claude Code subprocess

Created Mon, 04 May 2026 10:23:02 +0000 Modified Sat, 23 May 2026 20:41:27 +0000

Hainrixz/open-carrusel

Open Carrusel tackles a very specific problem: building Instagram carousel slides locally, enriched by AI-generated content, without any cloud dependency. It uses Claude Code as an AI subprocess that generates HTML/CSS slides on the fly, then renders and exports them as exact Instagram-sized PNGs. The cleverness is in spawning Claude Code as a subprocess that talks to the app through curl POSTs, creating a tight loop where the AI directly writes slide HTML, bypassing any intermediate DSL or API abstraction.

What open carrusel does and how it is architected

Open Carrusel is an open-source Instagram carousel builder designed to run entirely on localhost. It’s a local-first app that stores slides as JSON files on disk, with no database or cloud service involved. At its core, the app uses HTML and CSS as the domain-specific language for slides, which are stored as body-level HTML strings. This allows for high flexibility in slide design.

The AI component is Claude Code, run as a subprocess from the /api/chat endpoint. This subprocess is wrapped with Bash and WebFetch tools, enabling it to generate HTML slides and send them back to the app via curl POST requests in real time using Server-Sent Events (SSE). This architecture means the AI agent can directly manipulate the app’s state without needing any intermediate JSON DSL or additional API layers.

Slides are previewed inside sandboxed iframes to ensure isolation and security, and the same HTML wrapping function (wrapSlideHtml()) feeds both the preview and the export pipeline. For exporting, the app uses Puppeteer to launch a headless Chromium browser that renders slides as pixel-perfect PNG images at Instagram’s exact dimensions: 1:1 (1080×1080), 4:5 (1080×1350), and 9:16 (1080×1920).

Local file storage uses JSON files with atomic writes managed by an async mutex to avoid concurrency issues. This keeps the architecture minimal and straightforward — no user authentication, no multi-user concurrency, and no cloud dependencies.

What makes open carrusel’s AI subprocess integration stand out

The standout technical feature is the use of Claude Code as a subprocess AI agent that communicates through Bash scripts and curl POSTs. This approach avoids the common complexity of JSON intermediate languages or multi-layered API calls often seen in AI-powered apps. Instead, the LLM directly outputs HTML slide content, which is posted back to the server API in real time.

This tight coupling between the AI subprocess and the app state simplifies the data flow and reduces serialization/deserialization overhead. It also means the same wrapping function ensures the preview and export outputs are WYSIWYG — what you see in the iframe preview is exactly what you get in the exported PNG.

The tradeoff here is that this design is opinionated and minimalistic. It’s single-user only, no auth or cloud sync features are baked in. Slide storage is local JSON files, which means no shared or collaborative editing out of the box. However, for a local-first design, this keeps the codebase lean and avoids external dependencies.

On the export side, Puppeteer introduces a startup cost: the first run downloads about 300 MB of Chromium, taking 1–2 minutes. Afterward, launches are quick. This dependency is necessary to achieve pixel-perfect rendering at Instagram’s exact aspect ratios, a must-have for professional-quality carousel posts.

Overall, the codebase is surprisingly clean and focused. The concurrency control on file writes with async-mutex is a solid choice to avoid file corruption in a local JSON store. The SSE streaming of the AI subprocess output provides a responsive UI experience. The slide rendering pipeline is straightforward but effective.

Quick start with open carrusel

The README provides two ways to get started: the recommended one-command path using Claude Code, and a manual path if you don’t use Claude Code. Here’s the one-command method verbatim:

# One-command path (recommended)
# 1. Install Claude Code and authenticate.
# 2. Clone and open the repo in Claude Code:
git clone https://github.com/Hainrixz/open-carrusel.git
cd open-carrusel
claude
# 3. In the Claude Code prompt, type:
/start

This boots the dev server, installs dependencies, and opens your browser. You can then chat with the AI to design carousels.

If you don’t have Claude Code installed, the manual path still lets you use the editor and export static slides, but the AI chat feature won’t be available:

git clone https://github.com/Hainrixz/open-carrusel.git
cd open-carrusel
npm run setup        # installs deps + seeds /data/
npm run dev          # starts http://localhost:3000

Who should consider open carrusel?

Open Carrusel is a good fit if you want a local-first, AI-powered Instagram carousel builder with no cloud dependencies. It’s especially relevant for solo creators or developers who want control over their data and slide content.

The subprocess AI integration is clever and lightweight, delivering a responsive chat-driven design experience. The Puppeteer export ensures pixel-perfect output that professionals will appreciate.

However, if you need multi-user support, online collaboration, or cloud syncing, this app won’t meet those needs out of the box. Also, the initial Puppeteer setup cost might be a hurdle in some environments.

In sum, Open Carrusel is a neat example of blending AI subprocess control with local file architecture for a focused creative tool. Worth understanding if you’re exploring local-first AI workflows or need precise HTML/CSS slide exports for social media.


→ GitHub Repo: Hainrixz/open-carrusel ⭐ 215 · TypeScript