How to Fetch YouTube Transcripts with Claude Code

Claude Code is built for coding tasks, but development work frequently involves non-code research — watching a library’s demo video, following along with a conference talk, or pulling context from a recorded technical discussion. Getting that content out of YouTube and into your workflow usually means leaving the terminal. With AgentPatch, Claude Code can fetch transcripts without breaking your flow.

Why This Matters

YouTube is full of technical content that isn’t written down anywhere else. A video walkthrough of a library, a recorded architecture discussion, an API design talk — this information exists only as video. Being able to pull the transcript into your Claude Code session means you can ask questions about it, extract specific explanations, or incorporate relevant details into documentation you’re writing.

The agent uses the transcript tool directly. You don’t write code to call an API. You ask Claude Code to fetch the transcript and it does.

Setup

Install the AgentPatch CLI (zero dependencies, Python 3.10+):

pip install agentpatch

Set your API key:

export AGENTPATCH_API_KEY=your_api_key

Then use it:

ap search "web search"
ap run agentpatch google-search --input '{"query": "test"}'

Get your API key from the AgentPatch dashboard.

Run this command to add AgentPatch as an MCP server:

claude mcp add -s user --transport http agentpatch https://agentpatch.ai/mcp \
  --header "Authorization: Bearer YOUR_API_KEY"

Replace YOUR_API_KEY with your actual key from the AgentPatch dashboard. Claude Code discovers all AgentPatch tools automatically.

Example

You’re writing documentation for a project and there’s a recorded talk that covers the design decisions behind it. You ask Claude Code:

“Fetch the transcript for this talk and pull out anything relevant to the architecture decisions: https://www.youtube.com/watch?v=abc123

Claude Code calls the YouTube Transcript tool through AgentPatch, retrieves the full transcript with timestamps, and surfaces the relevant sections. You didn’t open a browser. You didn’t scrape anything. The agent handled it as part of your session.

Another use case: you’re reading through a library’s GitHub repo and find a linked video tutorial.

“Get the transcript from that YouTube link in the README and summarize the setup steps.”

Claude Code fetches the transcript and gives you the summary directly in your terminal session.

This is one of the fastest ways to convert youtube video to text. Rather than hunting for a third-party transcript site or browser extension, you get the full youtube transcript directly in your development environment.

Wrapping Up

Once AgentPatch is configured in Claude Code, you have access to the YouTube Transcript tool and everything else on the marketplace — web search, email, image generation, maps, and more. One config, all the tools. Visit agentpatch.ai to get started.