Workflows 7 min read

AI Video Automation: How to Automate Video Editing With Claude Code

AI video automation with Claude Code means saving an edit you repeat as a skill, then running it on a folder of clips with claude -p, the non-interactive mode, instead of typing each request. Claude still runs ffmpeg and Python on your computer. Trims, captions, loudness and exports automate well; choosing takes and judging pacing still need you, so build in a preview stop.

What AI video automation can and cannot do

AI video automation with Claude Code works on edits you can write down as rules. If a step reads the same for every video, Claude can run it on every video: transcribe, trim pauses, add captions, normalise loudness, export each format and write a check report. Claude Code does this by running ffmpeg and Python on your computer, so automating means running those steps without typing each request.

Some parts are judgement, not rules, and stay with you:

  • choosing the best take, or whether the story works at all
  • pacing by feel and the timing of a joke
  • whether a highlighted word matches how you said it
  • the final watch with sound

So aim for a batch that does the mechanical work and stops at a review point.

ApproachWhat repeats on its ownWhere you reviewBest for
Manual editing appPresets and saved settingsOn the timeline as you goOne-off edits, pacing by feel
Template appA fixed lookAfter each exportQuick clips in a preset style
Claude Code, one prompt at a timeNothing; you paste each stepAfter every stepWorking out an edit
Claude Code skill, run by handThe whole procedureAfter each videoA few videos a week
Skill in a claude -p batchThe procedure across a folderAt a preview stop, then finalsMany clips, same edit
Human editorTheir own habitsRevision roundsTaste and judgement

Turn the edit you repeat into a skill

Before you automate anything, save the edit as a Claude Code skill. A skill is a folder with a SKILL.md file of instructions that Claude loads by name; what is a Claude skill? covers the format. Anthropic’s docs suggest making one when you keep pasting the same instructions or multi-step procedure into chat.

Build it from prompts that already work. Run your AI video editing workflow one prompt at a time on two or three clips, fix what goes wrong, then ask Claude to save the final versions as a skill:

---
name: weekly-edit
description: My standard edit for one talking-head clip.
disable-model-invocation: true
---
Edit the clip at $0. Never write to raw/.
1. Work in work/<clip name>/. Transcribe to words.json.
2. Shorten silences over 0.5 s to 0.25 s, never inside a word.
3. Word-timed captions in my style; loudness with loudnorm, two passes.
4. Render preview.mp4 at 540×960 and contact.png (16 frames), then stop.
5. If $1 is "final" and work/<clip name>/approved.txt exists,
   render out/<clip name>.mp4 at 1080×1920.

$0 is the first argument after the skill name and $1 the second, so /weekly-edit raw/clip01.mp4 final renders the approved final. disable-model-invocation: true means Claude runs it only when you call it, which suits a skill that writes files. Steps that must behave the same every time, such as drawing captions, can be scripts inside the skill folder that Claude runs instead of rewriting. The Combine & Fix workflow ends with a prompt that saves an effects setup as a skill, and the AI Video Effects styles are packaged the same way.

Set up folders for batch video editing

Batch video editing needs a predictable folder layout before it needs a script:

project/
├── raw/      original clips, never edited
├── work/     one folder per clip: words.json, masks, previews
├── out/      approved finals only
└── logs/     one log per clip per run
  • One work folder per clip. A transcript and a person mask describe one video, so clips must never share them.
  • Names without spaces, such as 2026-10-21-hook.mp4. Shell loops handle them without quoting trouble.
  • A backup of raw/ elsewhere. Claude Code’s checkpoints track edits made with its file tools, not files written by shell commands, so a render that overwrites a clip cannot be rewound.
  • Only finals in out/, so everything there is safe to upload.

Run Claude Code headless on a folder of clips

claude -p runs Claude Code without the interactive screen, which is how a script drives it. Anthropic’s docs call it non-interactive mode, and skills work in it: put /weekly-edit in the prompt and Claude Code expands it before running. The best-practice guide’s pattern for batch work is one claude -p call per file:

for clip in raw/*.mp4; do
  name=$(basename "$clip" .mp4)
  claude -p "/weekly-edit $clip" \
    --permission-mode dontAsk \
    --allowedTools "Read,Write,Edit,Bash(ffmpeg *),Bash(ffprobe *),Bash(python *)" \
    --max-turns 60 \
    --output-format json > "logs/$name.json" \
    || echo "$name" >> logs/failed.txt
done
  • dontAsk plus --allowedTools runs only what you listed and denies anything else that would need approval. The trailing * makes Bash(ffmpeg *) match any command starting with ffmpeg. Match the list to the commands your skill really runs.
  • Exit codes are 0 on success and non-zero on failure, so || logs the failed clip and the loop moves on.
  • --max-turns ends a run that keeps going; 60 is an arbitrary ceiling to adjust after a test. --max-budget-usd stops a run once its estimated spend reaches a cap you set.
  • --output-format json saves the result, a session ID and total_cost_usd, an estimate of that clip’s cost.

Test on two or three clips, read the logs, fix the skill, then run the folder. Leave --bare off here: it skips skills and hooks and does not use your subscription login. To write the loop in Python or TypeScript instead, the Agent SDK offers the same agent loop as a package.

Long renders need one more setting. In a claude -p run, a command that outlives its timeout moves to the background, and Claude Code stops it 10 minutes later by default. Start the batch with BASH_DEFAULT_TIMEOUT_MS above 600000, for example BASH_DEFAULT_TIMEOUT_MS=3600000 for an hour, or have your script run the final ffmpeg render itself.

Add a review step and keep the batch safe

An unattended batch should stop at previews, not finals. Run the loop twice. The first pass renders a preview and a contact sheet per clip. You watch them, add approved.txt to each clip folder you are happy with, or write notes for the skill to read. The second pass runs with final, and the skill renders only approved clips.

Anthropic’s guide recommends giving Claude a check it can run and asking for evidence rather than a plain “done”. For video, that means ffprobe output for size, frame rate and duration, plus a contact sheet Claude has opened. Claude Code reads PNG and JPEG images, so it checks stills; motion, lip sync and sound stay with you.

Choose the permission mode deliberately:

  • dontAsk with an allowlist is the tight option for scripts.
  • acceptEdits auto-approves file edits and common filesystem commands in your working folder, including rm and mv, so it is looser than it sounds next to footage.
  • auto has a classifier review actions instead of you, so you list nothing in advance.
  • bypassPermissions skips checks; the docs say to use it only in isolated containers or VMs.

Hooks add rules that always run, and a -p run without --bare runs the project’s hooks. The hooks guide calls them deterministic, unlike instructions Claude may or may not follow. A Stop hook can run a check script, such as confirming each output exists at the right size, and block the turn from ending until it passes. A Notification hook can alert you when an interactive session needs input.

Cost, time and where to start

Cost depends on tokens, and render time depends on your computer. Anthropic’s cost guide says token use grows with context, and Claude Code sends the whole conversation with each request, so one short claude -p run per clip uses less than one long session editing fifty clips in a row. Bundled scripts help too: Claude runs them instead of writing the same caption code again. Check spend with /usage, or read total_cost_usd in the JSON logs as an estimate.

Render time has no fixed figure: AI video automation still runs every frame on your machine. Time one clip and multiply before you queue a folder.

To start:

  1. Run the setup prompt on one short clip.
  2. Use the AI video editing prompts one at a time until the edit looks right.
  3. Save them as a skill, run the loop on three clips, review, then run the folder.

Where this falls short

  • Picking the best take, judging whether a story lands and pacing by feel do not reduce to rules. A manual editing app or a human editor still does that part better.
  • A batch repeats mistakes as faithfully as good edits. If the skill is wrong on the first clips, it will be wrong on every clip, so the preview stop is not optional.
  • For one or two videos a week, writing and testing a batch script can take longer than editing interactively in Claude Code or in an editing app.
  • Unattended runs need tight permissions. Skipping permission checks entirely is meant for isolated containers or VMs, not the laptop that holds your only copy of your footage.

Questions

Can I automate video editing without writing a shell script?

Partly. A skill already automates the edit itself: in an interactive session, in the terminal or the desktop app's Code tab, you type the skill name and the file, and Claude runs the whole procedure. What the script adds is the loop over a folder, so clips run one after another while you are away. Many people start with the skill alone and add the loop later.

Does a batch run use my Claude subscription or the API?

A normal claude -p run uses the same sign-in as your interactive sessions, so it draws on your plan or your API billing in the same way. Bare mode is different: Anthropic's docs say it does not use your subscription login and needs an API key. Run /usage in a session to see where your usage stands, and check plan details on Claude's own pricing page.

Should I process several clips in parallel?

You can, and Anthropic's guide describes fanning out across many claude -p calls. Video is different from code, though: every render uses your own computer's processor, memory and disk, so parallel runs compete for the same machine. Run one clip at a time first, note how long it takes, then try two at once and compare before going wider.

What happens if one clip fails halfway?

The run exits with a non-zero code, the loop logs the clip and moves on to the next. With JSON output, each log holds a session ID, and claude -p with --resume and that ID continues the same conversation, so you can ask what went wrong and finish the clip without starting over. Fix the skill before re-running the whole folder.

Read next

Try it on your own video.

Every effect prompt is free. Pick one, paste it into Claude Code and render your first edit.

Free download

Get the .md file

Enter your email and the download starts right away.

We use your email for this download and, if you tick the box, for updates. See our privacy policy.