/media-os:media-tag [input] [action]from media-os
Tags, captions, and classifies images/videos using CLIP, SigLIP, BLIP-2, and LLaVA. Supports zero-shot classification, semantic search, and bulk labeling for media libraries.
Ships in media-os. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Context: $ARGUMENTS
Four open-source vision-language families, four different jobs:
All commercial-safe.
tag.py caption --model blip2)tag.py describe --model llava)tag.py classify --model clip)tag.py search)tag.py tag-batch)tag.py video-describe)tag.py install <model>)media-ocr-ai. Do NOT use for object-detection bboxes — use cv-opencv (YOLO) or cv-mediapipe.| Family | License | Strength | VRAM (base) | When to pick |
|---|---|---|---|---|
| CLIP | MIT | Zero-shot classification + embedding-based search | 1–4 GB | "Does this match this label?" |
| SigLIP | Apache 2.0 | Drop-in CLIP replacement; higher zero-shot accuracy | 1–4 GB | Same as CLIP, prefer when quality matters |
| BLIP-2 | BSD-3-Clause | Clean image captions, compact output | 6–12 GB | One-line alt text / captions |
| LLaVA | Apache 2.0 | Free-form dense description, VQA, video-frame narration | 8–24 GB | "Describe this video scene in detail" |
Full per-model matrix (benchmark accuracy, caption quality, context length, speed) in references/models.md.
PEP 723 header in scripts/tag.py declares all dependencies. uv run manages an ephemeral venv.
uv run ${CLAUDE_SKILL_DIR}/scripts/tag.py install clip
uv run ${CLAUDE_SKILL_DIR}/scripts/tag.py install siglip
uv run ${CLAUDE_SKILL_DIR}/scripts/tag.py install blip2
uv run ${CLAUDE_SKILL_DIR}/scripts/tag.py install llava
Per-model notes:
open_clip (preferred for variety) or transformers (openai/clip-vit-large-patch14). open_clip exposes a huge zoo (ViT-B-32, ViT-L-14, ViT-H-14, ViT-bigG-14, with OpenAI / LAION / DataComp pretrain tags).google/siglip-base-patch16-384, -large-patch16-384, -so400m-patch14-384. All Apache 2.0. Use transformers.Salesforce/blip2-opt-2.7b (BSD-3), -opt-6.7b, -flan-t5-xl. Use transformers.llava-hf/llava-1.5-7b-hf, llava-hf/llava-v1.6-mistral-7b-hf (LLaVA-NeXT), llava-hf/llava-onevision-qwen2-7b-ov-hf (includes video support, recommended). All Apache 2.0 as repackaged by llava-hf. Use transformers.uv run ${CLAUDE_SKILL_DIR}/scripts/tag.py caption \
--model blip2 --in photo.jpg --out-text caption.txt
Output: one sentence, WCAG-alt-text-style. Good for cataloguing.
For richer captions:
uv run ${CLAUDE_SKILL_DIR}/scripts/tag.py caption \
--model llava --in photo.jpg --out-text caption.txt
LLaVA tends to produce 2–4 sentences describing scene, subject, mood. Pass --prompt to steer:
--prompt "Describe this image in one short sentence suitable for alt text."
uv run ${CLAUDE_SKILL_DIR}/scripts/tag.py describe \
--model llava --in photo.jpg \
--prompt "What objects are in this image and what is their color?" \
--out answer.txt
Arbitrary VQA via --prompt. Useful prompts are cached in references/prompts.md — read it when drafting prompts for object detection, scene analysis, or video narration.
uv run ${CLAUDE_SKILL_DIR}/scripts/tag.py classify \
--model clip --in photo.jpg \
--labels "a photo of a cat,a photo of a dog,a photo of a car,a photo of a bicycle" \
--top-k 2
Output (JSON on stdout):
{"top": [
{"label": "a photo of a cat", "score": 0.87},
{"label": "a photo of a dog", "score": 0.09}
]}
Pro tip — use full-sentence prompts ("a photo of X"), not bare words ("X"). CLIP / SigLIP are heavily biased by phrasing; "a photo of a cat" outperforms "cat" by 5–10 points on ImageNet-class prompts.
For SigLIP:
--model siglip
Same interface; different pretrain + sigmoid head. Higher-quality scores without softmax competition between labels — each score is independent probability.
# 1. build embedding index of a folder
uv run ${CLAUDE_SKILL_DIR}/scripts/tag.py search \
--model clip --index photos/ --index-out photos_clip.npz
# 2. query
uv run ${CLAUDE_SKILL_DIR}/scripts/tag.py search \
--model clip --index photos_clip.npz \
--query "a red car in the rain" --top-k 10
Index is a .npz with files (list of paths) + embeddings (float32 L2-normalized array). Query is a text embedding dot-producted against the index.
For scale beyond ~50 k images, swap the brute-force dot-product for FAISS or Qdrant — the reference doc references/models.md has a short recipe, or integrate into your own pipeline.
# tags.txt contains one candidate label per line
uv run ${CLAUDE_SKILL_DIR}/scripts/tag.py tag-batch \
--model clip --in-dir photos/ --tags-file tags.txt \
--out-csv tags.csv --threshold 0.25 --top-k 5
Writes filename,label,score rows for every image × top-k labels above threshold. Good for automated catalog metadata.
uv run ${CLAUDE_SKILL_DIR}/scripts/tag.py video-describe \
--model llava --in clip.mp4 \
--sample-fps 1 --prompt "Describe this frame in one sentence." \
--out clip_scenes.jsonl
Samples the video at N fps, runs LLaVA on each frame, writes one JSONL row per sample: {"t": 3.0, "text": "..."}. Downstream, merge adjacent identical descriptions for scene-level summary, or pair with media-scenedetect for true scene-boundary sampling.
Gotcha: per-frame LLaVA is expensive. For a 5-minute video at --sample-fps 1 on a 3090 that's ~5 minutes of inference. Use --sample-fps 0.2 (one frame per 5s) or pre-segment with media-scenedetect and run once per scene.
scripts/tag.py — subcommands: caption, classify, describe, search, tag-batch, video-describe, install. Each supports --dry-run, --verbose, --device {auto,cpu,cuda,mps}.references/models.md when picking a specific CLIP / SigLIP / BLIP-2 / LLaVA variant or tuning for VRAM, latency, or benchmark score.references/prompts.md when crafting LLaVA prompts for object detection, scene analysis, caption style, or video narration.references/LICENSES.md before shipping model output commercially or redistributing weights — includes a DROPPED-models list (Florence-2, CogVLM, Gemini, GPT-4V, Claude Vision) and why.references/prompts.md.open_clip returns unnormalized features; you must L2-normalize before cosine similarity. The script handles this; if you build your own index, call features /= features.norm(dim=-1, keepdim=True).llava-onevision) handles video natively via frame-grid input — the older llava-1.5 and llava-1.6-mistral are image-only. Use OneVision if you're processing a video directly; otherwise sample frames and process individually.references/LICENSES.md for the details. If/when a clean Apache variant ships, add it back.uv run ${CLAUDE_SKILL_DIR}/scripts/tag.py caption \
--model blip2 --in hero.jpg \
--prompt "Describe this image in one short sentence for alt text."
uv run ${CLAUDE_SKILL_DIR}/scripts/tag.py classify \
--model siglip --in street.jpg \
--labels "a photo of a pedestrian,a photo of a cyclist,a photo of a car,a photo of a bus,a photo of a truck" \
--top-k 3
uv run ${CLAUDE_SKILL_DIR}/scripts/tag.py search \
--model clip --index ~/Pictures/2025/ --index-out 2025.npz
uv run ${CLAUDE_SKILL_DIR}/scripts/tag.py search \
--index 2025.npz --query "sunset at the beach" --top-k 20
tags.txt:
a photo of a person
a photo of food
a photo of a landscape
a photo of architecture
a photo of an animal
a photo of a vehicle
uv run ${CLAUDE_SKILL_DIR}/scripts/tag.py tag-batch \
--model clip --in-dir photos/ --tags-file tags.txt \
--out-csv photos_tags.csv --top-k 2 --threshold 0.20
# optional: first find scene boundaries via media-scenedetect
scenedetect -i clip.mp4 detect-adaptive list-scenes
# then describe each scene's mid-frame
uv run ${CLAUDE_SKILL_DIR}/scripts/tag.py video-describe \
--model llava --in clip.mp4 --sample-fps 0.5 \
--prompt "Describe this scene in 1-2 sentences." \
--out scenes.jsonl
uv run ${CLAUDE_SKILL_DIR}/scripts/tag.py describe \
--model llava --in kitchen.jpg \
--prompt "List all appliances you can see and estimate their color."
OSError: google/siglip-base-patch16-384 is not a local folderCause: No network on first run, or HF Hub outage.
Solution: Pre-download with tag.py install siglip when online; weights cache to ~/.cache/huggingface/hub/.
Cause: Embeddings not L2-normalized before cosine similarity.
Solution: The script normalizes by default. If building your own index, features /= features.norm(dim=-1, keepdim=True) before any dot-product or FAISS index insert.
Cause: Default torch.float16 + full attention is still tight for 7 B on large inputs.
Solution: Use --device cpu (slow but works), or pick a smaller variant (llava-1.5-7b is smaller than -13b), or enable 4-bit via bitsandbytes (see references/models.md).
Cause: Label prompts are too similar (cosine similarity saturates) or too dissimilar from ImageNet training distribution. Solution: Rewrite prompts as "a photo of X" / "an image showing X". For domain-specific labels, an ensemble of 5-10 prompt templates per class averaged is the standard trick.
Cause: --sample-fps 1 is one LLaVA inference per second. For a 30-min video that's 1 800 inferences.
Solution: Reduce to --sample-fps 0.2 (one per 5 s), or pre-segment with media-scenedetect and run once per scene midpoint.
Cause: Default greedy decoding.
Solution: The script uses num_beams=5 by default. Crank to 10 or enable do_sample=True with temperature 0.7 via --beams 10 --temperature 0.7 (if wired in). Or switch to LLaVA for more varied language.
Cause: SigLIP uses sigmoid, not softmax. Each label probability is independent. Solution: Treat as independent yes/no probabilities. Sum > 1 or < 1 is expected.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub damionrashford/media-os --plugin media-os110 skills in this plugin
/audio-coreaudioManipulate macOS audio at the Core Audio HAL layer: afinfo (audio file metadata), afplay (play), afconvert (convert format/rate/bit-depth/channel layout), say (TTS), SwitchAudioSource (change default input/output/system device — brew install switchaudio-osx), audiodevice CLIs (npm/Go variants), AppleScript via osascript to drive System Preferences Sound. HAL plugins at /Library/Audio/Plug-Ins/HAL/ load virtual drivers (BlackHole 2ch/16ch/64ch, Loopback, Background Music). Aggregate Device (drift-corrected multi-in) and Multi-Output Device via Audio MIDI Setup.app or AudioHardwareCreateAggregateDevice. Use when the user asks to change default macOS audio device, route audio between apps on Mac, install BlackHole, build an Aggregate Device, convert audio files with afconvert, or script Mac audio from the terminal.
/audio-jackRoute professional low-latency audio with JACK Audio Connection Kit (jackaudio.org): jackd server (ALSA/CoreAudio/PortAudio/ASIO backends), jack_control (D-Bus JACK2 config), jack_lsp (list ports/connections), jack_connect/jack_disconnect (manage links), jack_cpu_load, jack_samplerate, jack_bufsize (runtime period size), jack_transport, jack_rec (multi-channel WAV recording), jack_iodelay (round-trip latency), jack_wait, jack_midi_dump. JACK1 C maintenance vs JACK2 C++ multicore. Modern Linux swaps jackd for PipeWire's libjack shim — same client API. JackTrip for uncompressed multichannel UDP over the Internet. Use when the user asks to run a JACK server, connect audio clients, measure roundtrip latency, record from JACK ports, set JACK period size, or bridge JACK over the network with JackTrip.
Other plugins' skills for the same job