extract-frames — Claude Code rule: what it does, how to install
extract-frames guides Claude Code in extracting video frames at specific timestamps using Mediabunny and rendering them to canvas.
no license ★ 849 updated 2026-01-24
.claude/rules/extract-frames.mdWhat extract-frames does
This rule injects an extractFrames TypeScript utility into Claude Code context for media processing tasks. It instructs the agent on reading container tracks, pulling discrete frame samples through mediabunny, and drawing them onto an HTML canvas surface.
The guidance covers generating static thumbnails, assembling filmstrips with dynamic interval math, and aborting slow runs using AbortSignal or timeout races. Without the mediabunny package and a functional canvas environment, the generated code fails.
What it helps with
- extract video frames at exact timestamps for thumbnails
- generate filmstrip previews by calculating dynamic time intervals
- render video samples onto an HTML canvas element
- cancel slow frame extraction runs with AbortSignal or timeouts
Example prompts for the agent
- Write a helper to grab thumbnail frames from a video URL using Mediabunny
- Create a filmstrip generator that calculates timestamps from video duration
- Add cancellation to the frame extraction pipeline using an AbortController
How to install extract-frames
Manually: put the files in place
.claude/rules/extract-frames.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/extract-frames.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/extract-frames.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/extract-frames.mdManually: put the files in place
.clinerules/extract-frames.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about extract-frames
How do I install extract-frames in Claude Code?
Place the rule file into your project at .claude/rules/extract-frames.md. Claude Code will automatically reference these instructions during code generation.
What does extract-frames do?
It provides a reusable TypeScript function for grabbing frames from video files at specified timestamps using the Mediabunny library.
What dependencies does extract-frames require?
Your project must have the mediabunny package installed and run in an environment that supports the standard HTML canvas API.