Let Claude watch YouTube videos - transcripts + on-demand frame extraction
Project description
claudetube
Let AI watch and understand online videos.
claudetube downloads online videos, transcribes them with faster-whisper, and lets AI "see" specific moments by extracting frames on-demand. Built for Claude Code but works as a standalone Python library with any AI tool.
Quick Start
Prerequisites
- Python 3.10+
- ffmpeg (system package)
# macOS brew install ffmpeg # Ubuntu/Debian sudo apt install ffmpeg
Install
git clone https://github.com/thoughtpunch/claudetube
cd claudetube
./install.sh
Or via pip (once published):
pip install claudetube
The installer does three things:
- Creates a Python venv at
~/.claudetube/venv/ - Installs the
claudetubepackage + dependencies (yt-dlp, faster-whisper) - Copies slash commands to
~/.claude/commands/(global to all Claude Code sessions)
Restart Claude Code after installing.
Works from any Claude Code session
The installer puts slash commands in ~/.claude/commands/, which is the global commands directory. Every Claude Code instance on your machine will have /yt available -- no per-project setup needed.
Why not a pre-built binary?
claudetube depends on faster-whisper (C++ transcription engine) and ffmpeg (system media tool). These have platform-specific native code that can't be bundled into a single static binary. The install script handles all of this automatically.
Usage with Claude Code
/yt https://youtube.com/watch?v=abc123 how did they make the sprites?
Claude will:
- Download and transcribe the video (~60s first time, cached after)
- Read the transcript
- If needed, extract frames to "see" specific moments
- Answer your question
Commands
| Command | Purpose |
|---|---|
/yt <url> [question] |
Analyze a video |
/yt:see <id> <timestamp> |
Quick frames (general visuals) |
/yt:hq <id> <timestamp> |
HQ frames (code, text, diagrams) |
/yt:transcript <id> |
Read cached transcript |
/yt:list |
List all cached videos |
Python API
from claudetube import process_video, get_frames_at
# Transcribe a video
result = process_video("https://youtube.com/watch?v=VIDEO_ID")
print(result.transcript_srt.read_text())
# Extract frames at a specific timestamp
frames = get_frames_at("VIDEO_ID", start_time=120, duration=10)
How It Works
- Download -- Fetches lowest quality video (144p) for speed
- Transcribe -- Uses faster-whisper with batched inference
- Cache -- Stores everything at
~/.claude/video_cache/{VIDEO_ID}/ - Drill-in -- Extract frames on-demand when visual context is needed
Cache Structure
~/.claude/video_cache/
└── dYP2V_nK8o0/
├── state.json # Metadata (title, description, tags, etc.)
├── audio.mp3 # Extracted audio
├── audio.srt # Timestamped transcript
├── audio.txt # Plain text transcript
├── drill/ # Quick frames (480p)
└── hq/ # High-quality frames (1280p)
Architecture
claudetube uses a provider-based architecture. Video downloading is handled through yt-dlp, which currently supports YouTube and 1000+ other sites. The transcription and frame extraction pipeline is provider-agnostic -- it works with any video source that yt-dlp supports, and the architecture is designed to accommodate additional providers in the future.
Development
git clone https://github.com/thoughtpunch/claudetube
cd claudetube
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest
Linting
black src/ tests/
isort --profile black src/ tests/
flake8 src/ tests/
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
- Fork the repository
- Create a feature branch (
git checkout -b feature/my-feature) - Run tests and linting before committing
- Open a pull request against
main
Legal
This project is not affiliated with, endorsed by, or associated with YouTube, Google, or Alphabet Inc. "YouTube" is a trademark of Google LLC. This software is an independent, open-source tool that interacts with publicly available video content through third-party libraries (yt-dlp). Users are solely responsible for ensuring their use of this software complies with all applicable terms of service and laws.
License
MIT -- free to use, modify, and distribute.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file claudetube-0.1.1.tar.gz.
File metadata
- Download URL: claudetube-0.1.1.tar.gz
- Upload date:
- Size: 16.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8092fb363cc9775797e188c27b751a419d8383c902af247d4cec8f39c39cbb8
|
|
| MD5 |
b7fdca766d2019b6e8d07c2492490739
|
|
| BLAKE2b-256 |
46f21b24ac5a9e65fc6c29ab6d12262fd3dc26f569da6aad260a9c54c1909e2e
|
Provenance
The following attestation bundles were made for claudetube-0.1.1.tar.gz:
Publisher:
publish.yml on thoughtpunch/claudetube
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claudetube-0.1.1.tar.gz -
Subject digest:
c8092fb363cc9775797e188c27b751a419d8383c902af247d4cec8f39c39cbb8 - Sigstore transparency entry: 863809979
- Sigstore integration time:
-
Permalink:
thoughtpunch/claudetube@dfe118ce73d3de35363605b7dec58f3cf718f76e -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/thoughtpunch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dfe118ce73d3de35363605b7dec58f3cf718f76e -
Trigger Event:
push
-
Statement type:
File details
Details for the file claudetube-0.1.1-py3-none-any.whl.
File metadata
- Download URL: claudetube-0.1.1-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a0036311ff8bed6d1eec1098afe22e4f1456e91a84a6c2f188cfa565c56662b
|
|
| MD5 |
7ce00b573afdfa341c4d4b75d2970330
|
|
| BLAKE2b-256 |
9642feb9326ba96fac13d404ae7cb59cd1194a36c8e6ad11286dc4701336823b
|
Provenance
The following attestation bundles were made for claudetube-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on thoughtpunch/claudetube
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claudetube-0.1.1-py3-none-any.whl -
Subject digest:
7a0036311ff8bed6d1eec1098afe22e4f1456e91a84a6c2f188cfa565c56662b - Sigstore transparency entry: 863810005
- Sigstore integration time:
-
Permalink:
thoughtpunch/claudetube@dfe118ce73d3de35363605b7dec58f3cf718f76e -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/thoughtpunch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dfe118ce73d3de35363605b7dec58f3cf718f76e -
Trigger Event:
push
-
Statement type: