Skip to main content
rule CX Codex

trimming — Claude Code rule: what it does, how to install

Guides Claude Code on Remotion animation trimming patterns, from cutting intro frames to capping duration and combining delays.

no license ★ 849 updated 2026-01-24

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

What trimming does

This rule provides concise implementation patterns for Remotion's <Sequence> component. Passing a negative number to the from prop shifts playback backwards. The nested component starts mid-animation, skipping early frames, while useCurrentFrame() inside the child begins counting directly from that offset instead of frame zero.

To clip the tail end, the rule applies durationInFrames so the component unmounts once the frame budget runs out. Handling both an intro skip and a delayed entrance requires nesting sequences: the outer container sets a positive offset for latency, while the inner one applies a negative value. Frame calculations depend on useVideoConfig(), so timing breaks whenever fps conversions are omitted.

What it helps with

  • Trim opening frames from a Remotion animation
  • Unmount components after a set duration with durationInFrames
  • Combine an appearance delay with an intro frame cut
  • Offset useCurrentFrame so child components begin partway through

Example prompts for the agent

  • Trim the first half second off my animation using Sequence and fps
  • Delay this clip by 30 frames while cutting 15 frames from its start
  • Stop and unmount the animation after 1.5 seconds of playback

How to install trimming

Manually: put the files in place

.claude/rules/trimming.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 trimming

How to install trimming in Claude Code?

Place the rule file into your repository at .claude/rules/trimming.md.

What does trimming do?

It gives the assistant clear patterns for cutting Remotion animations at both ends using negative sequence offsets and duration boundaries.

How do you delay a clip while trimming its start?

Nest two <Sequence> elements: set the delay on the outer sequence with a positive from, and cut the start on the inner sequence with a negative from.

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set33

The whole set →
text-animations text-animations — a rule with text animation patterns for Remotion: typewriter effect and word highlighting. Used for videos with dynamic typography. CX Codex +1 ★ 849repo stars animations animations directs Claude Code to animate Remotion components with frame hooks instead of broken CSS transitions. CX Codex +1 ★ 849repo stars transcribe-captions The transcribe-captions rule outlines three ways to transcribe audio for Remotion captions: run Whisper.cpp on a server, use WebAssembly in a browser, or call OpenAI Whisper API. CX Codex +1 ★ 849repo stars measuring-dom-nodes The measuring-dom-nodes rule covers measuring DOM element sizes inside Remotion compositions without the video container's scale distorting the numbers. CX Codex +1 ★ 849repo stars get-video-duration The get-video-duration rule shows how to read a video’s duration in seconds with Mediabunny. Use it when code needs the length of a remote or local clip. CX Codex +1 ★ 849repo stars get-audio-duration get-audio-duration — a rule that teaches Claude Code to extract audio file duration in seconds using the Mediabunny library. CX Codex +1 ★ 849repo stars can-decode Checks whether the browser can decode a video or audio stream before attempting playback using Mediabunny. CX Codex +1 ★ 849repo stars assets The assets rule guides Claude Code in adding images, video, audio, and fonts to Remotion projects. Use it when an agent needs to wire media into a composition. CX Codex +1 ★ 849repo stars

Project sponsors

Companies that keep this analytics open