← Blog

How to Reverse-Engineer a Viral Video, Shot by Shot

To reverse-engineer a viral video, you write down the decisions that make it work: where it cuts and what changes at each cut, when every caption appears and goes, how the sound lines up with the picture, and what each beat does for the viewer. Then you decide which of those your own version keeps and which it changes. This guide covers what to pull out of a short video, how to get it measured rather than guessed with riffsheet (a free, open-source skill we released in November 2026 for Claude Code, Codex and other coding agents), and two worked examples on videos of ours.

What a shot-by-shot breakdown should give you

A useful breakdown answers six questions, and each answer is something you'll keep or rebuild in your own version.

  • Where are the cuts, and what kind are they? A hard cut, a fade, a one-frame flash. Their times set the rhythm, and a few frames off changes how an edit feels.
  • What text is on screen, and when? The words of each caption, the frame it appears on and the frame it's gone, its position, size and colors.
  • How does the sound line up with the picture? Whether cuts and caption appearances land on loudness peaks, and in a talking video, each spoken line with its time and pace.
  • What's in each shot? Who is in it, what they wear and hold, the framing, whether the camera moves, the place and the light.
  • What does each beat do for the viewer? What the viewer knows before the beat and after it, and why they keep watching.
  • What must your version keep, and what can it change? One test per beat that your version has to pass, and a list of what's free to swap.

Measure what can be measured, describe the rest, and mark what isn't settled. Cut and caption times can be measured from the frames; loudness and word times, from the sound. What people wear, what the camera does and why a beat works have to be read from the pictures. Timing by hand at full speed misses exactly the things that matter here: a flash frame lasts one frame (1/24 of a second in the first example below), a fade has no clean edge to time, and speech recognition can return words where nobody speaks, as it did on that same example.

Run the breakdown with riffsheet in Claude Code or Codex

riffsheet (riffkit/riffsheet on GitHub, MIT) is an agent skill. The tool measures the cut times, the frame on which each caption appears and the frame on which it's gone, whether the camera holds still, the loudness and the time of each spoken word. It lays out pictures of each moment, and your coding agent reads those pictures for the rest and writes the breakdown. The tool runs on your computer, needs no account and sends nothing to us; what your agent sends to its own model provider is between you and your agent.

  1. Have ffmpeg 7 or newer and Python 3.9 or newer. ffmpeg has to be built with freetype, which draws the labels on the sheets: Debian's and Ubuntu's packages are. On a Mac, Homebrew's plain ffmpeg isn't, so install ffmpeg-full (brew install ffmpeg-full). Homebrew keeps it out of its own bin folder: add export PATH="$(brew --prefix ffmpeg-full)/bin:$PATH" to ~/.zshrc to put its bin folder first on your PATH, then open a new terminal. The tool uses only Python's standard library. For spoken words it needs a speech recognizer; its own is the optional faster-whisper package, with a speech model of about 500 MB. When a video's speech matters and the recognizer isn't set up, your agent tells you what it would add and sets it up only if you say yes.
  2. Give your agent the skill. In Claude Code, Codex or any agent that runs commands and opens images, say: "Install the riffsheet skill from https://github.com/riffkit/riffsheet, then break down ~/Downloads/clip.mp4". You can also run npx skills add riffkit/riffsheet, or in Claude Code run claude plugin marketplace add riffkit/riffsheet and then claude plugin install riffsheet@riffsheet.
  3. Ask in your own words. "Break down this video shot by shot." "Why does this TikTok work? I want to make my own version." "List every caption with its timing."

It works from a video file, so download the clip first. A short clip takes about 4 to 8 minutes, nearly all of it your agent's work; the tool's own steps take seconds. What it costs is your agent's usage, which comes mostly from the pictures it opens, so the procedure batches them and the tool prints each picture's estimated token cost. You get two files: riffsheet.md to read, and riffsheet.json with every value and where it came from (measured by the tool, seen by the agent, heard by the agent only after it passes the tool's hearing check, inferred, uncertain, established by the agent's own means, or not judged).

Worked example: a 12-second outfit reveal, beat by beat

This is the red-carpet example in the repository: a video of ours, 12 seconds, edited to music, with nobody speaking. A coding agent that had never seen the project wrote the breakdown, and nothing it wrote was edited.

The red-carpet video playing beside its riffsheet: a timeline of the measured shot changes and flashes, the on-screen caption, the loudness curve and four beats, with the agent's reading of each shot

The shots. She slumps on a fire escape at dusk in an oversized gray sweatshirt, under the caption "can't tonight, way too much going on". She kicks her foot at the camera until the sole of her sneaker fills the frame; the picture washes white and fades into the back seat of a car at night, where she wears a gold satin dress and long cream gloves and turns to smile at the lens. A hard cut shows her stepping out of a black car into a chandeliered hotel entrance, and with bursts of light she walks down a red carpet toward the camera in a long cream coat while petals fall.

The beats. The breakdown splits the 12 seconds into four beats and gives each one a test for your version:

Beat Time What it does for the viewer Your version has to pass
Attention 0.0 to 3.0 s A low, ordinary start: the caption claims she's busy while the picture shows her idle, so the viewer waits to see which is true Does the opening show the subject at their least polished, with one line of text that the reveal will contradict?
Interest 3.0 to 4.2 s A kick at the lens blocks the view and promises a change Does something move at the lens until it fills the frame, so the next shot starts out of that covered frame?
Payoff 4.2 to 7.8 s The same person in the opposite, high-status state; her smile at the lens lets the viewer in on the joke Does the first frame after the transition plainly contradict the opening line?
Retention 7.8 to 12.0 s A slow walk toward the lens while flashes and petals keep filling the frame Does the final shot keep adding visual elements while the subject approaches the lens, until the last frame?

The timing it measured. The tool finds two shot changes, the fade out of the white frame (4.25 to 4.375 s) and a hard cut at 6.375 s, and two flash frames at 7.292 and 7.792 s, each lighter than both of its neighbors. Both shot changes land on a loudness peak or rise, within 0.052 seconds, and so do both flashes, where about 0.5 of each would by chance, with 17 peaks and rises in the 12 seconds. That's "the edit is cut to the sound", measured, and those are the times your version can cut on.

What it held back. Speech recognition reported a short Korean phrase in the sound track. The agent checked her mouth frame by frame, found her lips closed, and wrote no spoken lines. It marked as not judged what the track is (music, effects or ambience), whether the flashes are meant as photographers' cameras, and whether the half-second peaks match her footsteps. Where her face is small in the wide shots, it marked her identity as uncertain instead of assuming.

What you can change. The breakdown lists it: the person and both looks, the excuse line in the caption, the dull opening place and the glamorous destination, the object that covers the lens (a shoe here; a hand, a jacket or a bag would do), and the effects in the last shot. It's a close cousin of the camera-block outfit swap we timestamped earlier, where a shirt covers the lens instead of a shoe.

A talking video: the captions carry the timing

The outfit-rules example is 8 seconds of Spanish spoken to the camera, with captions: 4 shots and 5 spoken lines, each outfit shown with a verdict. Here the sound reads the other way round. None of the 3 cuts lands on a loudness peak or rise (about 0.4 would by chance), but 4 of the 5 caption appearances do (about 0.7 would by chance). In this video the captions, not the cuts, line up with the sound, so they're the timing to keep.

The agent also corrected a word that speech recognition misheard, "olvado" to "holgado", from a caption that showed the line word for word, and it noted the change in riffsheet.json. One of its tests for your version: "Does each outfit change at a cut together with its rule label, and does at least one verdict break the run of approvals with a visibly different reaction?"

How far to trust the breakdown

We tested development builds made before the release, on November 27, 2026 (the method and every count; the same results with charts):

  • Statements. On ten videos of 8 to 45 seconds, in English, Chinese and Korean, a separate agent checked each statement against the frames: 649 correct, 23 wrong, 17 missed.
  • Cuts. On six videos checked for cuts, it found 24 of 25 hard cuts, with no false cut. On a 45-second talking video with 9 jump cuts inside one framing, the release build found 7.
  • Captions. On two videos with frame-by-frame ground truth, caption on and off times were exact to the frame.
  • A video it had never seen. On a 10.6-second clip that played no part in development, scored against 137 facts listed from its frames beforehand, it stated 64 exactly and 36 partly, and contradicted none.

The checking agents are the same kind of model as the one writing, sound wasn't scored, results vary from run to run by a few statements per video, and ten videos is a small sample.

What riffsheet doesn't do

  • Say what a sound is, by itself. The tool measures loudness, word times and where sound events fall on the cuts and captions, but not what a sound is. Most agents cannot hear either, so music, tone of voice and sound effects are marked as not judged; an agent whose model takes sound as input can describe them after it passes the tool's hearing check. We verified the check with a hearing model driven by a script, and at our request someone ran the whole path once with a coding agent; what an agent says it heard is its account, not a measurement.
  • Take a link. Give it the video file.
  • Handle long videos well. It's made for clips up to about a minute and was tested on clips of 8 to 45 seconds. Past three minutes, the tool warns you what will be slow.
  • Catch every edit. A jump cut inside one framing is found only when a tenth of the picture or more changes in one frame and the colors stay the same (7 of 9 on a 45-second talking video); smaller jumps are flagged for the agent or missed, a different outfit, person or object faded in over the same background is not detected, and a slow dissolve can be missed. A flash is told apart from a change of picture only when the whole change takes two or three frames; a longer one counts as a shot change. Known issues are listed in the open on GitHub.

From the breakdown to your own version

The breakdown tells you what each beat does and what your version has to keep. Captions, cards and the edit can be rebuilt from the measured times, boxes and colors, in an editor or with ffmpeg. Footage of people, places and products needs a camera or a video model.

Riffkit makes that footage from your original video, with a free start. Swap keeps the shots and changes who or what is in them: the person, the outfit, the place or the product. Adapt keeps what made the video work and tells a new story. Riffkit's skill for coding agents tells your agent how to pass a riffsheet along with the video.

The red-carpet video has been through Swap on this blog twice: as hand-drawn animation with the same shots and cuts, and with the gold gown and cream coat changed to emerald velvet and black.

The red-carpet video beside a hand-drawn animation version of the same shots

The outfit-rules video moved to a beach boardwalk with Swap. Measured with riffsheet, 2 of its 3 cuts and 7 of its 10 caption on and off times fall on the same frame as the original's, and the rest within one frame.

Three moments of the outfit-rules video, each with the original indoors on the left and the new version on a beach boardwalk at sunset on the right: the same woman, the same outfits and the same Spanish captions

Start with riffsheet on GitHub, or read its page on our site. For other ways to get a video in front of Claude, see Can Claude analyze videos?

FAQ

How do you reverse-engineer a viral video?

Write down the decisions that make it work: where it cuts and what changes at each cut, when each caption appears and goes, how the sound lines up with the picture, what is in each shot, and what each beat does for the viewer. Then decide what your own version keeps and what it changes. riffsheet, a free open-source skill made by Riffkit, does this with Claude Code, Codex or another coding agent on a video file on your computer: the tool measures cut, caption, loudness and spoken-word times, and the agent reads pictures of each moment for the rest.

What is a shot-by-shot breakdown of a video?

A written account of a video in order: each cut and what kind it is, each caption with its words and on and off times, what each shot shows (people, clothes, framing, camera, place, light), what is said and when, and what each beat does for the viewer. A breakdown made for remaking also gives one test per beat that a new version has to pass and lists what can be changed. riffsheet, made by Riffkit, writes one as riffsheet.md, with every value in riffsheet.json.

Can Claude Code break down a video shot by shot?

Yes, with a skill. riffsheet (riffkit/riffsheet on GitHub, MIT) is an agent skill for Claude Code, Codex and other agents that run commands and open images. Tell your agent "Install the riffsheet skill from https://github.com/riffkit/riffsheet, then break down ~/Downloads/clip.mp4". A short clip takes about 4 to 8 minutes, nearly all of it the agent's work. It needs ffmpeg 7 or newer and Python 3.9 or newer; for spoken words it uses a speech recognizer (its own is the optional faster-whisper package), which your agent sets up only if you say yes.

Is riffsheet free?

Yes. riffsheet is open source under the MIT license, runs on your own computer, needs no account and sends nothing to Riffkit, which makes it. What a breakdown costs is your coding agent's usage, which comes mostly from the pictures the agent opens; the tool prints each picture's estimated token cost.

How accurate is an AI video breakdown?

For riffsheet, Riffkit tested development builds on November 27, 2026. On ten videos of 8 to 45 seconds in English, Chinese and Korean, a separate agent checked each statement against the frames: 649 correct, 23 wrong, 17 missed. On the six videos checked for cuts, riffsheet found 24 of 25 hard cuts with no false cut, and caption on and off times were exact to the frame on two videos with frame-by-frame ground truth. The checking agents were the same kind of model as the writer, sound was not scored, and ten videos is a small sample.

Can riffsheet break down a TikTok from a link?

No. riffsheet works from a video file on your computer, so download the clip first and give your agent the file. It is made for clips up to about a minute and was tested on clips of 8 to 45 seconds. The tool measures loudness and word times but not what a sound is, and most agents cannot hear either, so music, tone of voice and sound effects are usually marked as not judged. An agent whose model takes sound as input can describe them after it passes the tool's hearing check. Riffkit verified the check with a hearing model driven by a script, and the whole path was run once with a coding agent; what an agent says it heard is its account, not a measurement.

How do I make my own version after breaking a video down?

Use the breakdown's tests for each beat and its list of what can change. Captions, cards and the edit can be rebuilt from the measured times in an editor or with ffmpeg. Footage of people, places and products needs a camera or a video model: Riffkit makes it from your original video, with a free start. Swap keeps the shots and changes the person, outfit, place or product; Adapt keeps what made the video work and tells a new story.

Keep reading

Put a Costume on Someone in a Video With AI: Our Real Test

We put a full Santa costume on a woman in an 8-second video with AI: jacket, belt, trousers, boots and hat at every check. The exact brief, cost and checks.

How to Make AI Fruit Videos: Our Prompt, Cost and Real Test

We made the opening of an AI fruit drama from one prompt: three shots, two spoken lines, 8 seconds. The exact prompt, the cost and what drifted.

Change What Someone Says in a Video With AI: Our Test

We had the man in our 8-second selfie say a new line with Riffkit's Adapt. The transcript, the mouth and the face all checked out. Steps and exact prompt.