Skip to main content
command CX Codex

youtube — Claude Code command: what it does, how to install

Pulls a YouTube transcript, metadata, and top comments into an Obsidian note. Add --visual when the video’s frames matter too.

MIT ★ 5,412 updated 2026-10-24

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add eugeniughelbur/obsidian-second-brain
/plugin install obsidian-second-brain@obsidian-second-brain
Open on GitHub

What youtube does

The command accepts a YouTube URL or video ID, gets the transcript through youtube-transcript-api, and writes a note to Research/YouTube/YYYY-MM-DD - <video-title-slug>.md. With YOUTUBE_API_KEY, it can add the title, channel, view and like counts, plus top comments. Gemini is used when GEMINI_API_KEY is available; otherwise the summary goes through Grok.

--visual downloads the video with yt-dlp at up to 720p and uses ffmpeg scene detection to select frames. Hero images are embedded in the note, while the keyframe set stays on disk for inspection. If yt-dlp or ffmpeg is missing from PATH, the visual pass is skipped and the transcript summary still gets saved. The note includes fields such as the video ID, visual status, and frame count for later Dataview queries.

What it helps with

  • turn a YouTube video into a transcript note
  • save an AI summary inside an Obsidian vault
  • collect video metadata and top comments
  • inspect slides, UI demos, and other visual scenes

Example prompts for the agent

  • Summarize this YouTube video from [url] and save the result to my vault.
  • Run /youtube [url] --visual and describe what appears on screen.
  • Extract the transcript and main points from /youtube [url].

How to install youtube

1Plugin marketplace

/plugin marketplace add eugeniughelbur/obsidian-second-brain
/plugin install obsidian-second-brain@obsidian-second-brain

2Manually: put the files in place

.claude/commands/youtube.md

Call it with /youtube. For all projects use ~/.claude/commands/

Questions about youtube

How do I install youtube in Claude Code?

Run /plugin marketplace add eugeniughelbur/obsidian-second-brain, then run /plugin install obsidian-second-brain@obsidian-second-brain in Claude Code.

What does the youtube command do?

It extracts a YouTube transcript, available metadata, and top comments, sends the material to Gemini or Grok for summarization, and saves the result as an Obsidian note.

What does --visual require?

Both yt-dlp and ffmpeg must be available on PATH. Install them with brew install yt-dlp ffmpeg; if video download fails, the command continues with the transcript summary.

Source text

youtube.md · MIT
---
description: Extract transcript, metadata, and top comments from a YouTube video - summarized via Gemini (free tier) or Grok and saved to vault. Add --visual to also read the video's frames (scene detection)
category: research
triggers_en: ["summarize youtube", "youtube transcript", "extract video", "youtube to vault", "watch this video", "what's on screen in this video"]
triggers_de: ["YouTube zusammenfassen", "YouTube-Transkript", "Video auswerten", "YouTube in den Vault", "dieses Video ansehen", "was ist in diesem Video auf dem Bildschirm"]
triggers_es: ["resume este vídeo de youtube", "transcripción de youtube", "extrae este vídeo", "youtube al vault", "mira este vídeo", "qué se ve en este vídeo"]
triggers_pt: ["resuma este vídeo do youtube", "transcrição do youtube", "extraia este vídeo", "youtube para o vault", "assista a este vídeo", "o que aparece neste vídeo"]
triggers_zh: ["总结这个 YouTube 视频", "提取视频字幕", "把这个视频整理进知识库", "这个视频讲了什么", "看看视频画面里有什么"]
---

Use the obsidian-second-brain skill. Execute `/youtube [url] [--visual]`:

1. Resolve the YouTube URL or video ID from the user's argument. Accept any of: full URL (`https://www.youtube.com/watch?v=...`), `https://youtu.be/...`, `https://www.youtube.com/shorts/...`, or just the 11-character video ID. If no input given, ask: "Which YouTube video?"

2. Run the script from the skill root (its absolute path was given at session start as **Skill root**; substitute it for `SKILL_ROOT`):
   ```bash
   uv run --directory "SKILL_ROOT" -m scripts.research.youtube_extract "<url-or-id>"
   ```
   Add `--visual` when the user wants the video watched, not just transcribed (demos, whiteboards, slides, UI walkthroughs, b-roll, "what's on screen"). Optional `--max-frames N` caps how many frames are read (default 24):
   ```bash
   uv run --directory "SKILL_ROOT" -m scripts.research.youtube_extract "<url-or-id>" --visual
   ```

3. The script:
   - Extracts the transcript via `youtube-transcript-api` (free, no API key).
   - If `YOUTUBE_API_KEY` is set, also fetches title, channel, view/like counts, top comments. Otherwise skips metadata silently.
   - Sends the transcript (and optional comments) for AI-first summarization: Gemini (`gemini-2.5-flash`, generous free tier) when `GEMINI_API_KEY` is set, otherwise Grok; a Gemini failure falls back to Grok automatically.
   - Returns: TL;DR, Key Points, Notable Quotes, Themes & Topics, Comment Sentiment, Worth Following Up On.
   - With `--visual`: downloads the video (yt-dlp, <=720p) and extracts one frame per scene change (ffmpeg scene detection, not a fixed timer), so visual substance is captured. Hero frames are copied into the vault and embedded in the note; the full keyframe set is left on disk for you to read. Requires `yt-dlp` and `ffmpeg` on PATH (`brew install yt-dlp ffmpeg`). If either is missing or download fails, the visual layer is skipped with a warning and the transcript summary still saves.

4. Show the script output verbatim to the user.

5. **Default save behavior: saves automatically.** AI-first note written to `Research/YouTube/YYYY-MM-DD - <video-title-slug>.md`. Frontmatter includes video ID, channel, view counts, `visual`, `frame-count`, etc. for future Dataview queries.

6. **If `--visual` was used:** the script prints a `FRAMES-FOR-CLAUDE` JSON block (to stderr) listing each extracted keyframe with its timestamp and local path, plus the saved note path. Do this:
   - Read each frame image with the read-files tool (they are local JPGs). This is your own vision doing the watching - there is no extra vision-API call.
   - Then edit the saved note: replace the `<!-- CLAUDE: ... -->` comment in the `## Visual notes` section with a concise, timestamp-keyed reading of what the frames add over the transcript: on-screen text, code, diagrams, slides, UI, demos, b-roll, scene transitions. Cross-reference the Summary; do not restate the audio.
   - Keep the `## Visual timeline` hero-frame embeds intact.
   - If `--max-frames` is high and reading every frame would be excessive, read the hero frames plus an even sample across the timeline, and say in the note that you sampled.

7. Plain English triggers: "summarize this YouTube video", "what's in this video", "extract this YouTube link", "transcribe this video", "watch this video", "what's on screen", or just pasting a YouTube URL with a question about content. When the ask is about what is *shown* (not just said), use `--visual`.

8. If the video has no captions (transcript unavailable) AND no metadata (no API key), the script will fail with a clear message - surface it. Suggest the user picks a different video, adds a `YOUTUBE_API_KEY`, or tries `--visual` (which can read the video even without captions).

9. If the user asks to research something mentioned in the "Worth Following Up On" section, route that to `/research [topic]`.

---

**AI-first rule:** Every note created or updated by this command MUST follow `references/ai-first-rules.md` - `## For future agent` preamble, rich frontmatter (`type`, `date`, `tags`, `ai-first: true`, plus type-specific fields), recency markers per external claim, mandatory `[[wikilinks]]` for every person/project/concept referenced, sources preserved verbatim with URLs inline, and confidence levels where applicable. If that path does not resolve from your working directory, search upward for it; if you still cannot read it, say so before writing rather than producing a note that silently skips the rule. The vault is for future agent retrieval - not human reading.

**Anti-fabrication:** Search exhaustively before claiming any note, person, or file is absent - false absence is the most common failure mode - and never invent facts, entities, or dates (mark unknowns as `TBD`). See the anti-fabrication and search-completeness hard rules in `references/ai-first-rules.md`.

© Eugeniu Ghelbur · MIT · eugeniughelbur/obsidian-second-brain

Similar slash commands

All slash commands for Science and research →

From the same set51

The whole set →
obsidian-retrieval-eval obsidian-retrieval-eval evaluates Obsidian vault search quality using recall@k and MRR metrics. It tests search ranking against natural-language questions before changing indexing. CX Codex +1 ★ 5,412repo stars obsidian-projects obsidian-projects is a Claude Code command that builds project status from Obsidian notes, Git, and local docs. Ask for an overview or name one project to inspect. CX Codex +1 ★ 5,412repo stars obsidian-brainstorm obsidian-brainstorm is a Claude Code command that interviews you about an idea one question at a time, then writes a design note with alternatives and a recommendation. CX Codex +1 ★ 5,412repo stars podcast Extracts podcast episode metadata, transcript, and structured summary directly into an Obsidian vault note. CX Codex +1 ★ 5,412repo stars obsidian-architect obsidian-architect scans a project and generates architecture notes in your vault: overview with diagram, per-module notes, key decisions. Re-run to refresh docs without losing your edits. CX Codex +1 ★ 5,412repo stars obsidian-reconcile obsidian-reconcile is a Claude Code command that finds contradictions in an Obsidian vault and resolves them automatically or flags them for review. It scans the full vault or a specific topic. CX Codex +1 ★ 5,412repo stars obsidian-visualize The obsidian-visualize command maps your Obsidian vault visually: shows how notes connect, identifies hubs, and highlights isolated entries. Use it to see your second brain's shape at a glance. CX Codex +1 ★ 5,412repo stars obsidian-distill obsidian-distill condenses a long note or article into key claims, each tagged with the exact source block it came from — paragraph, section, or timestamp. CX Codex +1 ★ 5,412repo stars

Project sponsors

Companies that keep this analytics open