Skip to main content
rule CX Codex

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

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

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

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set33

The whole set →

Project sponsors

Companies that keep this analytics open