Claude video tutorials

How to make an explainer video with Claude Code

A step-by-step method for explainer videos made as code: one idea per video, a script written as beats, the voice recorded first with word timings, a scene file Claude animates from, diagrams that draw themselves on the right word, and the frame checks that catch mistakes before you post.

An explainer video has one job: a viewer who did not understand something at second 0 understands it by the end. That makes it the best kind of video to make with Claude Code, because an explainer is mostly structure. There is a question, a mechanism and a payoff, and each sentence of the narration needs one picture that proves it. Claude is good at exactly that: breaking an idea into steps, and drawing each step as code.

This tutorial is the method we use for the Diagram explainer and Ink stickman styles in Video Studio, written so you can run it yourself in Claude Code. It assumes you know the basic trick of video as code, a page that can draw any frame, which our guide to making videos with Claude Code covers in full. Here the focus is narrower: what makes an explainer work, and how to get Claude to build one that teaches rather than decorates.

  • Diagram explainer · 41 s

  • Ink stickman · 35 s

Two explainers made this way, untouched renders from Video Studio. Every line, label and figure is drawn by code at the moment the voice says it.

What you need

  • Claude Code, installed and signed in. It runs in a terminal inside a project folder, where it can write files and run commands.
  • Node.js, Google Chrome and ffmpeg. Chrome draws the frames, a small script steps through them, and ffmpeg turns them into an MP4.
  • A text to speech voice that returns timings. We use the ElevenLabs endpoint that returns the audio together with the start time of every character, which is what lets a label appear on the exact word.
  • A topic you can explain in one sentence. If you cannot, the video will not manage it either.

You do not need a video editor, stock footage or an image model. Everything on screen is drawn: lines, shapes, numbers and type.

The whole pipeline in six steps

The order matters more than any single step. The voice is recorded before anything is animated, because every visual is timed to a word. Most failed attempts animate first and then try to stretch a voiceover to fit.

From a topic to a finished explainer

  1. One idea

    A single question and its answer, in one sentence

  2. Script as beats

    One sentence per beat, one picture per sentence

  3. Voice first

    Record the narration and keep the word timings

  4. Scene file

    Each beat gets a start time and a visual to draw

  5. Film page

    Claude writes the page that draws any frame

  6. Capture and check

    Render, look at stills, fix, render again

Steps 1 to 4 are plain text files. Claude writes drawing code only at step 5.

Step 1: pick one idea and write the claim

Before you open Claude Code, write the one sentence the viewer should be able to say afterwards. "The Titanic sank because its watertight walls did not reach high enough." "Exponential growth looks flat until it suddenly does not." That sentence is the claim, and everything in the video either sets it up or proves it.

Then check it. An explainer that teaches something false is worse than no video, and Claude will state a wrong fact as confidently as a right one. Ask it to list every factual statement in your claim with a source you can open, and read the sources yourself. Do this now, while a correction costs one edited sentence and not a new voiceover and a new render.

Step 2: write the script as beats

An explainer script is a list of beats, and a beat is one sentence with one thing to look at. If a sentence needs two pictures, split it. If a sentence has nothing to show, cut it or rewrite it until it does. This one rule does more for clarity than any animation skill.

For a 30 second vertical video, the structure below works for almost any topic. The hook states the surprising part, the setup shows what people assume, the mechanism is the actual explanation in two or three beats, and the payoff restates the claim with the picture complete.

The shape of a 30 second explainer

  1. 0 to 3 s

    Hook

    The surprising claim, stated plainly

  2. 3 to 8 s

    Setup

    What most people assume

  3. 8 to 24 s

    Mechanism

    Two or three beats that show why

  4. 24 to 30 s

    Payoff

    The claim again, with the full picture

Timings are a starting shape, not a rule. The real times come from the recorded voice.

script.md

# Why exponential growth fools us

claim: Exponential growth looks flat for a long time, then outruns everything.

1 hook       A lily pad doubles every day. On day 29 the pond is half empty.
             show: pond, half covered, day counter at 29
2 setup      For most of the month, almost nothing seems to happen.
             show: a nearly flat line creeping along the bottom of a graph
3 mechanism  Each day adds as much as every day before it, combined.
             show: bars doubling, the newest bar as tall as the rest stacked
4 mechanism  So the last few days do most of the work.
             show: the curve bending upward, last three days highlighted
5 payoff     By the time you notice it, it is nearly finished.
             show: full curve, pond full, day 30

Keep the narration short. People speak at very roughly two and a half words a second, so a 30 second video holds something like 70 to 80 words. Measure your own voice once and use that number, because a script that runs long cannot be fixed by animating faster.

Step 3: record the voice and keep the timings

Generate the narration from the script, one request for the whole thing so the delivery is consistent. Ask for timestamps: ElevenLabs returns the audio as base64 along with an alignment object that lists each character and when it starts and ends. From that you can work out when every word is spoken.

Have Claude write a small script that calls the endpoint, saves the audio as voice.mp3 and turns the character timings into a words.json file. Listen to the result before going further. If a sentence sounds wrong, fix the script and generate again now.

voice.mjs (the shape)

const res = await fetch(
  "https://api.elevenlabs.io/v1/text-to-speech/" + VOICE_ID + "/with-timestamps",
  {
    method: "POST",
    headers: { "xi-api-key": process.env.ELEVENLABS_API_KEY, "content-type": "application/json" },
    body: JSON.stringify({ text: narration, model_id: MODEL_ID }),
  },
);
const { audio_base64, alignment } = await res.json();
await fs.writeFile("voice.mp3", Buffer.from(audio_base64, "base64"));

// characters -> words, each with the time its first character starts
const words = [];
let cur = null;
alignment.characters.forEach((ch, i) => {
  if (/\s/.test(ch)) { cur = null; return; }
  if (!cur) { cur = { w: "", t: alignment.character_start_times_seconds[i] }; words.push(cur); }
  cur.w += ch;
  cur.e = alignment.character_end_times_seconds[i];
});
await fs.writeFile("words.json", JSON.stringify(words, null, 1));

Keep your API key in an environment variable, never in a file Claude might commit or paste back to you.

Step 4: turn the beats into a scene file

Now join the script to the timings. Each beat becomes a scene with a start time, taken from the first word of its sentence in words.json, and a short description of what to draw. Inside a scene, cues tie single moments to single words: the label appears when the voice says "half", the bar grows when it says "doubles".

This file is the storyboard. Read it before any drawing code exists and you will catch most problems for free: a beat with nothing to show, a scene that lasts one second, two cues landing on the same word.

scenes.json (two of five scenes)

[
  {
    "id": "hook", "start": 0.00, "end": 4.12,
    "draw": "pond seen from above, lily pads covering the left half",
    "cues": [
      { "at": "doubles", "do": "pads pulse once" },
      { "at": "29",      "do": "day counter ticks to 29" },
      { "at": "half",    "do": "dashed line splits the pond, label: half empty" }
    ]
  },
  {
    "id": "mechanism-1", "start": 8.40, "end": 14.95,
    "draw": "bar chart on a dark grid, one bar per day",
    "cues": [
      { "at": "adds",     "do": "newest bar grows from the baseline" },
      { "at": "combined", "do": "earlier bars stack beside it to the same height" }
    ]
  }
]

Step 5: have Claude write the film page

This is the first step where Claude writes animation. Give it the scene file, the word timings, and a brief that sets the rules. The rules that matter for an explainer are about restraint: one accent colour, one thing moving at a time, nothing on screen that the voice has not reached yet.

The brief

Build film.html, a 1080 x 1920 page at 30 fps that draws this explainer.

Contract
- window.__film = { width, height, fps, duration, ready, seek(t) }
- Every frame is a pure function of t. No Date.now(), no unseeded
  Math.random(), no network requests. Fonts are local files.

Read scenes.json and words.json. For each scene, draw what "draw"
describes, and fire each cue at the start time of its word.

Explainer rules
- One idea on screen at a time. Remove or dim what the voice has left.
- Nothing appears before the word that introduces it.
- Lines and shapes draw on (stroke grows over 0.4 to 0.8 s); they do
  not pop in. Numbers count up to their value.
- Dark background, white type, one accent colour for the thing being
  explained. No second accent.
- Every label is at least 44 px and sits inside x 90 to 910,
  y 260 to 1420, clear of the platform's own buttons and caption.
- Captions: the spoken words, two or three at a time, low in the
  safe area, the current word in the accent colour.

Write helper functions first (ease, drawOn, countUp, label), then the
scenes. Stop after the first two scenes so I can check stills.

Two parts of that brief earn their place. Asking for helpers first gives every scene the same motion, so the video feels like one piece. Asking Claude to stop after two scenes means you correct the look once, early, and not five times.

The single most useful helper is the one that draws a line on. It turns a static diagram into something the eye follows, which is most of what makes an explainer feel explained.

drawOn: a line that draws itself between two times

const clamp01 = (x) => Math.max(0, Math.min(1, x));
const ease = (x) => 1 - Math.pow(1 - x, 3);

// points: [[x, y], ...]   t: current time   t0, t1: when drawing starts and ends
function drawOn(ctx, points, t, t0, t1) {
  const p = ease(clamp01((t - t0) / (t1 - t0)));
  if (p <= 0) return;
  const lens = points.slice(1).map(([x, y], i) => Math.hypot(x - points[i][0], y - points[i][1]));
  let left = lens.reduce((a, b) => a + b, 0) * p;
  ctx.beginPath();
  ctx.moveTo(points[0][0], points[0][1]);
  for (let i = 0; i < lens.length && left > 0; i++) {
    const k = Math.min(1, left / lens[i]);
    ctx.lineTo(
      points[i][0] + (points[i + 1][0] - points[i][0]) * k,
      points[i][1] + (points[i + 1][1] - points[i][1]) * k,
    );
    left -= lens[i];
  }
  ctx.stroke();
}

Because it takes t and returns the same pixels every time, it works under frame-by-frame capture. An animation that depends on how long the browser has been open does not.

Step 6: capture, mix and check

Capture is the same as for any video made as code: a script opens film.html in Chrome, calls seek(t) for each frame, screenshots it and pipes the frames to ffmpeg, which then adds the voice. The capture script and its traps are in the general guide, so they are not repeated here.

What is specific to explainers is the check. Claude cannot watch a video, but it can look at still frames, and so can you. Ask for one still at the midpoint of every scene plus one at each cue, laid out as a contact sheet. Then ask three questions of each still.

  • Could someone with the sound off tell what this frame is about? If not, the label is missing or too small.
  • Is there anything on screen the voice has not mentioned yet? If so, it is giving away the next beat.
  • Is anything touching the edge of the safe area, or overlapping a caption?

Fix what the stills show, render again, and only then watch the whole thing on a phone with sound. The first full watch is for pace: an explainer usually feels slow where a beat holds after its sentence has ended, and the fix is to shorten the script, not to speed up the drawing. Our post on the critic loop goes deeper on getting Claude to review its own frames.

Pulling the stills is two ffmpeg commands. Claude can run them and read the sheet itself, but look at it too: you are the one who knows what the video is meant to teach.

Stills for the contact sheet

# one frame from the middle of each scene (times from scenes.json)
for t in 2.06 6.26 11.67 19.40 27.10; do
  ffmpeg -loglevel error -ss $t -i out.mp4 -frames:v 1 stills/$t.png
done

# tile them into one image Claude can read in a single look
ffmpeg -loglevel error -pattern_type glob -i "stills/*.png" \
  -vf "scale=360:-1,tile=5x1" sheet.png

What it costs and how long it takes

Making an explainer this way is not free and it is not instant. In our own measurements from November 2026, an agentic Claude Code session for a 60 second video consumed about $7 to $13 at API list prices, and most of that went on rendering and reviewing frames, not on writing code. Narration is small beside it, about $0.07 a minute at ElevenLabs list prices. The breakdown is in our cost guide.

The first video is the slow one, because you are also building the helpers, the capture script and your own taste. Keep the folder. The second explainer reuses all of it, and the work shrinks to a script, a voice and a scene file.

Mistakes that make an explainer worse

  • Explaining two ideas. The video that tries to cover why the Titanic sank and how lifeboats were allocated teaches neither.
  • Animating before recording the voice. Every cue then has to be retimed by hand.
  • Decorating. Particles, glows and camera moves that are not part of the explanation pull the eye away from the one thing it should follow.
  • Showing the whole diagram at once. A finished chart is a picture; a chart that draws as the voice explains it is an explanation.
  • Text too small. A label that reads well on a laptop preview is unreadable on a phone at arm's length.
  • Trusting the facts. Claude does not flag its own errors, so check every number against a source before the voice is recorded.
  • Polishing scene one before scene five exists. Get every scene rough first, then improve the weakest.

When to use a template engine instead

Doing this by hand makes sense when the explainer is a one-off that has to look like nothing else, or when you enjoy the craft. It makes less sense for a channel that posts every day, because each video repeats the same six steps and the same checks.

That repetition is what Video Studio automates. You type the topic, it writes the script by scene for you to approve, records the voice, and draws the video in a style that already has its helpers, safe area and caption rules built in. The Diagram explainer and Ink stickman samples at the top of this post were made that way, in about three minutes each.

Sources and methodology

The method is our own, as used for the explainer styles in Video Studio. Cost figures are our measurements from November 2026 at API list prices and are explained in the linked cost guide. The speaking rate is a rough rule of thumb, which is why the post tells you to measure your own voice.

  1. 01Claude Code overview (Anthropic documentation)What Claude Code is and how to install it.
  2. 02ElevenLabs API reference: create speech with timingThe endpoint that returns audio_base64 and a character-level alignment, used in step 3.
  3. 03ffmpeg documentationSeeking, frame extraction and the tile filter used for contact sheets.

Frequently asked questions

Can Claude Code make an explainer video by itself?

It can write everything: the script, the page that draws each frame, the capture script and the ffmpeg commands, and it can run them. It cannot export a video file directly and it cannot watch one, so the method relies on Chrome to draw frames and on still images for checking.

Do I need to know how to code?

You need to be comfortable running commands in a terminal and reading an error message back to Claude. You do not need to write the drawing code yourself, but the clearer your script and scene file, the less code you will have to look at.

How long should an explainer video be?

As long as one idea needs. For Shorts, Reels and TikTok that is usually 30 to 60 seconds. If the script runs past that, it probably contains a second idea that deserves its own video.

Why record the voice before animating?

Because every visual in an explainer is timed to a word. With the voice recorded first, the timings are data and Claude can place each cue exactly. Animating first means stretching or cutting the narration to fit, which always sounds wrong.

Can I use Remotion or Manim for this?

Yes. The method (one idea, beats, voice first, a scene file, frame checks) is the same whichever renderer draws the frames. Our comparison of Claude, Remotion and HyperFrames covers how the renderers differ, and there is a separate post on maths animations with Manim.

How do I stop Claude getting facts wrong?

Check the claim before recording anything. Ask Claude to list each factual statement with a source you can open, read the sources yourself, and put only verified numbers into the script. Nothing in the pipeline checks facts for you.