can-decode — Claude Code rule: what it does, how to install
Checks whether the browser can decode a video or audio stream before attempting playback using Mediabunny.
no license ★ 849 updated 2026-01-24
.claude/rules/can-decode.mdWhat can-decode does
The rule guides the agent to inject a ready-made canDecode helper in TypeScript. It constructs a Mediabunny Input instance, verifies container parsing, and tests decodability across the primary video and audio tracks.
It handles both network URLs with UrlSource and client file inputs via BlobSource. Because the snippet relies directly on classes like Input and ALL_FORMATS, the project requires the mediabunny package installed to compile.
What it helps with
- verify browser video codec support before playback
- validate decodability for remote media URLs
- check user-uploaded video blobs prior to processing
Example prompts for the agent
- Write a helper to check if a video URL is playable in the browser using mediabunny
- Add validation for uploaded video blobs with BlobSource
- Check whether this browser can decode the media track before playback
How to install can-decode
Manually: put the files in place
.claude/rules/can-decode.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/can-decode.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/can-decode.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/can-decode.mdManually: put the files in place
.clinerules/can-decode.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about can-decode
How to install can-decode in Claude Code?
Save the rule file to .claude/rules/can-decode.md inside your repository root.
What does can-decode do?
It provides snippets for browser media validation, ensuring both audio and video streams can actually be decoded before you start playback.
What dependencies does this rule require?
Your codebase must have the mediabunny package installed so modules like Input and UrlSource resolve properly.