Claude Motion
Code-Driven Motion Films & Deterministic Video Renderer for AI Coding Agents
One continuous camera through one world: real DOM UI, Three.js 3D space, procedural audio scoring, and frame-exact MP4 export.
From examples/launch: a chart's dip becomes the way into a 3D city. Rendered by this repo, no editing.
Why: Code-Driven Motion Films vs. Animated Slideshows
Ask most AI agents for a product video or launch clip, and you receive an animated slideshow: a centered card fading in, followed by another panel dissolving over a static background. Claude Motion makes films. It runs your coding agent through the deliberate discipline of a professional motion designer: establishing three looks tailored to your brand, structuring a beat sheet with dynamic camera actions, building on a dedicated deterministic stage, visually inspecting intermediate frames, procedurally scoring beats, and rendering frame-exact 1080p MP4s.
The Slideshow & Animated Deck Trap
Automated film quality is measured using empirical motion heuristics calibrated against real films (scripts/lib/analyze.mjs):
- Pixel Travel Heuristic (
change2s): Over any 2-second window, genuine motion films exhibit 18%–30% whole-picture pixel change driven by travelling camera moves, perspective changes, and spatial transitions. In contrast, animated decks average only 9%–12% change, betraying static layouts where only isolated badges or text lines update.
- Center-Line Weight Bias (
cxSd): Animated decks keep their visual mass anchored to the center line with low horizontal centroid variance (cxSd < 0.04), leaving over 60% of canvas corners empty (sparse). True films exploit asymmetrical shot framing, wide-to-tight camera push-ins, and directional momentum.
- Layout Stagnation (
same): Slideshow-style videos repeat the same card template across the timeline (same > 45%). Claude Motion scripts flag frozen spans (> 25% frozen = slideshow warning) and reject runs that fail travel thresholds.
The Motion Design Methodology
| Stage | Capability & Verification |
|---|
| Asks first | Style, colours, and length in one intake pass: three visual looks tailored for your story, brand palette extracted directly from your codebase, and three target durations. No back-and-forth guessing. |
| Directs | A beat sheet with one unified world, a continuous camera spine, active verbs in every shot, and eye-leading transitions, tested against the built-in slideshow test. |
| Builds | A deterministic DOM + Three.js stage: perspective camera with logarithmic zoom and drift continuity, CSS 3D space (kit.space), arcing cursor, monotonic typist, word-by-word TextFx, kinetic type walls, springs, squash and stretch, morphs, extruded 3D geometry, walk-cycle box characters, chrome/glass/particles, device UI, and temporal optical motion blur. |
| Looks | Exact stills and labeled contact sheets (scripts/frames.mjs) that the agent must inspect, coupled with automated checkers for frozen spans, non-determinism, blank first frames, and sub-20px mobile-unreadable text (scripts/check.mjs). |
| Scores | An offline procedural synth (marimba, electric piano, ambient pads, drum kit, 13 UI foley sounds) synchronized to exact timeline beats, loudness-normalized to broadcast standards (scripts/score.mjs). |
| Ships | Frame-exact H.264 + AAC encoded via parallel headless Chromium browser workers, with half-resolution draft modes for rapid timing iteration (scripts/export.mjs). |
Architecture & Workflow: How It Works
Pure-Function Timeline Architecture (Deterministic Rendering)
A Claude Motion film lives in a self-contained directory governed by a film.js script adhering to a strict mathematical interface contract: