Where to Find the Main Script in bradautomates/claude-video
The main script for bradautomates/claude-video is watch.py, located in the skills/watch/scripts/ directory, which functions as the central entry point for processing video content via the /watch slash command.
The bradautomates/claude-video repository provides an Agent Skill that enables AI assistants to analyze video content through a standardized slash-command interface. Understanding the location and architecture of the main script is essential for developers who want to extend the functionality or integrate the tool into custom workflows.
Location of the Main Entry Point
The core executable for the claude-video Agent Skill resides at skills/watch/scripts/watch.py. This module implements the slash-command logic invoked as /watch <url-or-path> [question] within host environments like Claude Code, Codex, or Cursor.
Unlike standalone applications, this script is designed to be harness-agnostic. It dynamically resolves its own directory at runtime using the SKILL_DIR variable, then invokes helper utilities via relative paths to ensure compatibility across different AI agent platforms.
Workflow Orchestration
When executed, watch.py coordinates a four-stage pipeline to transform video input into analyzable content:
- Download – Delegates to
download.py(a yt-dlp wrapper) to fetch remote videos or validate local media files. - Frame Extraction – Calls
frames.py(an ffmpeg wrapper) to generate representative image frames at an optimal FPS calculated for the video duration. - Transcription – Executes
transcribe.pyfor local Whisper processing, or optionallywhisper.pywhen utilizing the external Whisper API. - Response Assembly – Returns the transcription text and frame paths back to the host environment for analysis.
Supporting Scripts and Architecture
The main script relies on several specialized modules located in the same directory:
skills/watch/scripts/download.py– Handles video acquisition and stream extraction.skills/watch/scripts/frames.py– Manages ffmpeg-based frame extraction with automatic FPS calculation.skills/watch/scripts/transcribe.py– Performs local transcription using Whisper models.skills/watch/scripts/whisper.py– Optional wrapper for external Whisper API endpoints.skills/watch/SKILL.md– Defines the canonical skill contract and/watchcommand metadata.
Running the Main Script
You can execute the entry point directly for development or standalone usage.
First, clone the repository and install dependencies:
git clone https://github.com/bradautomates/claude-video.git
cd claude-video
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
Then invoke the main script with a video path and optional question:
python skills/watch/scripts/watch.py path/to/video.mp4 "Summarize the content"
For programmatic integration, import the specific helper functions:
from skills.watch.scripts.download import download_video
from skills.watch.scripts.frames import extract_frames
from skills.watch.scripts.transcribe import transcribe_video
video_path = download_video("https://youtu.be/example")
frames_dir = extract_frames(video_path)
transcript = transcribe_video(video_path)
Summary
- The main script for bradautomates/claude-video is
watch.pylocated atskills/watch/scripts/watch.py. - It serves as the entry point for the
/watchslash command across Claude Code, Codex, and Cursor. - The script orchestrates download, frame extraction, and transcription by invoking helper modules via relative paths.
- Helper scripts include
download.py,frames.py,transcribe.py, andwhisper.py.
Frequently Asked Questions
What is the exact file path for the main script in bradautomates/claude-video?
The main script is skills/watch/scripts/watch.py. This path is relative to the repository root and represents the executable entry point that host environments trigger when processing the /watch command.
Can I run the main script without Claude Code or other AI agents?
Yes. While designed as an Agent Skill, watch.py can be executed directly as a Python script. It accepts a video URL or file path as the first argument and an optional question as the second argument, making it suitable for command-line usage or integration into other Python applications.
Which helper scripts does the main watch.py script depend on?
The main script depends on four core helper modules: download.py for video acquisition, frames.py for ffmpeg-based frame extraction, transcribe.py for local Whisper transcription, and optionally whisper.py when using the external Whisper API. All helpers reside in the same skills/watch/scripts/ directory.
How does the main script locate its helper modules?
The script uses runtime directory resolution via the SKILL_DIR variable to determine its install location. It then invokes helper scripts using relative paths from this directory, ensuring the skill works regardless of where the repository is cloned on the filesystem.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →