A Claude Code slash command that downloads YouTube video transcripts and loads them directly into your conversation context for AI-assisted analysis.
- Downloads transcripts from any YouTube video
- Loads the transcript text into Claude Code automatically
- Supports multiple languages
- Works with a simple
/load-yt-transcriptcommand
Perfect for: summarizing videos, translating content, extracting insights, or analyzing spoken content with AI assistance.
You need these installed on your computer:
- Claude Code - Download from claude.ai/code
- UV - Python package installer (installation instructions)
macOS/Linux:
curl -LsSf https://astral.sh/uv/install.sh | shWindows:
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"-
Download this repository (click the green "Code" button → "Download ZIP")
-
Locate your Claude Code global commands folder:
- macOS/Linux:
~/.claude/commands/ - Windows:
%USERPROFILE%\.claude\commands\
- macOS/Linux:
-
Copy the command file:
# Create the directory if it doesn't exist mkdir -p ~/.claude/commands/ # Copy the command file cp .claude/commands/load-yt-transcript.md ~/.claude/commands/
-
Copy the script to your path:
# macOS/Linux - choose one location: sudo cp yt-transcript.py /usr/local/bin/yt-transcript # OR cp yt-transcript.py ~/bin/yt-transcript # Make it executable chmod +x /usr/local/bin/yt-transcript # or ~/bin/yt-transcript
# Windows - copy to a location in your PATH # Example: C:\Users\YourName\bin\ copy yt-transcript.py %USERPROFILE%\bin\yt-transcript.py
# Clone the repository
git clone https://github.com/yourusername/claude-code-yt-transcript.git
cd claude-code-yt-transcript
# Create global commands directory
mkdir -p ~/.claude/commands/
# Symlink the command (automatically updates with git pulls)
ln -s "$(pwd)/.claude/commands/load-yt-transcript.md" ~/.claude/commands/
# Install script globally
chmod +x yt-transcript.py
sudo ln -s "$(pwd)/yt-transcript.py" /usr/local/bin/yt-transcriptOnce installed, use the command anywhere in Claude Code:
# Load a transcript into the conversation
/load-yt-transcript "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
# Just the video ID works too
/load-yt-transcript "dQw4w9WgXcQ"
# List available languages first
/load-yt-transcript "VIDEO_ID" --list-languages
# Load a specific language
/load-yt-transcript "VIDEO_ID" --lang es
# Save to a file (and load into context)
/load-yt-transcript "VIDEO_ID" --output transcript.txtAfter the transcript loads, you can ask Claude to:
- "Summarize this video"
- "Translate this to Spanish"
- "Extract the key points"
- "Create a blog post from this content"
You can also use the script directly in your terminal:
# Download and display transcript
yt-transcript "https://www.youtube.com/watch?v=VIDEO_ID"
# List available languages
yt-transcript "VIDEO_ID" --list-languages
# Download specific language
yt-transcript "VIDEO_ID" --lang es
# Save to file
yt-transcript "VIDEO_ID" --output transcript.txt-
Check that the file is in the correct location:
ls ~/.claude/commands/load-yt-transcript.md -
Restart Claude Code
-
Verify the command file is valid:
cat ~/.claude/commands/load-yt-transcript.md
-
Check if the script is in your PATH:
which yt-transcript
-
Make sure it's executable:
chmod +x /usr/local/bin/yt-transcript
-
Verify UV is installed:
uv --version
Some videos don't have transcripts. Try:
- Videos with auto-generated captions (most English videos)
- Videos with manual captions/subtitles
- Use
--list-languagesto see what's available
On macOS/Linux, you might need to use sudo:
sudo cp yt-transcript.py /usr/local/bin/yt-transcriptOr use a user-writable location like ~/bin/ (make sure it's in your PATH).
- The Claude Code command runs the Python script
- The script uses
youtube-transcript-apito fetch transcripts - The transcript text is automatically loaded into your Claude Code conversation
- You can immediately ask questions or request analysis
No configuration files needed - dependencies are managed automatically by UV inline script system.
- ✅ Zero configuration - works immediately after installation
- ✅ Automatic dependency management (UV handles everything)
- ✅ Multiple language support
- ✅ Smart fallback (English → first available)
- ✅ Direct integration with Claude Code
- ✅ Standalone script also works in terminal
.claude/commands/load-yt-transcript.md- Claude Code slash command definitionyt-transcript.py- Main Python script (UV inline dependencies)spec.md- Complete technical specificationCLAUDE.md- Development guide for Claude Code
See CLAUDE.md for development guidelines and architecture details.
MIT License - feel free to use and modify as needed.