Working Directory Cleanup After Watch Operations in claude-video
The claude-video watch skill does not automatically delete its working directory after processing; instead, it prints the directory path upon completion and requires manual cleanup by the user or calling process.
The claude-video repository provides AI-powered video analysis capabilities through its watch skill, which downloads content and extracts frames, audio, and transcripts. When you execute a watch operation, the tool creates a working directory to store these intermediate files, but understanding the cleanup behavior is essential for disk space management.
How the Working Directory Is Created
The watch skill determines where to store files based on command-line arguments in skills/watch/scripts/watch.py.
Default Temporary Directory
If you do not provide --out-dir, the script generates a temporary workspace using tempfile.mkdtemp(prefix="watch-") at line 86. This creates a uniquely named folder under your system’s temporary location (e.g., /tmp/watch-9f3c2a7b), which persists on disk after the script completes.
Custom Output Directory
When you specify --out-dir, the script uses your provided path instead (lines 83-84). This mode treats the location as a persistent workspace rather than a temporary folder, though the same manual cleanup rules apply.
Cleanup Behavior and Manual Removal
The skill intentionally does not delete the working directory automatically. Upon completion, it prints a reminder message (lines 87-88) formatted exactly as:
_Work dir: `/tmp/watch-9f3c2a7b` — delete when done._
This design allows you to inspect extracted frames, audio excerpts, or intermediate transcripts before removing the data. The caller—whether Claude, a developer, or an end-user—must execute the deletion command when the files are no longer needed.
Official Documentation References
The cleanup requirement is explicitly documented in the repository:
-
skills/watch/SKILL.mdunder Step 5 — clean up states: "The script prints a working directory at the end. If the user isn’t going to ask follow-ups about this video, delete it withrm -rf <dir>." -
README.mdreinforces this behavior in its Cleanup section, reminding users that temporary data persists until manually removed.
Practical Usage Examples
Run the watch skill with a temporary directory (default behavior):
python3 skills/watch/scripts/watch.py "https://youtu.be/example" --detail balanced
Run with a persistent custom directory:
python3 skills/watch/scripts/watch.py "https://youtu.be/example" \
--detail balanced --out-dir /tmp/my-video-workdir
After execution, locate the printed path and clean up:
rm -rf /tmp/watch-9f3c2a7b # auto-generated temporary dir
# or
rm -rf /tmp/my-video-workdir # custom persistent dir
Summary
- Automatic deletion is disabled: The watch skill never deletes the working directory automatically, regardless of whether you use a temporary or custom location.
- Cleanup is manual: You must run
rm -rf <directory>after verifying you no longer need the extracted frames, audio, or transcripts. - Path notification: The script always prints the working directory path at lines 87-88 of
watch.pyto inform you where files reside. - Documentation standards: Both
SKILL.mdandREADME.mdexplicitly document this manual cleanup requirement as Step 5.
Frequently Asked Questions
Does claude-video automatically delete temporary files after processing?
No. According to the source code in skills/watch/scripts/watch.py, the script creates the directory using tempfile.mkdtemp() but never calls cleanup functions. It prints the directory path and expects the user to delete it manually with rm -rf.
How do I specify a custom working directory instead of a temp folder?
Use the --out-dir command-line argument followed by your desired path. This is processed at lines 83-84 in watch.py. While this keeps files in a predictable location, you must still delete the directory manually when finished.
Where is the working directory path displayed after a watch operation?
The script outputs the path in the final lines (87-88) of execution with the format: _Work dir: /path/to/dir — delete when done._ You can also find this note referenced in [skills/watch/SKILL.md`](https://github.com/bradautomates/claude-video/blob/main/skills/watch/SKILL.md) under the cleanup step.
Is it safe to delete the working directory immediately after the report generates?
Yes, provided you do not need to ask follow-up questions about the video content. The directory only contains downloaded video files, extracted frames, audio excerpts, and intermediate transcripts. Once you have the final analysis, removing the directory frees disk space without affecting the results.
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 →