Claude Code meets After Effects. All you get is the output.
Headless Motion is a toolkit that lets an AI agent design, build, and check motion graphics entirely in code, with no screen, player, or timeline, so the agent creates and measures animation by numbers instead of watching it.
A scene is a JSON file. A render is one command. A check is numbers. The agent writes, renders, checks, and fixes until every number passes. You give one final look at the end.
Research preview. MIT licensed. Created by Richardson Dackam, Toronto, 2026.
Data Story. Rendered by the engine from one JSON scene file. No reference, no stock, no AI images. 5.0 s, 24 fps, 854x480, 120 frames. Deterministic render.
Proof, not promises
An agent cloned the first 30 seconds of a short video, frame for frame, and every frame was scored against a frozen bar that cannot move. The clone video itself stays in the workspace. The numbers are public.
Gate 1: first 10 seconds, 240 frames
Mean SSIM
0.9926
Mean PSNR
36.21 dB
Min SSIM
0.9887
LPIPS
0.0134
Gate 2: full 30 seconds, 720 frames
Mean SSIM
0.9938
Mean PSNR
36.16 dB
Min SSIM
0.9887
LPIPS
0.0106
Frames below 0.90
0
Frames below 0.85
0
Flat colour max
1.71 Delta E
Text shift max
0.5 px
The frozen bar
A render passes only if it meets all of these. The bar is frozen, so it cannot move.
Mean SSIM 0.95 or more
Per-frame SSIM 0.90 or more, no frame below 0.85
Mean PSNR 35 dB or more
LPIPS 0.08 or less
Flat colour under 3 Delta E
Motion error under 2 px
Text shift under 2 px
Human gate: passed Nov 9, 2026
Richardson watched the side-by-side at full speed and at 0.25x and found no visible mismatch. An independent judge re-checked every number with its own scripts. Verdict: PASS WITH GAPS.
Proven domain: flat 2D vector animation with hard cuts, no camera motion, no grain, 30 second window. Live footage, grain, camera shake, and longer windows were not tested.
Showcase: four scenes, built in code
Four original scenes, rendered by the engine in deterministic mode from one JSON scene file each. Click a still to watch the clip. Each scene is 5 seconds at 24 fps, 854x480 previs, 120 frames.
Map Flight. A camera flight over real Natural Earth geography, with labels that track and a badge that pops. Proves camera knots, label tracking, and real geography in code.
5.0 s, 24 fps, 854x480, 120 frames, 63,970 bytes. Deterministic render. Byte-identical re-render verified, sha256 667dc11655d8f00aa188e0decfff539d299cfb3eac0b76a24a55bb7678d5f438.Data Story. A pill pops with overshoot, kinetic type staggers in, a count-up runs 0 to 12,800, and Beta overtakes Alpha 70 to 55 as a callout stamps in. Proves easing, kinetic type, count-up, and chart racing.
5.0 s, 24 fps, 854x480, 120 frames, 39,093 bytes. Deterministic render, frames verified by ffprobe.Particles Night. A gradient night sky with drifting clouds, a glowing moon, layered hills, seeded bubbles rising, sparkles, and gold bokeh. Proves seeded deterministic particles and glow.
5.0 s, 24 fps, 854x480, 120 frames, 46,520 bytes. Deterministic render, frames verified by ffprobe.Character Rig. A rigged flat character on a stage: blink, brows up, eyes wide, arms raise through two-bone IK, mouth opens. Proves the character rig and IK poses.
5.0 s, 24 fps, 854x480, 120 frames, 45,055 bytes. Deterministic render, frames verified by ffprobe.
How it works
The loop has four steps. The agent repeats them until every number passes.
1
Write the scene
The agent writes a scene JSON, schema hme.scene/1.0. Nodes are text, shapes, maps, or charts. The timeline moves node properties between keyframes with named easings. Palette and fonts are named once and used by name.
2
Render
One command renders the scene to video. Profiles run from previs at 854x480 for fast iteration to final at 1920x1080. The same JSON renders the same video every time.
3
Check
The checker scores every frame: SSIM, PSNR, LPIPS, flat colour, motion, text shift, and layout. Every measurement returns one JSON report: verdict, numbers, corrections, next command, limits.
4
Fix
The agent fixes the worst gap first and saves a new scene version. It never edits in place. It repeats render, check, and fix until the numbers pass, or it names the gap it cannot close.
Then one final look, once, after a machine PASS. The agent sends one verdict line, the video, and the worst frames as stills. You watch once at full speed, once at 0.25x, and answer "Approve, no mismatch." or give a time, a side, and what is wrong.
Tools
One command surface for agents. Every measurement returns one JSON report. Exit 0 is pass, 1 is fail, 2 is usage error.
node src/cli/hme.mjs mcp, JSON-RPC 2.0 over stdio, no MCP SDK dependency.
compare, trace, diagnose, control, extract, fonts, player-pass, context, frame-style. Each MCP tool call reuses the CLI exactly, so the MCP result is identical to the CLI result by construction. Render and fix are not in MCP. An agent needs the CLI for those.
Character rig
Two-bone IK turns a hand target into shoulder and elbow angles. The arm pose library holds 13 named poses: down, rest, hips, point, present, shrug, up, hands-on-head, chin, hold, wave, stop, and cheer. Unreachable targets clamp to full reach and report reached false, so a pose that cannot be reached is never silently changed into a different pose.
Frame-to-style
Measures a reference video frame by frame and writes a plain-language style prompt from those measurements, so the style carries into a new image or GIF without copying the reference art. Built from palette, gradient, proportions, pose, and colors.
Maps
Real Natural Earth geography, a five colour palette, Montserrat labels, one focus at a time. Camera knots and label tracking run in code.
Charts, particles, and more
Bars, lines, and kinetic type. Seeded particles that render byte-identical. Gradient fills, glow, and soft edges. Reference teardown that measures a reference into a profile: palette, geometry, shots, cuts, trajectories, traces. An easing picker that ranks 18 named cubic-bezier eases plus hold by measured error.
Copy a prompt, paste it into your agent
You work with an AI agent. You never run commands. The agent runs them. Clone the repo, run npm install, paste the setup prompt, and watch the render it shows you.
Prompt 1: setup
Set up Headless Motion on this machine and render a test video.
1. If the repo is not cloned yet, clone richardsondx/headless-motion and open its root folder.
2. Read these five files before doing anything else:
- prompts/01-scene-format.md
- prompts/02-renderer-adapter.md
- prompts/03-map-module.md
- prompts/04-chart-text.md
- prompts/05-frame-checker.md
3. Run: npm install
4. Check that Node is version 20 or newer.
5. Check that ffmpeg is installed and on the path.
6. Check that Chromium is installed through Playwright.
7. If anything is missing, install it the right way for this machine. Tell me what you installed.
8. Render the scene-min fixture:
node src/renderer/cli.mjs render tests/fixtures/scene-min.json --profile draft --out out/scene-min
9. Show me the MP4 file and tell me where it is saved.
Prompt 2: make a video
Make me a video with Headless Motion. Here is what I want:
[Describe the video in plain words: what appears, what moves, colours, text, length.]
Work like this:
1. Write the scene JSON using prompts/01-scene-format.md. Use schema hme.scene/1.0.
2. Validate the scene with src/scene/validate.mjs, as prompts/01-scene-format.md explains.
3. Render it:
node src/cli/hme.mjs render <scene.json> --profile draft --render-out <dir>
4. Check the render. Read the JSON report: verdict, numbers, corrections, next command, limits.
5. Fix the worst gap first. Save a new scene version. Never edit in place.
6. Repeat render, check, and fix until the numbers pass, or name the gap you cannot close.
7. Render the final version with --profile final.
8. Then ask me for one final look. Send one verdict line, the video, and the worst frames as stills.
I will answer "Approve, no mismatch." or give a time, a side, and what is wrong.
Prompt 3: copy a reference
Copy this reference video with Headless Motion: [path to reference.mp4]
Work like this:
1. Measure the reference into a style profile:
node tools/map-frames.mjs <reference.mp4> --start-s <n> --end-s <n> --out <dir>
2. Get pace numbers and a plain-language style prompt:
node tools/frame-style.mjs <reference.mp4> --start-s <n> --end-s <n> --out <prompt.md>
3. Write the scene JSON using prompts/01-scene-format.md and the profile from step 1.
4. Render it:
node src/cli/hme.mjs render <scene.json> --profile draft --render-out <dir>
5. Check the render against the reference, frame by frame, as prompts/05-frame-checker.md explains:
python -I -m checker run --segment <cfg> --render <render.mp4> --ref <reference.mp4> --out out/<seg>/check
6. Use node src/cli/hme.mjs compare and node src/cli/hme.mjs diagnose to find the worst gap.
7. Fix the worst gap first. Save a new scene version. Repeat steps 4 to 7.
8. Stop when every number passes: mean SSIM 0.95 or more, mean PSNR 35 dB or more,
LPIPS 0.08 or less, flat colour under 3 Delta E. If a gap will not close, name it.
9. Then ask me for one final look. Send one verdict line, the side-by-side video, and the worst frames as stills.
Works with your agent
Headless Motion is CLI and MCP compatible with these coding agents. No per-agent integration has been tested, and none is claimed.
Claude CodeCLI / MCP compatible
CodexCLI / MCP compatible
MuseCLI / MCP compatible
GrokCLI / MCP compatible
An agent with shell access uses the CLI. An agent with an MCP client uses hme mcp over stdio. What each agent supports in a given deployment was not verified, so the method is stated as CLI plus MCP where the agent supports each method.
What the agent needs: Node 20 or newer, ffmpeg on the path, Chromium installed through Playwright. The setup prompt tells the agent to check these and install anything missing.