Open source · Agent skill · Apache 2.0

Draw any person as data. Direct them with a script.

CharAI is an open-source 2D character animation engine and AI agent skill. An agent, or you, draws a human as a small data file and directs it with a short .char script. The engine adds motion, physics, moods, lip sync, speech and two-character contact.

Apache 2.0Version 1.0.0Side viewNo runtime dependencies

What is CharAI?

CharAI is an open-source (Apache 2.0) 2D character animation engine and agent skill. An AI agent, or a person, draws any human as a small data file and directs it with a short .char script; the engine supplies the skeleton, motion, physics, moods, lip sync, two-character contact and props. It draws people only, in side view, has no runtime dependencies, and exports MP4, transparent WebM, ProRes, PNG sequence and animated SVG.

How it works

A person is data, a film is text

Every frame is a pure function of time, seek(t), so any tool with a clock can drive it. There is one script file, dist/char.js, and a <char-stage> web component.

film "Hello" 6s
actor Kai = skin kai at 160
0.0 Kai: walk(to=700), face(happy)
2.0 Kai: say("Nice to meet you.", for=2)

This is a complete film. Each line is a time, an actor and calls such as walk, face, say and hug.

  1. Draw a character

    A skin is a small file of numbers plus a few SVG paths, 1.3 to 2.2 KB. Claude Sonnet wrote one in about 41,800 tokens.

  2. Direct with a script

    Write timed lines for each actor. Moods, speech, camera moves, pair actions and props are all calls in the same file.

  3. Render or embed

    Export MP4, transparent WebM, ProRes, a PNG sequence or animated SVG, or show the characters live in a web page. Scenery is not drawn; the host supplies it.

What it does

Motion, physics, speech and contact, built in

Characters only, side view only. The agent writes the person; the engine does the rest.

Any body from numbers

A character is a small skin file of numbers plus a few SVG paths, 1.3 to 2.2 KB. Six very different bodies can jump for joy from one engine.

Physics that settles

Hair and a scarf swing and settle after a stop. Spring physics, not full simulation.

Moods change the walk

Happy, sad or angry: mood() colours every move until the next mood line.

Speech and lip sync

say() speaks a line with lip sync from the text, and a caption draws the speech bubble. Lip sync matches the speech but is not polished.

Characters that touch

Pair actions such as hug, handshake, shove and hand over are driven by one script line. Props can be picked up, carried, thrown, sat on or leaned on.

One line of script

Each line is a time, an actor and calls such as walk, face, say and hug. Change one moment by editing one line and rendering again.

Evidence

Measured, including where CharAI lost

“Without” means an agent hand-codes each film; the measured baseline is the Lemo-Opuscar style-library workflow.

Without CharAIWith CharAI
A characterre-coded inside every filmone skin file of 1.3 to 2.2 KB, reused unchanged
Two 30-second episodes, Claude Sonnet667,202 tokens, 74 minutes425,057 tokens, 25 minutes
Two 30-second episodes, Claude Opus532,368 tokens, 39 minutes477,333 tokens, 33 minutes
A new actionkey poses inside the film's codea 0.4 to 0.7 KB file, about 8,200 Sonnet tokens
On a smaller modelcost more than the larger modelthe cheapest run of all
Changing one momentregenerate; the rest may changeedit one script line and render again; only what follows from the edit changes
A scenery-rich one-off film (silhouette, Opus)318,987 tokens, 24.7 minutes, better-looking391,611 tokens, 35.7 minutes: CharAI lost
Views and 3Danything the agent can codeside view only, no 3D

Single runs; the baseline's setup and the engine's build cost are not counted. Each case was run once. CharAI lost the silhouette film on cost and looks, and that comparison has not been re-run. Full figures are in the evidence and comparison documents in the repository.

Works with

An agent skill and a web component

Quick start

Get started in three steps

Needs Node 18 or newer. For pictures and video also Chrome or Edge, and ffmpeg for MP4.

With Claude Code (the skill)

  1. Install the skill

    Run git clone https://github.com/riponcm/CharAI .claude/skills/charai.

  2. Install the dependencies

    Run cd .claude/skills/charai && npm install.

  3. Ask Claude Code

    Ask: "Use CharAI to draw a character, a tall grandmother with a silver bun and a green cardigan, and show me her cast sheet."

By yourself, with the engine

  1. Clone and install

    Run git clone https://github.com/riponcm/CharAI && cd CharAI && npm install.

  2. Check a film

    Run node tools/check.cjs examples/hello.char.

  3. Render it

    Run node tools/render.cjs examples/hello.char hello.mp4 and watch eight seconds of a girl walking in and waving.

Limits and status

What it does not do yet

FAQ

Questions, answered

What is CharAI?

CharAI is an open-source 2D character animation engine and agent skill. An AI agent or a person draws any human as a small skin data file and directs it with a short .char script; the engine supplies skeleton, motion, physics, moods, lip sync, two-character contact and props.

Is CharAI free?

Yes. CharAI is free and open source under the Apache License 2.0, and it has no runtime dependencies. The only cost is the tokens of the AI agent you use to draw characters and write films, which the measured figures on this page show.

What is a .char script?

A .char script is a plain-text film. Each line is a time, an actor and calls such as walk, face, say and hug, for example: 2.0 Kai: say("Nice to meet you.", for=2). The engine turns the script into motion, so changing one moment means editing one line.

How do I animate a character with Claude Code?

Put the CharAI repository in .claude/skills/charai/ and ask Claude Code to draw a character or write a film. It reads SKILL.md, follows the document for the job, then loops: write, run the check, look at the picture, fix.

Does CharAI work with agents other than Claude?

Any agent that can read a skill file and run Node could use it, but only Claude models have been tried, so it is not tested with others.

What do I need to run it?

Node 18 or newer. For pictures and video you also need Chrome or Edge, and ffmpeg for MP4. The check tools need nothing else.

What can CharAI export?

MP4, transparent WebM, ProRes, a PNG sequence, or animated SVG. You can also show the characters live in a web page with the char-stage web component. CharAI draws characters only; the host supplies the scenery.

Does it work with HyperFrames, Remotion or GSAP?

Every frame is a pure function of time, seek(t), which is the contract those timelines use, and the docs include a snippet for each. Those three snippets are untested; two plain-HTML host examples are tested.

How does it compare with Lemo-Opuscar?

Lemo-Opuscar is a style library for code-made films. On two 30 second episodes on Sonnet, CharAI used 425,057 tokens against 667,202. On a 30 second silhouette film on Opus it lost, at 391,611 tokens against 318,987, and looked worse. These are single runs, and CharAI is meant to complement style libraries as their character layer.

Why use CharAI when new models can animate freehand?

Code-made animation by frontier models is improving fast, but those films are generated from scratch each time, so the cost is paid again for every film and every change, and characters are re-drawn each time. CharAI does the repeated part once. It has been tried only with the Claude models named in the evidence and has not been compared with any unreleased or newer model.

Which models built it?

It was built with Claude Code. Claude Fable 5.2 was architect and reviewer, Claude Opus 5.5 wrote the engine code, and Claude Sonnet wrote characters, actions, scenes, tools and packaging from the documents alone. Only Claude models have been tried.

What does it cost in tokens?

Claude Sonnet wrote a character in about 41,800 tokens, an action in about 8,200, and a 20 second two-character scene in 98,844. Each figure is one run.

What can't it do?

Side view only (no three-quarter or front view), flat cartoon styles, no scenery, no 3D, simple hands, and spring physics for hair and cloth rather than simulation. Lip sync matches the speech but is not polished.

Does it need an artist or motion capture?

No. The agent writes a skin as numbers plus a few SVG paths, and motion comes from the engine's actions, which are a few key poses each. There is no library of ready-made characters; a few worked examples are included.

How do I add a new action?

Write a small file of key poses in body terms, register it in CharActions, and check it with the action checker tool. The format is in the actions document in the repository.

What licence is it under?

Apache License 2.0, with a NOTICE file. It has no runtime dependencies.

Get CharAI

Draw a person. Direct them. Render.

Free and open source under Apache 2.0. Clone it, try the hello film, and share what you make in Discussions.