How to Edit Video with Claude Code, End to End on a Mac
Edit video with Claude Code on your files: how BetterLibrary and BetterEdits teach the agent with a CLAUDE.md, one prompt run end to end, and the limits.
To edit video with Claude Code you need video tools that speak the agent's language: a command line and a written guide. BetterLibrary and BetterEdits ship both inside the app bundle and write a CLAUDE.md into every library they create. Open a terminal in a folder of footage, say what you want, and watch the apps do it. Here is what that looks like, one prompt run end to end with the real commands, and where it stops.
What editing video with Claude Code looks like
You open Claude Code in a library folder and type: "Find the three best energetic gym clips, cut them into a 9:16 reel with captions, and export it." The agent reads the guide in the folder, finds and exports three highlights with betterlibrary, cuts, captions and checks the timeline with BetterEdits cli, and exports an MP4.
That is the whole idea. No plugin, no API key hunt, no uploading footage to a web tool. The agent works on your files, on your Mac, through the same code the app windows use, and both apps show every step on screen.
For a solo creator the bottleneck was never one tool. It is the loop: sort, pick, cut, caption, export, every week. An agent that can run the loop while you watch is the difference between "I should post this" and a file in exports/.
Every folder teaches the agent
When BetterLibrary creates a library, or BetterEdits creates one, the app writes a guide into the folder: the tool's full path, every command with its options, and how clips, tracks, text and captions behave. The file is CLAUDE.md, so Claude Code reads it on its own the moment you open a session there.
Three details make this work in practice rather than on a slide.
The path is exact and heals itself. Nothing goes on your PATH. The BetterLibrary tool lives at BetterLibrary.app/Contents/Helpers/betterlibrary; BetterEdits answers to BetterEdits.app/Contents/MacOS/BetterEdits cli. The guide names the full path and rewrites it on every launch, so if you move the app to a different folder the guide is right again next time it opens.
Your notes survive. The guide has a "Notes about this library" section that the app never rewrites. House rules ("never use the drone footage from March", "captions in Bold Outline, always") live next to the footage and every session sees them.
BetterEdits pre-approves only its own binary. It writes a Claude Code settings file into the library that allows that one command and nothing else, so the agent can run the editor without a permission prompt on every step and without a blanket shell approval.
The command lines, briefly
Both tools ride inside the app bundle. You do not need to read this section to use them, but the walkthrough below is easier to follow if you know the shape.
BetterLibrary. Every command takes --library <path>, or reads $BETTERLIBRARY_LIBRARY, or uses the library enclosing the current directory. --json works on any command. Ids are UUIDs and any unique prefix works. The verbs are clips, highlights, import, export, properties, tags, views, ai and settings, with clips list carrying the filters: --search, --mode fuzzy|includes|meaning, --tag "Prop:Tag", --orientation, --after, --before, --sort, --limit.
BetterEdits. Commands reach the running app over a Unix socket (launching it in the background if needed) and land as ordinary undo steps. Refs are short: tracks are v1, a1, t1, s1; clips are v1:2; caption bars are s1:3. Times are seconds, 1:02.5, end or playhead. Most commands print JSON already, so there is no --json flag. The verbs cover the project (project-new, ratio, media-import), the timeline (clip-add, clip-trim, clip-split, clip-move, placeholder-add), text (text-add), captions (captions-generate, caption-edit, captions-style), looking (frame, contact-sheet), and export.
The guide in each folder has the complete list; the Claude Code page has the reference online.
Six prompts that work
These are the prompts we put on the site because they are the ones we run.
- "Import everything in ~/Shoots/Tuesday, tag it, and mark Ready anything with a face in focus."
- "Show me the ten most cinematic drone shots from spring and export the best five seconds of each."
- "Cut the clips in ./reel into a 20-second 9:16 piece, caption it, and put the title on the first clip."
- "Clone this reel's structure, fill each placeholder from ./b-roll, and export at 4K."
- "Find last week's coffee-shop footage, cut a morning-routine reel with captions, and export it."
- "Make three variations of this reel with different hooks and export all of them."
Two of these use only BetterLibrary, two use only BetterEdits, two use both. The second app is discounted because the last kind is where the time goes.
One prompt, end to end
Take the fifth prompt, with the coffee shop swapped for a gym because that is our demo library. "Find the three best energetic gym clips, cut them into a 9:16 reel with captions, and export it." Here is what Claude Code does, with the commands as the guide teaches them. Paths are shortened; the guide spells out the full ones.
Step 1: find the clips
The agent reads first. The guide tells it to prefer existing tags and to look before it writes.
betterlibrary properties list --json
betterlibrary clips list --shelf library --orientation portrait \
--tag "Vibe:Energetic" --search "gym" --mode meaning \
--sort relevance --limit 3 --json
--shelf library limits the search to clips you approved (Ready), so the agent cannot pick a draft you never signed off. --mode meaning uses the on-device sentence model, so "gym" also finds a clip described as "kettlebell swings, wide". The answer is JSON with ids, names, durations and the highlights already marked on each clip.
Step 2: get the moments out as files
Highlights are named in and out points kept in the index. Exporting one writes a losslessly trimmed copy, cut on keyframes with no re-encode.
betterlibrary highlights list --json
betterlibrary highlights export 3f2a 9c41 b7d0 --to ./reel --numbered
Three files land in ./reel, numbered in order, named after the highlights. If a clip had no highlight, the agent can add one (highlights add <clip> --in 4 --out 9 --name "Swing, wide") or export the whole clip with export.
Step 3: build the timeline
Now BetterEdits. The app launches in the background if it is not open, and every command below is one undo step in it.
BetterEdits cli project-new "Gym reel"
BetterEdits cli ratio 9:16
BetterEdits cli clip-add --track v1 --path ./reel/01-swing-wide.mp4
BetterEdits cli clip-add --track v1 --path ./reel/02-rope-slam.mp4
BetterEdits cli clip-add --track v1 --path ./reel/03-sled-push.mp4
BetterEdits cli timeline
timeline prints the tracks and clips as JSON. The agent reads it, sees the piece is 31 seconds, and trims.
BetterEdits cli clip-trim v1:1 --end 6
BetterEdits cli clip-split v1:2 8
BetterEdits cli clip-remove v1:3
BetterEdits cli clip-trim v1:3 --end 7
Positional values fill required options, so clip-split v1:2 8 splits the second clip at eight seconds. The track is magnetic, so removing a clip closes the gap and the next one slides in.
Step 4: caption and title
BetterEdits cli captions-generate --source v1
BetterEdits cli captions --words
BetterEdits cli caption-edit s1:4 --action merge
BetterEdits cli captions-style --style "Bold Outline" --position bottom --offset 0.12
BetterEdits cli text-add "Monday, 6am" --at 0 --duration 2.5 --favorite Strong --y 0.2
captions-generate mixes the video track down, transcribes the audio and adds a Subtitles track of short bars. captions --words prints them with timings so the agent can read what came back and merge a bar that split mid-phrase. The title goes on the first clip in the Strong look, and the guide has already told the agent that hooks belong in the first one to two seconds.
Step 5: look at it
This is the part that makes the loop trustworthy. The agent cannot watch video, so the CLI draws pictures.
BetterEdits cli contact-sheet --every 1.5 --columns 4 --out ./check/sheet.png
BetterEdits cli frame --at 0.5 --out ./check/title.png
contact-sheet writes a grid of labelled frames with text and captions drawn on, exactly as the export will render them. frame writes one. Claude Code reads the PNGs, notices the title sits under the caption bar, and fixes it:
BetterEdits cli text-set t1:1 --y 0.28
BetterEdits cli frame --at 0.5 --out ./check/title-2.png
Step 6: export
BetterEdits cli export ./exports/gym-reel.mp4 --height 2160
A 4K 9:16 MP4 with the captions and title burned in, hidden tracks left out, the way the window would export it. The command line renders at 30 fps; if you want 24 or 60, press ⌘E in the app and pick it in the sheet.
Elapsed: a few minutes, most of it transcription and the render. You watched both apps do it.
Why it is safe to hand an agent the editor
The objection is reasonable, so here is the specific answer rather than a reassurance.
Same rules as the window. The command line is the UI-free half of the same code. It cannot reach a state the window can't, and it cannot skip a confirmation the window would ask for. BetterLibrary writes go through the same service layer as the window, so statuses, single-select rules and tag re-filing behave identically, and an open app reloads at once.
Undo in BetterEdits. Every CLI command lands as one ordinary undo step. If the agent trims the wrong clip, ⌘Z in the app puts it back, exactly as if you had dragged the edge yourself.
The guide names what cannot be undone. BetterLibrary has no undo stack. Its guide says so, and it names clips reset and clips delete as the only destructive commands. Deletes go to the macOS Trash. Trims that rewrite a file and splits that make two files ask first in the app, and the guide tells the agent which commands are one-way.
The model sees what you export, not the project. frame and contact-sheet PNGs are the model's eyes. It never reads your raw footage. AI tagging sends a downscaled, silent 640×480 copy of a clip to our AI service; captions send the track's audio to our transcription service; Clone Reel sends a 720p copy of a public reel. Nothing else leaves the Mac, and the exact prompt is in Settings.
Imports are copies. BetterLibrary files originals into originals/<year>/<month>/ inside the library; your source folder is untouched. BetterEdits copies imported media into the project's media/ folder. The tools never modify your camera roll.
The AI never approves. In BetterLibrary, the model can move a clip from New to Draft by filling it in. It never marks Ready or Archived and never touches a manual property. The guide tells the agent not to mark clips Ready unless you asked it to approve them.
The honest limits
Both apps are version 0.1. The limits below are the ones that bite in real use, not a legal footnote.
- BetterLibrary CLI has no undo. Metadata writes are visible in the open app immediately but there is no ⌘Z for them. Keep the destructive verbs (
reset,delete) for when you mean it; everything else is a status or a tag you can change back. - AI tagging needs the app open.
betterlibrary ai requestqueues the work, but the app runs the queue. If BetterLibrary is closed, the request waits. - BetterEdits CLI exports at 30 fps. The export sheet offers 24 and 60; the command line does not. For a 24 fps deliverable, finish with ⌘E in the app.
- Clone Reel needs
yt-dlpon the Mac. The reel-clone command fetches the public reel with it. - Meaning search matches prose.
--mode meaningfinds clips by their names, descriptions and highlight names. Untagged clips with no description are invisible to it, which is one more reason to let the AI tag a shoot on import. - No publishing. The export is a local file. Getting it onto Instagram is AirDrop and the phone.
- BetterEdits needs macOS 15 or later. BetterLibrary runs on macOS 14.4 or later, Apple silicon or Intel.
Claude Code is what we build for and test with. Any agent that reads a CLAUDE.md-style guide and can run a shell command works the same way, because there is nothing Claude-specific in the tools.
Where this fits with the rest of the workflow
If you cut reels by hand today, the agent story is optional. The apps are complete without it: BetterEdits is a small, fast Mac editor in the spirit of Instagram's Edits (we compare it to the phone app in Instagram Edits on a Mac), and BetterLibrary is a clip library that finds the shot you mean (how to organize video clips on a Mac). The command line is there for Claude Code and for people who like a terminal.
The prompt at the top of this article is the reason to own both.
What to do next
Create a library in BetterLibrary, drop one shoot on it, and open Claude Code in that folder. Type: "Find the three best energetic clips, cut them into a 9:16 reel with captions, and export it." Then watch the two windows. Both apps are free to download from the download page; every plan starts with a free trial, and the commands that call a model (tagging, asking, captions, cloning) spend AI credits included in the plan. Plan details are on the pricing page.
Questions people ask
- Can Claude Code edit video?
- Yes, if the video tools give it a command line and a guide. BetterLibrary and BetterEdits both ship a CLI inside the app bundle and write a CLAUDE.md into every library, so Claude Code can find clips, cut a timeline, caption it and export, while the apps show every step on screen.
- Do I need to learn the command line to use this?
- No. You type a sentence in Claude Code, such as 'cut the clips in ./reel into a 20-second 9:16 piece, caption it, and export it'. The agent reads the guide and runs the commands. The app windows do everything the CLI does if you never want to see a terminal.
- Is it safe to let an agent run video editing commands?
- The command line is the same code as the window and cannot reach a state the window can't. In BetterEdits every command lands as one undo step. In BetterLibrary the only destructive commands are named as such in the guide and deletes go to the Trash. Imports are copies; sources are never touched.
- Does Claude Code see my footage?
- Only what it asks to see. The BetterEdits CLI writes PNGs with frame and contact-sheet, with text and captions drawn on, and the model looks at those. AI tagging in BetterLibrary sends a downscaled, silent copy of a clip to our AI service; captions send the track's audio to our transcription service. Nothing else leaves the Mac.
- Which Macs and versions does this need?
- BetterLibrary runs on macOS 14.4 or later, Apple silicon or Intel. BetterEdits needs macOS 15 or later. Both are version 0.1. Claude Code is what we build for and test with, but any agent that reads a CLAUDE.md-style guide and can run a shell command works the same way.
Keep reading
- BetterEditsHow to Add Captions to Reels on Mac, AutomaticallyAdd captions to Reels on Mac: what Final Cut, iMovie, CapCut and Descript offer, then a step-by-step in BetterEdits from one keystroke to burned-in bars.
- BetterEditsBest Vertical Video Editor for Mac (7 Options Compared)The best vertical video editor for Mac depends on how much editor you want. Seven options for 9:16 reels, compared on captions, HDR and learning curve.
- BetterEditsCapCut Alternative for Mac, 6 Editors That Use Real FilesSix CapCut alternatives for Mac, ranked for short vertical video: what each does better, what it lacks, and what you give up when you leave CapCut behind.