Get in touch

← All articles

Motion graphics with Claude: how to make animated videos by writing code

All of this is code: a shader with particles, a 3D logo in three.js and animated graphics with real data. Claude Code wrote it and HyperFrames rendered it. Not a single keyframe was set by hand.

Claude doesn't "generate" video the way an image model does. It writes the animation as code, and a browser turns it into an MP4. It sounds technical, but it changes who can make motion graphics and how fast.

None of those clips went through After Effects. Until recently, 15 seconds of animated type for an ad meant setting keyframes by hand and exporting five times because the client wanted "the logo a bit earlier". Today you can describe the animation to Claude, review it in the browser and render it.

In this guide I explain how it works, how to ask for your first video without knowing animation, and the 20 open-source tools worth keeping at hand for 3D, audio, captions and editing.

The key idea: the video is code

Claude doesn't draw frames. It writes an animated web page: HTML for the elements, CSS for the style and JavaScript (usually GSAP) for the motion. Then a tool opens that page in a headless browser, steps through the animation frame by frame and saves every frame into a video file.

That gives you three things an AI video generator doesn't:

  • It's exact. Text is perfectly legible, colours are your brand's and nothing "hallucinates". If you say the logo comes in at 2.5 seconds, it comes in at 2.5.
  • It's editable. Changing a word, a colour or the timing means changing one line, not regenerating everything and hoping.
  • It's reusable. A good animation becomes a template: same format, different copy, ten ads in an afternoon.

The trade-off: it's for graphics, type, data, interfaces and logos. It doesn't replace filming a person or generating realistic scenes.

Try it: edit this video

This is a real animation running in your browser, written the way Claude would write it. Change the text, the colour or the easing curve and watch the code change. Then hit Render video: you'll see it captured frame by frame, which is exactly what HyperFrames and Remotion do, and at the end you can download your video.

This interactive example needs JavaScript.

Pay attention to the easing curve: expo.out starts fast and eases to a stop; back.out overshoots a little and comes back. That difference separates an animation that feels expensive from one that feels like a template, and it's the first thing worth asking Claude for explicitly.

The two tools worth knowing

HyperFrames Remotion
Language HTML, CSS and JS (GSAP) React
Made by HeyGen Remotion
License Open source, free Free for individuals and small teams; larger companies need a license
Best for Starting fast, one-off pieces, ads React projects, data-driven templates, apps that generate videos

HyperFrames is the most direct option: every video is an index.html with scenes, and since models already write HTML very well, the learning curve is close to zero. It comes with a preview studio, a command that checks for mistakes and a catalogue of ready-made blocks (transitions, titles, charts).

Remotion has been around longer and is the natural choice if you already work in React. I use it for the animated shots in Se Remonta's Reels, because those pieces share components and data.

Here's the same effect, a title that rises and fades in, in each:

<div id="root" data-composition-id="intro" data-width="1920" data-height="1080">
  <h1 id="title" class="clip" data-start="0" data-duration="3">I wrote it.</h1>
</div>
<script>
  const tl = gsap.timeline({ paused: true });
  tl.from("#title", { y: 60, opacity: 0, duration: 0.8, ease: "expo.out" });
  window.__timelines["intro"] = tl;
</script>
import { AbsoluteFill, Easing, interpolate, useCurrentFrame } from "remotion";

export const Intro = () => {
  const frame = useCurrentFrame();
  const p = interpolate(frame, [0, 24], [0, 1], {
    easing: Easing.out(Easing.exp),
    extrapolateRight: "clamp",
  });
  return (
    <AbsoluteFill style={{ justifyContent: "center", alignItems: "center" }}>
      <h1 style={{ opacity: p, transform: `translateY(${(1 - p) * 60}px)` }}>I wrote it.</h1>
    </AbsoluteFill>
  );
};

Both have official skills for agents: instructions that teach Claude each tool's rules so it avoids the usual mistakes.

Step by step: your first video with Claude Code

1. Install the skills

In your project folder, from a terminal:

# HyperFrames
npx skills add heygen-com/hyperframes

# or Remotion
npx skills add remotion-dev/skills

From then on, when you ask Claude Code for a video, it loads the tool's rules by itself. What skills are and how to write your own is coming in a future article.

2. Brief it like a director, not a programmer

The most common mistake is asking for "a nice video about my product". Claude does much better when you give it what you'd give an editor:

Build yours here and copy it. It comes filled in with the prompt I used for this article's video:

Make a 12-second vertical video (1080x1920) with HyperFrames.

Message: "I didn't edit this video. I wrote it."
Style: very dark brown background, cream text, a single gold accent (#ffcd75).
Big type, few words per screen.

Timing:
- 0-3 s: "I didn't edit this video." appears word by word.
- 3-6 s: the line cuts out and "I wrote it." comes in bigger.
- 6-10 s: code types itself out and turns into the animation.
- 10-12 s: close on my name and "jesusbsilva.com".

Keep everything inside Instagram's safe area.

Look at what's in it: format, length, message, palette, type and what happens every second. That last part makes the biggest difference.

3. Review it in the browser before rendering

HyperFrames opens a studio with npx hyperframes preview, Remotion with npx remotion studio. There you watch the animation, scrub it, pause it and ask Claude for changes in plain words: "the second line comes in too fast", "give the ending more room", "use the same entrance curve everywhere".

4. Render

When you like it, one command turns it into an MP4:

npx hyperframes render

What that prompt produced

Made with Claude Code and HyperFrames from the prompt above. No video editor involved.

It came out of the prompt in step 2. What took the longest wasn't the animation, it was deciding the message and the timing. That part is still yours.

The toolbox: 20 repos for making video with code

HyperFrames and Remotion are the core, but a finished video has more stages: motion, 3D, audio, assets, editing and publishing. These are the tools worth knowing for each. Almost all are open source, and Claude Code can install and run them for you from the terminal.

Motion

  1. Remotion: videos written as React components and rendered to MP4. Ideal for templates filled with data (one video per customer, product or student).
  2. Remotion Skills: the official rules that teach Claude to write clean Remotion compositions. Install them before your first Remotion video.
  3. Motion Canvas: animations coded in TypeScript with a live editor. Great for explainers with diagrams, code and formulas.
  4. GSAP: the timeline engine behind most web animation, and the one HyperFrames uses. It's now free, plugins included.
  5. Theatre.js: a visual timeline for keyframes and camera moves, especially in 3D scenes. The core is Apache 2.0; the visual editor is AGPL.
  6. Lottie: plays After Effects animations on the web. Handy for reusing animations you already have or find ready-made.

3D and effects

  1. three.js: 3D scenes that run in the browser. The 3D logo at the top was made with it, and since HyperFrames renders web pages, 3D and motion graphics can share the same video.
  2. LYGIA: a shader library (noise, colour, shapes, lighting) so you don't start from zero. It has exactly the noise functions behind backgrounds like the shader at the top. Check its license for commercial work.
  3. tsParticles: ready-made particles: confetti, sparks, snow, fireworks.

Audio

  1. Whisper: speech to text with very good accuracy, in many languages. Step one for captions.
  2. WhisperX: Whisper with word-level timestamps. It's what makes animated captions that light up exactly as each word is spoken.
  3. Bark: text to speech, with laughs, pauses and intonation. Useful for prototypes and character voices.
  4. AudioCraft: music and sound effects from a prompt (MusicGen and AudioGen). Careful: the model weights are non-commercial, so it's not for client ads.

Assets

  1. ComfyUI: node graphs for image and video models. For generating backgrounds, textures or plates you then animate with code.
  2. rembg: background removal in one line. Perfect for cutting out products or people before animating them.
  3. Real-ESRGAN: upscales blurry images and footage. Rescues low-quality logos and screenshots.

Editing

  1. FFmpeg: cut, join, compress and convert any format. Every tool on this list ends up going through it, and Claude handles it very well.
  2. auto-editor: cuts the silence out of a video automatically. Saves the first editing pass of any talking video.
  3. MoviePy: video editing in Python: join clips, add text, music and transitions from a script.

Publishing

  1. Sndwich: not a repo but a paid service that plans a week of posts for X, Instagram and Telegram in your voice. It covers the last step: getting the video in front of people.

The full flow: motion → 3D → audio → assets → editing → publishing. You don't need all of them: HyperFrames or Remotion, FFmpeg and WhisperX for captions already cover 90% of social videos.

Mind the hardware. The local AI tools (Whisper, Bark, AudioCraft, ComfyUI and Real-ESRGAN) run much better with an NVIDIA graphics card. They work without one, just slowly.

Tips that saved me hours

  • Ask for a script before the code. "Before animating, write down what happens in each scene and how long it lasts." Fixing a script takes seconds; fixing an animation takes minutes.
  • Give it your brand. Hex colours, fonts and logo in one file. Put them in a skill of your own and you never repeat them again.
  • Talk in seconds and concrete feelings. "Comes in over 0.4 s and eases to a stop" works; "make it dynamic" doesn't.
  • Check key frames, not just the whole video. Ask for stills at second 0, the middle and the end: that's where cut-off text shows up.
  • Sound is separate. The animation is written in code; you choose the music and effects (or add them as an audio track).
  • Think in templates. The second video takes a fraction of the time of the first if you leave the copy and colours as variables.

When it's worth it and when it isn't

It's worth it for animated-type ads, explainers with charts or data, product demos with real screens, intros, logos and recurring social content in the same format.

It isn't if you need people, real places or cinematic scenes: the camera still rules there (or an AI video generator, knowing what you give up in control).

In short

Making motion graphics with Claude isn't about pressing a button. It's that the mechanical part (keyframes, exporting, fixing) is no longer the bottleneck, and what matters is what always mattered: a clear message and good timing.

If you have a brand, a product or a course and need steady animated content, this changes the math. And if you want help setting it up, get in touch.