Motion design with Claude and Remotion
Video can be written as code. That makes it something a coding agent can build, preview and revise.
Words on this page (4)
- agent
- : A model run in a loop that chooses its own tools and steps until the task is done.
- skill
- : A folder of instructions and scripts an agent loads only when a task needs it.
- tool
- : A function the model can ask your program to run, described by a name, description and argument schema.
- prompt
- : The input text you give a model, including instructions, examples and data.
What it is
Remotion is a React framework where each video frame is a component rendered at a point in time. Animation is a function of the current frame number. Because it is code, an can write a scene, render a still, look at it, fix the layout and re-render. Agent for Remotion teach the agent the framework's conventions such as how to time sequences, so you get fewer broken first drafts.
A workable loop
Write a short brief with the story beats, the style and the length. Ask the agent to build one scene at a time. Render stills at key frames and check them, since the agent can view images. Keep assets and timing constants in one file so changes are cheap. The skill is directing: the agent handles syntax, you handle taste and pacing.
A worked example: a scene as code
A scene is a function of the frame number. Frames 0 to 30: a title fades in (opacity = frame / 30). Frames 30 to 90: a bar chart grows (height = value × progress). Because it is plain code, the agent can change a number, re-render and compare. Timing constants live in one file so you can retime the whole video in a minute.
Step by step: a 10-second video
Start with arithmetic, since everything in the code runs on frame numbers.
- Choose a frame rate. At 30 frames per second, 10 seconds is 300 frames.
- Split the story into three scenes: 90, 120 and 90 frames. That is 3, 4 and 3 seconds, and the total is 300.
- Put these numbers in one constants file, so retiming means editing one place.
- Ask the agent to build scene one only. Remotion's Sequence component places a scene at a start frame, and its interpolate helper turns a frame number into a value.
- Render one frame as an image, near the middle of the scene. Check the layout, then ask for fixes.
- Repeat for scenes two and three, then render the whole video.
How the timing math works
A progress value runs from 0 to 1 across a range of frames. A bar chart grows between frame 30 and frame 90, a span of 60 frames. At frame 60, progress is (60 - 30) / 60 = 0.5. If the final bar height is 80 pixels, the bar is 40 pixels tall at that moment. A title that fades in over frames 0 to 30 has opacity 0.5 at frame 15. Easing changes the curve, but the idea stays the same: the picture is a pure function of the frame number.
What goes wrong: a preview that flickers
Preview looks fine, but the final render has parts that jump or flicker. A common cause is timing that does not come from the frame number, such as CSS transitions, a timer, or random values. Rendering draws frames in separate browser tabs, in parallel, and does not wait for real time to pass.
To confirm, render the same frame twice, then compare the two images. A correct scene produces identical stills. If they differ, find the code that reads the clock or a random number, and replace it with a value computed from the frame.
When code video is the wrong tool
Cutting footage you filmed, or tuning a short logo animation by dragging keyframes, is faster in an editor with a timeline. Code video suits scenes made of text, charts and shapes, and videos you want to regenerate from changing data.
Giving feedback the agent can act on
Vague notes get vague fixes. "Make it punchier" could mean ten things. Name the frame, the element and the change. Compare:
- Weak: "The title feels slow."
- Strong: "In scene one the title fades in over 30 frames. Make it 15, and hold it on screen for 45 frames before the chart starts."
The strong note maps to two constants, so the agent edits two numbers and you compare a new still. If a change makes things worse, undo it by restoring the old numbers. This is why keeping timing in one file matters.
Common mistake
Asking for a whole video in one . Build and check scene by scene.
A teacher who cannot animate wants a 15-second explainer about how a bill becomes law. She describes four scenes in plain words. An agent writes the animation code, renders a still of each scene, spots that the text overlaps the image, fixes it and renders again. She chooses the colors and pacing. The craft shifted from clicking in an editor to describing and directing.
Check yourself
Why is code-based video good for agents?
Not quite. Verification by rendering closes the loop.
What stays with you in this workflow?
Not quite. The agent handles mechanics. You decide what is good.
An agent's scene has text overlapping an image. What is the quickest fix loop?
Not quite. Checking rendered stills scene by scene catches layout problems early.
You got 0 of 3 right.
Go deeper
- Docs
Remotion · Official skills for coding agents.
- Repo
Remotion · Make videos programmatically with React.
- Repo
HeyGen · Open-source framework for agent-driven video from HTML.
- Repo
athemeroy · A list of videos made with Claude.
Spotted a mistake or something unclear? Report it on GitHub.