All articles
Webdesign 6 min read

Motion Graphics with Claude Code: How 40 Clips Were Built as Code

Claude Code motion graphics: the real workflow behind 40 clips – storyboard prompt, seek(t), frame checks and MP4. Every prompt included.

Paul Mill

Automation & AI

A row of brushed steel plates standing like frames of a flip book, with a disc of cobalt blue glass in the middle
Table of contents

Motion graphics with Claude Code means: Claude Code doesn’t open a design tool. It writes the animation as code — HTML, Canvas or WebGL — checks individual frames itself and renders the result to an MP4. The entire Motion Library on this website was made this way: 40 clips, about twelve minutes in total, each with the prompt to rebuild it.

This article shows the workflow as it actually runs — not a one-prompt demo, but how a clip gets from the first sentence to the finished file. What motion graphics are in general and which types exist is covered in Motion Graphics with AI.

Why Claude Code instead of After Effects

After Effects works with layers and keyframes. Claude Code works with files. That sounds like a drawback, but for many kinds of motion graphics it is the actual advantage:

  • Everything is text. Timing, colours, spring stiffness, scene changes — every decision is a number in the code and can be changed precisely: “scene 3 half a second earlier” is one line, not thirty keyframes to drag.
  • Physics and maths come for free. A ring that really bounces, a glass whose fill level is computed from its area, a mosaic whose tiles follow the contours: you write it once as a function instead of animating it by hand.
  • Variants cost nothing. German and English, portrait and landscape, a different brand colour — same code, different parameter.

The limit is just as clear: code animations handle typography, shapes, charts, interfaces and simulations. They can’t do photorealistic people or real camera moves. Where a clip needs that, it comes in as an image plate from an image model (Higgsfield, in my case) and Claude Code animates on top of it.

The one principle: every frame is a function of time

Every animation in the Motion Library has a single entry point:

window.MOTION = {
  duration: 12,          // seconds
  seek(t) {
    // redraws the frame at second t from scratch
  },
};

seek(t) may not depend on anything that happened before: no state that builds up frame by frame, no Math.random() without a fixed seed, no CSS transition running in the background. Only then does seek(7.25) always produce exactly the same image — and only then can Claude Code look at specific moments and render the video cleanly, frame by frame.

That rule is in every one of my prompts. It matters more than any design instruction.

The workflow in five steps

1. The prompt: a storyboard with seconds

A good motion prompt doesn’t describe a style; it describes a sequence. A storyboard with timings works best:

12 s, 1080 × 1080, 30 fps. Pure function of time: window.MOTION.seek(t).
0.0–2.0  Thin construction lines draw the logo grid.
2.0–4.5  Triangles fill in, overlapping by 0.5 px to avoid hairlines.
4.5–7.0  The mark folds into an app icon, critically damped spring (w = 18).
7.0–12   The name rises from below, then everything holds still.

The numbers make the result predictable. Ask for “an elegant logo reveal” and you get an elegant logo reveal — just not the one you had in mind. Every prompt in the library is on its detail page, for example the logo reveal.

2. The first draft: one HTML file

Claude Code creates a folder with an index.html and a script. For 31 of the 40 clips that’s Canvas 2D, for some it’s WebGL2 with custom shaders, for a few it’s DOM elements with CSS 3D. The file runs on its own in the browser; seek(t) jumps straight to any second.

3. Look for yourself: stills instead of gut feeling

The most important step, and the one most tutorials skip: before rendering the video, Claude Code renders individual stills at critical points — scene changes, peaks, the last frame — and looks at them. That catches exactly the mistakes you miss in a running clip:

  • hairlines between shapes that don’t overlap by half a pixel
  • text that wraps or gets cut off at the edge
  • a loop whose last frame doesn’t match the first, so it stutters
  • words that slide through a line while rotating

Each of these comes from a real clip in the library. Every detail page lists, under “What I learned building it”, what went wrong during the build and how it was solved.

4. Render: browser in, MP4 out

A small render script opens the page in headless Chrome, calls seek(0), seek(1/30), seek(2/30) … and captures each state. ffmpeg assembles the frames into an MP4. The Motion Library’s script is 85 lines, needs only Node and Chrome and is available to download — it also produces the stills from step 3:

node render.mjs http://localhost:4321/demos/motion/logo-reveal/ out stills 0 2.5 7 12
node render.mjs http://localhost:4321/demos/motion/logo-reveal/ out frames 30
ffmpeg -framerate 30 -i out/%05d.png -c:v libx264 -pix_fmt yuv420p -crf 20 -movflags +faststart clip.mp4
``` Because every frame is a pure function of time, it doesn't matter how long a single frame takes to draw — the video still runs exactly on time.

Frameworks such as Remotion or HyperFrames handle exactly this step. How they compare head to head is in [HyperFrames vs. Remotion](/en/blog/hyperframes-vs-remotion/).

### 5. Sound and voice, when a clip needs them

Seven clips in the library have sound. There the voice comes from ElevenLabs, the image plates from Higgsfield, and Claude Code lays the animation onto the word timings of the voice recording: a term appears exactly when it is spoken. On those clips' detail pages, "How it was made" shows every station with its material.

## The two motion rules that make the difference

**Springs instead of easing curves.** Stock curves such as `ease-in-out` quickly look generic. A critically damped spring starts briskly, lands softly and never overshoots:

```js
const spring = (t, w = 20) => 1 - (1 + w * t) * Math.exp(-w * t);

Beat instead of feel. Many clips run on a fixed tempo, such as 120 BPM: something happens every 0.5 seconds, and moves start just before the beat so they land on it. You feel that rhythm even without sound.

Both belong in the prompt. Claude Code follows numbers far more reliably than adjectives.

What Claude Code does well here — and what it doesn’t

Good at: maths and physics, exact repeatability, variants in several languages and formats, finding and fixing mistakes in stills, sticking to a storyboard to the tenth of a second.

Less good at: taste in the first draft. The first version is almost always technically correct and visually safe. Good clips come in the second and third round, when you say very specifically what’s off: “the pause after scene 2 is too long, the spring in scene 4 too soft, the blue too light.”

Can’t do: photorealism from code. That needs an image model as a supplier.

Frequently Asked Questions

Can you really make videos with Claude Code?

Claude Code builds the animation as code and renders it to an MP4 via a headless browser and ffmpeg. The result is an ordinary video file you can use on a website, on social media or in an editing program. Every clip in the Motion Library was made this way.

Do I need Remotion or HyperFrames for motion graphics with Claude Code?

No. Both take care of rendering and bring useful building blocks, but neither is required. Your own render script with a headless browser and ffmpeg is enough, as long as the animation is built as a pure function of time.

Which kinds of motion graphics work well?

Logo reveals, kinetic typography, UI animations, explainers with charts, physics simulations, isometric loops and title sequences. Less suitable are clips that need photorealistic people or real camera moves — those come in as image or video material from outside.

How long does a clip take?

It depends on the clip. A logo reveal with a clear storyboard is often done after a few rounds; an explainer with a voice-over and real quantities needs much more fine-tuning. Most of the time goes not into writing code but into looking and refining.

Can I use the prompts from the Motion Library?

Yes, that’s what they’re there for. Each prompt describes exactly the clip running next to it. Where someone else’s prompt served as inspiration, the author is credited with a link.

Conclusion

Motion graphics with Claude Code work when you treat them like software: one principle (every frame a function of time), a storyboard with numbers, checks on stills and a render step that always runs the same way. Then you don’t get a random animation but a clip you can change precisely, translate and re-render.

All 40 examples with their prompts are in the Motion Library. If you need motion graphics for your brand, product or website, that’s part of my Video Editing & Motion service.