youtube

youtube is a command for Claude Code from eugeniughelbur/obsidian-second-brain. It costs 42 tokens per session (1,398 once invoked), scanned A, original, MIT.

A command for extracting a YouTube video's transcript, details, and top comments, then saving a summary to an Obsidian vault. It can also inspect selected video frames when visual reading is requested.

In plain words
What is it for?
Use it with a YouTube URL or video ID to summarize talks, demos, walkthroughs, or other videos, optionally including what appears on screen.
Why use it?
It turns a video into searchable text and notes, so the developer does not have to watch the entire video to research its content.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the obsidian-second-brain plugin — 1 skill, 47 commands, 3 hooks shipped together

Good fit Use it with a YouTube URL or video ID to summarize talks, demos, walkthroughs, or other videos, optionally including what appears on screen.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/eugeniughelbur/obsidian-second-brain/youtube
About the project

obsidian-second-brain turns an Obsidian vault into persistent, searchable memory for Claude Code and other command-line coding agents, storing knowledge as linked Markdown notes. It is for developers, founders, writers, and researchers who want agents to retain project context across sessions. Its catalogue entries provide commands, hooks, a plugin, a skill, and instructions for capturing, finding, and maintaining that memory.

eugeniughelbur/obsidian-second-brain · 4,376 stars · on GitHub · eugeniughelbur.github.io

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/eugeniughelbur/obsidian-second-brain

Made for: Claude Code.

Or install obsidian-second-brain, the plugin that ships this one along with the rest of its 1 skill, 47 commands, 3 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for youtube

README.md
[![agentmods](https://agentmods.dev/badge/commands/eugeniughelbur/obsidian-second-brain/youtube/github.svg)](https://agentmods.dev/commands/eugeniughelbur/obsidian-second-brain/youtube)
Your own site
<a href="https://agentmods.dev/commands/eugeniughelbur/obsidian-second-brain/youtube"><img src="https://agentmods.dev/badge/commands/eugeniughelbur/obsidian-second-brain/youtube/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for youtube

Your own site · 80×15
<a href="https://agentmods.dev/commands/eugeniughelbur/obsidian-second-brain/youtube"><img src="https://agentmods.dev/badge/commands/eugeniughelbur/obsidian-second-brain/youtube.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,398 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00042 $0.01398
Opus 5 $0.00021 $0.00699
Sonnet 5 $0.00008 $0.00280
Haiku 4.5 $0.00004 $0.00140

Measured 9d ago against content hash 8f3d04b22761, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

youtube scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/youtube.md · 51 lines

How it starts

The opening of the file, as written. The whole thing — 51 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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):

    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):

    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.

Read the full file on GitHub · 51 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 51 lines · 42 tokens per session scan A 8f3d04b22761

Subscribe to this mod's changes

youtube is a command published in the GitHub repository eugeniughelbur/obsidian-second-brain (4,376 stars, last pushed 2d ago), licensed MIT. It adds 42 tokens to every session and 1,398 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.