Skip to content

About

Animation drawn by code with Claude — no AI video: an engine, styles and skills that learn from every render, all in the open. PRs with new styles welcome.

Topics

Resources

Contributing

Stars

60 stars

Watchers

2 watching

Forks

Repository files navigation

drawn-by-code

drawn by code

This cover is itself drawn by the repo: the paper kit tears the tiles and the hand, and the carousel shows a dozen of the styles as polaroids, each painted by that style's own template (readme-cover).

Animations and videos made with code by Claude. JavaScript paints every frame on a <canvas> (2D, or 3D through WebGL2), deterministically. Chromium and ffmpeg render the frames to MP4. No After Effects, no AI-generated video: every torn edge, fingerprint and hand is code.

The goal: push Claude's knowledge and visual limits as far as they go. How far can a language model get as an animator, with nothing but code: paper that tears like paper, hands that hold a mug the right way round, clay that looks like clay, a replica you have to zoom into to tell apart? Every experiment here pushes that edge a little further.

The repo is both a toolbox (engine, styles, Claude skills) and a test bench. Every experiment in sandbox/ goes through an automatic review (real frames, determinism, rhythm, motion) and through human feedback. What is learned goes back into the skills, so every test improves the next one.

A hub for styles: contribute

The idea is for this to become a hub: a growing library of animation styles, each with its drawing kit, its template, its skill (the rules and the checklist that keep it consistent) and the videos that prove it. Styles and skills are yours to add and improve, by pull request:

  • A new style: risograph, pixel art, isometric, whiteboard, stained glass, woodcut, anime, a style no one has named yet.
  • A better existing style: more detail, a fixed pitfall, a new pose for the hands, a faster kit, a lesson learned the hard way.
  • The engine and the skills: tools, review checks, sound, transitions, the process.

Every contribution follows the same loop as everything else here: a render, frames looked at, a review. See CONTRIBUTING.md.

Why it is all public

A lot of impressive AI-made videos get posted with no prompt, no skill and no word on how they were made. We respect that choice, but we think everyone would learn faster, and the field would grow faster, if that knowledge were public.

So nothing here is hidden:

  • Code: the engine and every scene.
  • Skills: the ones that direct Claude, including their rules, checklists and pitfalls.
  • The process: every experiment's brief, its rounds of review with the feedback that drove them, and the lessons that came out of them.

If a video here makes you want to try something, everything you need to make it, or to do it better, is in this repo. And if you publish a video made with AI, consider publishing how you made it too.

Gallery

Micrograph
Micrograph
micrograph · 37 s · mp4 (with sound)
One session at an electron microscope, from an amoeba down to virions adrift on black. Every shot is one grey signal seen by an instrument made of code, and tinted afterwards.
Lightfield
Lightfield
lightfield · 30 s · mp4 (with sound)
Five lights, from a sunrise over the edge of the Earth to a filament that lights the title. Nothing is drawn: each scene is light, photographed by a camera made of code.
Pier Pressure
Pier Pressure
skate toon · 32 s · mp4 (with its theme song)
The opening of a cartoon that never existed: four kids chase a one-eyed gull down the pier, in the look of a late-'90s extreme-sports show, animated on twos.
Runnin' Down a Dream
Runnin' Down a Dream
cereal ad · 4 min 24 s · mp4 (silent: the song is not ours)
A full videoclip for Tom Petty's song as a '90s cereal commercial on VHS: the Devil chases the band from Route 66 to the moon for one signature.
The Red Thread
The Red Thread
sumi-e · 68 s · mp4 (with sound)
A river village splits into two banks, and a red kite carries one thread back across the water. Its title on screen is «El hilo rojo». Japanese ink on washi, every brushstroke drawn in code.
A Brief History of Physics
A Brief History of Physics
risograph · 67 s · mp4 (with sound)
From Galileo's telescope to Schrödinger's box in one continuous chain of objects, with the same cat in every scene.
The pyramid that makes skies
The pyramid that makes skies
engraving · 64 s · mp4 (with sound)
A plate of the «Description de l'Égypte» comes alive: the pyramid opens into thousands of blocks and the camera flies through a temple without a cut.
opus5-riso
opus5-riso
risograph · 28 s · mp4 (silent)
A 1:1 study of a risograph film by Kevin Ngo (@kevin_t_ngo). The original design and animation are his.
what-do-you-love
what-do-you-love
paper cutout · 28 s · mp4 (silent)
A 1:1 study of a paper-cutout video by Kevin Ngo (@kevin_t_ngo). The original design and animation are his.

Every tile is the same 480 × 270 GIF (engine/gif.mjs --frame 480x270): a square film stands whole in the middle of its tile.

More about each film
  • Micrograph: One session at an electron microscope, from the largest thing to the smallest: an amoeba closes round a bacterium, one of its mitochondria goes by slice by slice, a phage lands on a bacterium and empties itself into it, virions bud from a cell and drift off on black. A new style: every scene is one grey signal seen by an instrument made of code (focus, shot noise) and tinted afterwards; three of the seven shots are matched to reference micrographs.
  • Lightfield: Five lights, from the sky to the bench: the Sun comes up over the edge of the Earth, the Moon covers it and the corona opens, a prism splits a white beam into its colours, red light goes through two slits one photon at a time until the hits draw the fringes, and a filament heats up and lights the title. Nothing is drawn: each scene says how much light leaves every point and a camera made of code photographs it. The first and last shots are matched to two reference stills (the last one studies the title card of «InGenius by Veritasium»); the three in between are built from the physics, with a narrator and a score.
  • Pier Pressure: The opening of a cartoon that never existed, in the look of a late-'90s extreme-sports TV show: four kids chase a one-eyed gull who has made off with Aunt Dot's chips, down the pier and off its end. It opens on the chase in black shapes, and nobody is seen until their name card. The characters are generated model sheets turned into drawings in code by measurement, and they move the way cel animation does: by changing drawing, on twos. Cut to the words of its own theme song, with a broadcast finish (painted fills, film weave, standard-definition softness).
  • Runnin' Down a Dream: A full videoclip for Tom Petty's song, played as a VHS tape on a CRT in the look of a '90s cereal commercial. The Devil is the tape's mascot and wants Tom's signature on a contract: he chases the band's car down Route 66 with a hole, a rain machine and a frozen Hell, books them into his own venue, loses a guitar duel, and rides the bonnet through Heaven to a concert on the moon. He ends up with an autograph. Twenty-six blocks animated in parallel from written briefs; every mouth follows a word-level transcription of the track.
  • The Red Thread: A river village where every greeting ties a red thread. Screens and slogans split it into two banks, the threads snap and the red drains out of the world, until a girl's red kite carries one thread back across the river and the threads weave a new bridge. Japanese ink painting on washi, every brushstroke drawn in code, the text written vertically in Japanese; score by ElevenLabs Music, effects synthesized.
  • A Brief History of Physics: Galileo's eye at the telescope pulls back to a rooftop in Padua; Jupiter becomes the apple a cat pushes onto Newton's head; its orbit winds into Faraday's coil, whose spark is the glow of Curie's radium; its ray is the light young Einstein chases into a black hole; and the cube it leaves becomes Schrödinger's box, where the cat is alive and dead in sixteen worlds until the lid lifts. One continuous chain of objects, the same cat in every scene, drawn entirely in JavaScript; score and effects generated with ElevenLabs.
  • The pyramid that makes skies: A plate of the «Description de l'Égypte» comes alive: a mark is painted on a stone, the pyramid opens into thousands of floating blocks, and the camera flies without a cut through a temple's rooms (each joined to the next by a doorway in the shot) to a seed that holds a sky of its own and leaves as a new star. 3D in WebGL, drawn in charcoal on old paper; music made with ElevenLabs.
  • opus5-riso: A 1:1 replica, made as a study, of a risograph film by Kevin Ngo (@kevin_t_ngo). The original design and animation are his. Four spot inks, halftone and misregistration from a simulated press, scored tile by tile against the original by the detail gate.
  • what-do-you-love: A 1:1 replica, made as a study, of a paper-cutout video by Kevin Ngo (@kevin_t_ngo). The original design and animation are his. Measured drawing by drawing until the differences only show when zooming in (skill replicate). His video also inspired the first saas-promo.

Every experiment, with its status and main lesson, is in sandbox/INDEX.md.

Where the films go next: Postbay

Postbay: review, approve and publish your social content, with your team and your AI agents

Postbay is from the same author as this repo, and it is where a film goes once it is rendered: an open-source, self-hosted studio to review, approve and publish social content with your team and your AI agents.

  • Review on the exact frame: comment on a moment or a span of a video, draw on the frame, compare two versions side by side.
  • Approvals bound to the exact file: change one byte and the approval no longer counts.
  • A calendar that publishes to nine networks, or gets everything ready for a person to post.
  • Made for agents, and for Claude: it is an MCP server, and it pairs with drawn-by-code. When a piece comes from a project like the ones in sandbox/, a request for changes becomes the next version: the agent edits the scene, renders it again and uploads the result.

postbay.app · the code on GitHub · MIT

Styles

Each style is a drawing kit, a template and a skill with its rules. Open a style's folder to see its strip, files and the videos made with it.

Style Look Status
paper-cutout torn paper, marker, grain, handwriting, real hands approved
risograph four spot inks, halftone, overprints, misregistration approved
sumi-e Japanese ink on washi: dry brush, washes in mist, vermilion as the only colour approved
engraving a plate of the «Description de l'Égypte» drawn in charcoal on old paper, temple reliefs approved
cereal-ad a '90s cereal spot on VHS: cel boxes, sunbursts, extruded letters, tape noise on a CRT approved
skate-toon a late-'90s extreme-sports TV cartoon: cast drawn from model sheets, on twos, SD finish approved
70s-poster flat acid colours, echoes, sunbursts, melting letters approved
liquid-light merging oil blobs, a 60s light show approved
kaleidoscope mirror symmetry, rotation, colour cycling approved
line a wobbling black line on white paper approved
clay 2D plasticine: bevels, fingerprints, soft shadows in testing
clay3d 3D plasticine puppets, raymarched, studio light in testing
felt3d needle-felted wool puppets, raymarched, over any backdrop in testing
tabletop3d desk objects as stop motion, raymarched: chrome, rubber, paper, a shallow depth of field in testing
lightfield light photographed: radiance through a lens and film (bloom, halation, rays, grain) approved
micrograph false-colour micrographs: one grey signal, sharp grain on soft structures, a few inks approved
blueprint a cyanotype drafted line by line: elevations, sections, dimensions, lettering approved
comic brush-ink outlines, flat print colours on newsprint, Ben-Day dots, balloons in testing
pixel-art crisp pixels on a low-res grid, sprite maps, 10 fps loops in testing

To add one: the new-style skill, and CONTRIBUTING.md for the pull request.

Getting started

Requirements: Node 20 or later, Chrome or Chromium, and ffmpeg (sh engine/setup.sh installs what is missing).

npm install
node engine/new.mjs my-test --style paper-cutout --duration 5
npm run preview                                      # http://127.0.0.1:5173
node engine/review.mjs sandbox/<exp>/scene.js        # automatic review + contact sheet
node engine/render.mjs sandbox/<exp>/scene.js --size 1920   # the MP4

With Claude Code, just ask: "make me a 10 s paper-cutout video for…". The animate skill guides the process: brief → script → style test → animatic → final.

How it works

  • A scene is a pure function of time. Motion.scene({ draw(g, t, env) }) paints frame t with no state carried between frames, so any frame can be rendered alone and the review can check determinism. Stop-motion styles change drawing every 1/12 s ("on twos").
  • The engine (engine/): player.html runs the scene in headless Chromium, render.mjs pipes the frames to ffmpeg, and review.mjs critiques a render (still stretches, jumps, holes, speed, determinism) and makes a contact sheet. There are also:
    • reference.mjs: measures a reference video (colours, positions, cuts, tracking, side-by-side comparisons);
    • tempo.mjs: reads BPM and loudness;
    • mix.mjs: music plus effects, each aligned on the frame where you hear it;
    • transitions.js: transitions between styles;
    • gif.mjs and strip.mjs: the GIFs on this page and the strips in each style's folder.
  • Skills (.claude/skills/) hold the process and the taste:
    • animate (brief to MP4) and review (the critique loop);
    • engine and sound;
    • replicate (copying a reference 1:1) and transitions;
    • one skill per style.

How it learns

brief ─▶ scene.js ─▶ review.mjs ─▶ Claude's critique ─▶ fix  (≤3 rounds)
                                                     │
                                       user feedback ◀┘
                                                     │
      does it generalize? ─▶ style skill / animate / engine / sound / review.mjs
                                                     │
                                             commit per round

What the user said is kept in each experiment's review.md (in English: they speak Spanish, and their feedback is translated before it is written down). A lesson that generalizes becomes a rule in a skill: hands drawn by side and view, logos traced from the brand's SVG, bounding volumes that must not cast shadows.

Repository

Path What it is
engine/ the engine and its tools
styles/<style>/ a style's kit, template, strip and README
.claude/skills/ Claude's skills: process, engine, sound, one per style
sandbox/<date>-<name>/ one experiment per folder: brief, scene, reviews, contact sheet, latest render
assets/sfx/, fonts/ sound effects and freely licensed fonts
CONTRIBUTING.md how to add or improve a style by pull request

Licenses

Patrick Hand, Shrikhand and Short Stack fonts under the SIL OFL 1.1 (fonts/). The effects in assets/sfx/ were generated with ElevenLabs: commercial use requires a paid plan. A client's source files (brand copy, logo files, fonts, music) live in the experiment's private/ folder and are not committed, or in the client's own repo: a folder marked with a drawn-by-code.json renders with this engine from outside (skill engine).

About

Animation drawn by code with Claude — no AI video: an engine, styles and skills that learn from every render, all in the open. PRs with new styles welcome.

Topics

Resources

Contributing

Stars

60 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages