Claude can't watch a video. It can only read the words.
So you paste in a transcript and lose everything on screen. The steps they show. The slides. The examples.
Gemini, Google's AI, actually watches YouTube. The picture, the sound, and the words on screen. So you let Claude Code hand the video to Gemini, and keep what it learns.
And no, you don't have to write any code. Claude Code builds it for you.
1Give Claude Code a watch video skill
A skill is a set of instructions Claude Code follows to do a job. This one takes a YouTube link and sends it to Gemini.
Make a new folder for your business, or use the one you already work in. Open Claude Code in it and paste this whole block:
Set up a watch-video skill for me in this folder, so you can watch YouTube videos.
Make these 2 files, exactly as written below:
1. .claude/skills/watch-video/SKILL.md
2. .claude/skills/watch-video/watch.py
Then run this to check it works: python3 .claude/skills/watch-video/watch.py --help
Rules:
- Don't ask me for my Gemini key. Never print it or put it in any file. I'll save it myself.
- Don't change what's in the files. If something fails, tell me what failed in plain words.
- When you're done, tell me in 3 short lines what you made and what I do next.
File 1: .claude/skills/watch-video/SKILL.md
```
---
name: watch-video
description: Watch a public YouTube video with Gemini and report what is really in it, the words, what is on screen and the steps it teaches. Use when I paste a YouTube link and ask what is in it, ask you to break it down, or ask you to learn from it.
---
# Watch a YouTube video
Claude can't watch video. This skill sends the link to Gemini, Google's AI, which watches the picture and the sound.
1. Run the script in this skill's folder:
python3 <this skill's folder>/watch.py "YOUTUBE LINK" "MY QUESTION"
2. Write a clear question. To learn from a training, ask for every step, rule and example it teaches, in order, with timestamps.
3. For a long video, or if you get a limit error, watch it in parts with --start and --end (in seconds).
4. For a fast-cut reel or short, add --fps 5 so Gemini sees more frames.
5. Give me Gemini's answer, then your own notes. Keep the two apart, so I know what came from the video.
Rules:
- Never ask for my Gemini key, print it, or write it into any file. If the script says no key was found, tell me to do Step 2 of the guide, then close and reopen Claude Code. Then stop.
- Only public YouTube videos work. Not private or unlisted ones.
- Never add steps, numbers or quotes the video didn't have.
```
File 2: .claude/skills/watch-video/watch.py
```python
#!/usr/bin/env python3
"""watch.py: send a public YouTube link to Gemini and print what it sees and hears.
Usage:
python3 watch.py "YOUTUBE LINK" "What does this video teach?"
python3 watch.py "YOUTUBE LINK" "What happens here?" --start 0 --end 90 (only 0:00 to 1:30)
python3 watch.py "YOUTUBE LINK" "Break down the cuts." --fps 5 (more frames, for fast edits)
Needs a free Gemini key from https://aistudio.google.com/apikey, saved as GEMINI_API_KEY.
Uses only what Python already has. Nothing to install.
"""
import argparse
import json
import os
import re
import sys
import urllib.error
import urllib.request
MODEL = "gemini-3.8-flash" # If Google retires this model, change this one line.
API = "https://generativelanguage.googleapis.com/v1beta/interactions"
RULES = """Rules for your answer:
- Describe only what is really in the video. Never guess a brand, a product or who someone is.
- Quote what people say word for word, or don't quote it.
- If text on screen is hard to read, say so. Don't guess it.
- Give a timestamp (MM:SS) for everything you point to.
- If the video doesn't answer the question, say that in your first line."""
def stop(msg):
print(msg, file=sys.stderr)
sys.exit(1)
def youtube_link(link):
m = re.search(r"(?:youtube\.com/(?:watch\?(?:.*&)?v=|shorts/|live/|embed/)|youtu\.be/)([A-Za-z0-9_-]{11})", link)
if not m:
stop("That isn't a YouTube link. Paste a link like https://www.youtube.com/watch?v=...")
return "https://www.youtube.com/watch?v=" + m.group(1)
def build_request(link, question, start=None, end=None, fps=None):
video = {"type": "video", "uri": youtube_link(link)}
processing = {}
if fps is not None:
processing["fps"] = fps
if start is not None:
processing["start_offset"] = f"{start:g}s"
if end is not None:
processing["end_offset"] = f"{end:g}s"
if processing:
video["processing"] = {"type": "static", **processing}
return {"model": MODEL, "input": [{"type": "text", "text": question + "\n\n" + RULES}, video]}
def answer_text(data):
parts = []
for step in data.get("steps", []):
if step.get("type") == "model_output":
for c in step.get("content", []):
if c.get("type") == "text" and c.get("text"):
parts.append(c["text"])
return "\n".join(parts).strip()
HTTP_HELP = {
400: "Google said the request was bad. Check the link is a public YouTube video, and that your key is right.",
403: "Google refused the key. Make a new one at https://aistudio.google.com/apikey and save it again.",
404: "Google can't find the model. It may have been retired. Change the MODEL line at the top of watch.py to a current Flash model.",
429: "You hit the free limit. Wait a while, or watch a shorter part with --start and --end. The free tier allows up to 8 hours of YouTube a day.",
500: "Google had a problem on its side. Try again in a few minutes.",
503: "Google is busy right now. Try again in a few minutes.",
}
def main():
p = argparse.ArgumentParser(description="Send a public YouTube link to Gemini and ask about it.")
p.add_argument("link", help="a public YouTube link")
p.add_argument("question", help="what you want to know about the video")
p.add_argument("--start", type=float, help="start at this second")
p.add_argument("--end", type=float, help="stop at this second")
p.add_argument("--fps", type=float, help="frames per second to look at (default 1, use 5 to 10 for fast cuts)")
a = p.parse_args()
key = os.environ.get("GEMINI_API_KEY", "").strip()
if not key:
stop("No Gemini key found. Get a free one at https://aistudio.google.com/apikey, "
"save it as GEMINI_API_KEY (Step 2 of the guide), then close and reopen Claude Code.")
body = json.dumps(build_request(a.link, a.question, a.start, a.end, a.fps)).encode()
req = urllib.request.Request(API, data=body, method="POST",
headers={"Content-Type": "application/json", "x-goog-api-key": key})
print("Watching the video. Long videos can take a few minutes...", file=sys.stderr)
try:
with urllib.request.urlopen(req, timeout=900) as r:
data = json.loads(r.read())
except urllib.error.HTTPError as e:
detail = e.read().decode("utf-8", "replace")[:600]
stop(f"Error {e.code}. {HTTP_HELP.get(e.code, 'Something went wrong.')}\nGoogle said: {detail}")
except urllib.error.URLError as e:
stop(f"Couldn't reach Google. Check your internet. ({e.reason})")
text = answer_text(data)
if not text:
stop(f"No answer came back (status: {data.get('status', 'unknown')}). "
f"Google said: {json.dumps(data.get('errors', data))[:600]}")
print(text)
if __name__ == "__main__":
main()
```Claude Code makes two files: the skill, and a small script that talks to Gemini. Then it checks the script runs.
2Get your free Gemini key
The key is what lets the script use Gemini. It's free.
- Go to https://aistudio.google.com/apikey and sign in with your Google account.
- Click Create API key and copy it.
- Open the Terminal app on your Mac. Paste this line, but first swap paste-your-key-here for your key. Keep the quote marks. Then press Enter.
echo 'export GEMINI_API_KEY="paste-your-key-here"' >> ~/.zshrc
- Close Claude Code and open it again, so it picks up the key.
Never paste your key into the Claude Code chat, and never show it on screen. Treat it like a password. On Windows, ask Claude Code: "How do I save GEMINI_API_KEY as an environment variable on Windows, without showing it to you?"
3Watch a training and turn it into a skill
Pick a YouTube training on something you want Claude Code to get good at. Writing hooks. Sales calls. Email. It has to be a public video.
Paste this. Fill in the link and a short name for the new skill first, like hook-writer.
Watch this training with the watch-video skill: [YouTube link] Ask Gemini for everything it teaches: every step, rule and example, in order, with timestamps. Then turn this into a skill. Make .claude/skills/[skill-name]/SKILL.md with: - A short description that says when to use it. - The steps, in order. - The rules. - 2 or 3 examples from the video, with timestamps. - The video link, so I can check it. - This rule at the end: "Never make up numbers, stats, results or quotes. If a hook needs a number, write [real number] and ask me for it." Use only what the video teaches. Don't add your own tips. If part of it isn't clear, put it under "Not clear from the video". Then show me the skill, and give me one line I can type to use it.
Claude Code shows you the new skill. Read it once. If something is wrong, tell it what to fix.
4Test it on a real job, then fix it
Watching is the easy part. Claude hasn't learned a skill until it passes a test on a real job.
Open a new chat in the same folder and give it a real job. Claude Code finds the skill on its own. For example:
Use my [skill-name] skill. [a real job, like: Write 5 hooks for my next reel about ...]
Read every line that comes back. The first time I ran this, one of the hooks had a stat in it. A number it made up. That's why the skill from Step 3 ends with a rule about numbers.
When something is wrong, don't just fix the answer. Paste this:
This is wrong: [the line, and what's wrong with it] Add a rule to the [skill-name] skill so it doesn't happen again. One short line that says what to do. Show me the line you added. Then do the job again.
Keep going until a job comes back with nothing to fix. Then do it again with the next training you want it to learn from.
The limitations you should know
- Public YouTube videos only. Not private or unlisted ones, and not Instagram or TikTok.
- The free tier allows up to 8 hours of YouTube a day. Google calls the YouTube feature a preview, so it may change. On the free tier, Google may use what you send to improve its products. Don't put private business details in your questions.
- Long videos can hit the free limit. Ask Claude Code to watch it in parts.
- The new skill only knows what that one video teaches. If the training is bad, the skill is bad. Pick trainers you trust.
- The skills live in this folder. Open Claude Code here to use them. Want them in every folder? Ask Claude Code to move them to ~/.claude/skills.
- If Google retires the model, the script tells you. Ask Claude Code to change the MODEL line in watch.py to Google's current Flash model.
Want the next guide? Follow @zachcrawford.ai
