# Edit an episode

Run the Edit loop, change the cut with the timeline commands, and render the finished episode as a video file.

The edit turns the picked takes into one cut: the shots in order, the voice lines, the captions and the music. Your agent runs the Edit loop. You watch the cut and say yes.

Start after you approve the Videos loop. See [Generate and pick video takes](/docs/cli/generate-and-pick-video-takes). Every command here needs a signed-in computer. The commands that change or render the cut run in the episode folder, so start with:

```bash Terminal
cd rain-shop/episodes/ep01
```

## Open the cut

1. Open the episode in the MiniCut app, on the editor tab. The project is `rain-shop`:

```bash Terminal
minicut open rain-shop --episode ep01 --tab editor
```

2. Open the address it prints. The editor shows the cut.
3. If the app does not start, run `minicut edit rain-shop --episode ep01`. See [Editor](/docs/cli/editor).

## Change the cut

Change the cut in the editor, or with `minicut timeline`. Never write the cut file `index.html` by hand. The Edit loop fails a hand-written cut, and in Claude Code and Codex a hook refuses the write.

1. List the cut: every track and clip, with its start and end.

```bash Terminal
minicut timeline
```

2. Change the words of a caption, title or card:

```bash Terminal
minicut timeline set '#cap-c05-l01' --text "I never left."
```

3. Fix the captions after you change words or timing. This keeps the words, splits them again and times them to the voice:

```bash Terminal
minicut captions
```

4. If a take is shorter than its shot, the cut holds the take's last frame still. Cut the shot down to its take. Look at the plan first, then apply it:

```bash Terminal
minicut timeline fit --plan
minicut timeline fit
```

5. To undo the fit, run `minicut timeline fit --undo`. To undo another change, run `minicut timeline undo RECEIPT`. `RECEIPT` is the undo receipt that the change printed.
6. To look at the cut without a render, save stills:

```bash Terminal
minicut snapshot --at 1,3,5 -o snapshots
```

## Run the Edit loop

1. Your agent runs this:

```bash Terminal
minicut loop run edit
```

2. The command renders the cut to `renders/edit-r1.mp4` in the episode folder. The number is the round. Then it checks the cut and the render.
3. Each failure prints as `FAIL` with a label and a fix:

| Label | What it means |
|---|---|
| `hand edit` | `index.html` was changed by hand. Change the cut with `minicut timeline` or in the editor |
| `held frame` | A shot is longer than its take. Run `minicut timeline fit` |
| `music fit` | The music was written for a cut more than 1 s longer or shorter than this one. Run `minicut music cuts` for the new shot times, write the song again, then run `minicut music render` |
| `repeat` | The same picture plays in two shots. The fix is `minicut timeline trim` |
| `cut` | The picture changes inside a shot the shot sheet did not ask for. The fix is `minicut timeline trim` |
| `read-back` | The speech in the render does not say a line |
| `render` | The cut did not render. The fix is `minicut render lint` |

The loop also checks the captions and the timeline itself.

4. Your agent applies each fix and runs the command again. After 3 rounds the loop prints `CAP REACHED, stop and show the user what is still failing`, and you decide.

## Render the finished episode

1. Render the final file from the episode folder:

```bash Terminal
minicut render -o renders/ep01.mp4 --quality delivery
```

`--quality` is `draft`, `looks` or `delivery`.
2. Check the finished file from the project folder:

```bash Terminal
minicut check render episodes/ep01 episodes/ep01/renders/ep01.mp4
```

It prints each failure with its fix, then `RESULT: PASS` or `RESULT: FAIL`, and saves the result beside the video file.

## Approve the cut

1. Open the cut with `minicut open rain-shop --episode ep01 --tab editor` and watch it.
2. If it is right, say yes. Your agent runs:

```bash Terminal
minicut loop approve edit
```

## Check it worked

Run `minicut loop` in the project folder. Every loop shows as approved or done. The file `episodes/ep01/renders/ep01.mp4` is the finished episode.

## Errors

| Message | What to do |
|---|---|
| `no index.html yet` | The episode has no cut. Your agent lays the first cut, then runs the loop again |
| `index.html was changed by hand` | Undo with `minicut timeline undo RECEIPT`, or redo the change with `minicut timeline` or in the editor |
| `minicut loop runs inside a project folder (the one with series.json, or any folder under it).` | Run the loop in the project folder |
| `You are not signed in. Ask your agent to run minicut login.` | Sign in. See [Account](/docs/cli/account) |

## Next

[Editor](/docs/cli/editor) [Checks and loops](/docs/cli/checks-and-loops) [Overview](/docs/cli/overview)
