Skip to main content
rule CX Codex

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

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/extract-frames.md
Open on GitHub

What 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.md

The paths frontmatter field limits the files

Step 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.

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set33

The whole set →
transitions This rule guides Claude Code in adding fullscreen transitions between Remotion scenes or clips. Use it when building a composition from multiple scenes. CX Codex +1 ★ 849repo stars audio Rule for handling sound in Remotion: import audio files, trim, adjust volume and playback speed, shift pitch. Requires the @remotion/media package. CX Codex +1 ★ 849repo stars gifs gifs is a Claude Code rule for synchronizing GIF, APNG, AVIF, and WebP animations with Remotion composition timelines. CX Codex +1 ★ 849repo stars timing This rule covers interpolation, easing, and spring motion in Remotion. Use it when animations need frame-based timing and controlled movement. CX Codex +1 ★ 849repo stars mcp-client The mcp-client skill links Claude Code to any MCP server and pulls in tool schemas on demand instead of loading them all at once. CX Codex +1 ★ 849repo stars sop-creator The sop-creator skill turns repeatable technical work into usable SOPs, runbooks, and playbooks. Use it when a team needs clear operational documentation. CX Codex +1 ★ 849repo stars brand-voice-generator brand-voice-generator is a Claude Code skill that builds brand settings and voice guidelines for content. It activates when asked to define a brand identity or prepare a visual style for presentations. CX Codex +1 ★ 849repo stars pptx-generator pptx-generator generates PPTX presentations and square PDF carousels matching brand guidelines. Builds decks in batches of up to five slides. CX Codex +1 ★ 849repo stars

Project sponsors

Companies that keep this analytics open