gifs — Claude Code rule: what it does, how to install
gifs is a Claude Code rule for synchronizing GIF, APNG, AVIF, and WebP animations with Remotion composition timelines.
no license ★ 849 updated 2026-01-24
.claude/rules/gifs.mdWhat gifs does
This rule teaches Claude Code how to integrate animated files into Remotion using <AnimatedImage>. It details layout fitting options, playback speed controls, and end-of-animation behavior such as freezing on the last frame or clearing canvas elements.
Dynamic duration calculation relies on getGifDurationInSeconds from @remotion/gif to fit timeline composition length. Because <AnimatedImage> works exclusively in Chrome and Firefox, the rule defines a fallback path with the <Gif> component. Any remote image link must have CORS headers enabled to avoid runtime browser blocking.
What it helps with
- synchronize GIF or WebP playback with the Remotion timeline
- adjust composition length automatically based on animation duration
- configure loop behavior, playback rates, and container fitting
- set up a fallback for browsers where AnimatedImage is unsupported
Example prompts for the agent
- Insert animation.gif into my Remotion composition at double speed
- Calculate video timeline length from animation.gif duration
- Add a WebP asset that stops on its final frame instead of looping
How to install gifs
Manually: put the files in place
.claude/rules/gifs.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/gifs.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/gifs.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/gifs.mdManually: put the files in place
.clinerules/gifs.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about gifs
How to install gifs in Claude Code?
Add the rule configuration file to your project directory at .claude/rules/gifs.md.
What animated formats work with this rule?
The <AnimatedImage> component handles GIF, APNG, AVIF, and WebP files. The alternative <Gif> component supports only GIF assets.
Why does AnimatedImage fail in some browsers?
<AnimatedImage> is supported only in Chrome and Firefox. Projects targeting other rendering environments require the <Gif> component from @remotion/gif.