---
title: "How to add a spiral wipe with Claude (tested prompt and script)"
description: "Clip B lays itself over clip A in 60-pixel squares that run clockwise around the edge of the frame and coil inward, a thin white line tracing the spiral, until the last square lands in the center. Install one skill and ask Claude Code, or run the Python script we tested yourself."
url: https://www.recharm.com/effects/spiral-wipe
---

# How to add a spiral wipe with Claude

Clip B lays itself over clip A in 60-pixel squares that run clockwise around the edge of the frame and coil inward, a thin white line tracing the spiral, until the last square lands in the center.

Made by the script on this page, from our own test clips.

## Get this effect

1. ### Switch to Code in your [Claude Desktop App](https://claude.com/download)

2. ### Install the skill (once)

   ```
   Install the Recharm video effects skill: download https://recharm-growth-staging.s3.us-east-2.amazonaws.com/website/downloads/recharm-video-effects.zip and unzip it into ~/.claude/skills
   ```

3. ### Ask for the effect

   ```
   Join clipA.mp4 and clipB.mp4 with a spiral wipe
   Length of the transition in seconds: 1.0
   Size of each spiral square in pixels: 60
   ```

## Several videos, several effects, one ask

Put your clips in the folder, mention them with @, and ask for everything at once. Claude runs one tested script after another on each clip, then joins them.

Put a sale badge on **@clip1.mp4**, give **@clip2.mp4** a VHS look, then join them with a spiral wipe.

## Settings you can change

Ask Claude to change any of these, or edit them at the top of the script.

| Setting      | Default           | What it does                                             |
| ------------ | ----------------- | -------------------------------------------------------- |
| `D`          | `1.0`             | Length of the transition in seconds.                     |
| `CELL`       | `60`              | Size of each spiral square in pixels.                    |
| `EDGE`       | `3`               | Width of the line along B's edge in pixels (0 for none). |
| `EDGE_COLOR` | `(255, 255, 255)` | Color of that line.                                      |
| `FPS`        | `30`              | Output frame rate.                                       |

## Without the skill

Don’t want to install the skill? Paste this prompt into Claude Code and Claude writes the script itself.

```
Join clipA.mp4 and clipB.mp4 with a 1 second spiral wipe starting 1 second before the end of A, so the output is 11 seconds. Split the 540x960 frame into a grid of 60x60 pixel squares (9 across, 16 down) and number them in a clockwise spiral: left to right along the top row, down the right column, right to left along the bottom row, up the left column, then the next ring in, ending in the center. Numbering squares 0 to 143 and transition frames 0 to 29, square i switches from A to B, with a hard edge, from the first frame where (frame + 1) / 30 > i / 144, so the outer ring is all B by 0.33 seconds and the last center square flips on the final frame. Draw a 3 pixel white (255, 255, 255) line on the B side of every boundary between B and A (any B pixel within 3 pixels of an A pixel, not at the frame's own edges), so the spiral's path stays visible. B plays from its start under the wipe. Decode the last second of A and the first second of B as RGB frames, composite the 30 transition frames with numpy, pipe them into ffmpeg and concatenate A before, the transition, and the rest of B. Crossfade the audio over the same 1 second. Match B's size and frame rate to A (30fps). Don't draw any text (if you ever add some, draw it with Pillow, not ffmpeg's drawtext). Keep the audio and save it as output.mp4.
```

## Run it without Claude

This is the exact script we tested. Save it as `spiral-wipe.py` and run:

```
python3 spiral-wipe.py clipA.mp4 clipB.mp4 output.mp4
```

```
#!/usr/bin/env python3
"""Spiral wipe: clip B fills the frame square by square in a clockwise spiral, from the top-left corner in to the center, over 1s, with a thin white line along its edge. The sound crossfades underneath.

Usage: python3 spiral-wipe.py clipA.mp4 clipB.mp4 output.mp4  (both clips need an audio track)
Needs ffmpeg and numpy (pip install numpy).
"""
import subprocess
import sys

import numpy as np

D = 1.0                    # transition length in seconds
CELL = 60                  # square size in pixels
EDGE = 3                   # width of the line along B's edge in pixels (0 for none)
EDGE_COLOR = (255, 255, 255)
FPS = 30                   # output frame rate

a, b, out = sys.argv[1:4]

def probe(path, entries, stream="-select_streams v:0"):
    cmd = ["ffprobe", "-v", "error", *stream.split(), "-show_entries", entries, "-of", "csv=p=0:s=x", path]
    return subprocess.run(cmd, capture_output=True, text=True, check=True).stdout.strip()

w, h = map(int, probe(a, "stream=width,height").split("x"))
offset = float(probe(a, "format=duration", stream="")) - D
frames = round(D * FPS)
fit = f"scale={w}:{h}:force_original_aspect_ratio=increase,crop={w}:{h},fps={FPS}"

def decode(path, start):
    """D seconds of a clip from `start`, as an array of RGB frames."""
    cmd = ["ffmpeg", "-v", "error", "-ss", str(start), "-i", path, "-vf", fit, "-frames:v", str(frames),
           "-f", "rawvideo", "-pix_fmt", "rgb24", "-"]
    raw = subprocess.run(cmd, capture_output=True, check=True).stdout
    return np.frombuffer(raw, np.uint8).reshape(-1, h, w, 3)

def spiral(cols, rows):
    """Grid cells in clockwise spiral order: along the top, down the right, back along the bottom, up the left, then the next ring in."""
    top, left, bottom, right = 0, 0, rows - 1, cols - 1
    while top <= bottom and left <= right:
        yield from ((top, x) for x in range(left, right + 1))
        yield from ((y, right) for y in range(top + 1, bottom + 1))
        if top < bottom:
            yield from ((bottom, x) for x in range(right - 1, left - 1, -1))
        if left < right:
            yield from ((y, left) for y in range(bottom - 1, top, -1))
        top, left, bottom, right = top + 1, left + 1, bottom - 1, right - 1

# order[y, x] is when that pixel's square turns over to B, from 0 (first) to 1 (last)
cols, rows = -(-w // CELL), -(-h // CELL)
cells = list(spiral(cols, rows))
order = np.zeros((rows, cols))
for i, (y, x) in enumerate(cells):
    order[y, x] = i / len(cells)
order = np.kron(order, np.ones((CELL, CELL)))[:h, :w]

def edge(mask):
    """Pixels of B within EDGE of a pixel still showing A."""
    near_a = np.zeros_like(mask)
    padded = np.pad(mask, EDGE, constant_values=True)
    for dy in range(-EDGE, EDGE + 1):
        for dx in range(-EDGE, EDGE + 1):
            near_a |= ~padded[EDGE + dy:EDGE + dy + h, EDGE + dx:EDGE + dx + w]
    return mask & near_a

# the last D seconds of A with B's opening D seconds coming in through the spiral
a_tail, b_start = decode(a, offset), decode(b, 0)
mid = []
for k in range(frames):
    mask = order < (k + 1) / frames
    frame = np.where(mask[..., None], b_start[k], a_tail[k])
    if EDGE:
        frame[edge(mask)] = EDGE_COLOR
    mid.append(frame.tobytes())

# A up to the transition, the spiral frames, then the rest of B; the audio crossfades over the same D seconds
subprocess.run([
    "ffmpeg", "-y", "-v", "error", "-i", a, "-i", b,
    "-f", "rawvideo", "-pix_fmt", "rgb24", "-s", f"{w}x{h}", "-r", str(FPS), "-i", "-",
    "-filter_complex",
    f"[0:v]{fit},trim=0:{offset},setpts=PTS-STARTPTS,format=yuv420p,setsar=1[head];"
    f"[2:v]format=yuv420p,setsar=1[mid];"
    f"[1:v]{fit},trim={D},setpts=PTS-STARTPTS,format=yuv420p,setsar=1[rest];"
    f"[head][mid][rest]concat=n=3[v];"
    f"[0:a][1:a]acrossfade=d={D}[au]",
    "-map", "[v]", "-map", "[au]", "-c:v", "libx264", "-crf", "18", "-pix_fmt", "yuv420p", "-c:a", "aac", out,
], input=b"".join(mid), check=True)
```

## More transitions

- [Barn door transition **Barn door transition**](https://www.recharm.com/effects/barn-door)
- [Blinds transition **Blinds transition**](https://www.recharm.com/effects/blinds-transition)
- [Block dissolve **Block dissolve**](https://www.recharm.com/effects/block-dissolve)
- [Blur transition **Blur transition**](https://www.recharm.com/effects/blur-transition)
- [Bounce transition **Bounce transition**](https://www.recharm.com/effects/bounce-transition)

## Find 3x _winning ads_

Recharm cuts your ad footage into tagged, searchable clips: hooks, testimonials, product shots. Find the shots that win, add the effect with Claude, and ship 3x more ad edits.

[Start 14-day free trial](https://www.recharm.com/get-started)
