How to extract YouTube transcript in Claude Code
Claude Code runs in the terminal where context window management matters. Two Firecrawl integrations give it YouTube transcript extraction with different trade-offs:
| Method | Install | Output | Best for |
|---|---|---|---|
| CLI | npx -y firecrawl-cli@latest init --all --browser | File on disk | Long videos with low token usage |
| Claude plugin | claude plugin marketplace add firecrawl/firecrawl-claude-plugin, then claude plugin install firecrawl@firecrawl | Inline in chat | Quick extractions with immediate follow-up |
CLI (recommended) — installs Firecrawl as a skill that Claude Code, Codex, and Gemini CLI can all use. Run firecrawl scrape <YouTube URL> to write the transcript as a markdown file. Claude Code can then read, grep, or summarize the file without loading the full text into the context window. This matters for hour-long videos that would otherwise eat thousands of tokens. For the broader approach to keeping web-sourced content from inflating Claude Code's context, see Claude Code web research token optimization.
Plugin: after installing, run /mcp in Claude Code, select firecrawl and sign in to your Firecrawl account. Then use /firecrawl:scrape <URL> to get the transcript inline, or ask for it in plain English.
Both handle JavaScript rendering and page structure changes automatically. The CLI and the plugin both use a free Firecrawl account from firecrawl.dev.