---
title: "How to add a typewriter text with Claude (tested prompt and script)"
description: "A headline types itself out one letter at a time, with a blinking cursor at the end. Install one skill and ask Claude Code, or run the Python script we tested yourself."
url: https://www.recharm.com/effects/typewriter-text
---

# How to add a typewriter text with Claude

A headline types itself out one letter at a time, with a blinking cursor at the end.

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

## 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

   ```
   Add a typewriter text to input.mp4
   Text: 3 reasons this serum sold out
   ```

## 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.

Add a typewriter text to **@clip1.mp4**, put a sale badge on **@clip2.mp4**, give **@clip3.mp4** a VHS look, then join all three with crossfades.

## 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                 |
| ------- | ------------------------------- | ---------------------------- |
| `TEXT`  | `3 reasons this serum sold out` | What gets typed.             |
| `CPS`   | `14`                            | Characters typed per second. |
| `START` | `0.3`                           | Second the typing starts.    |

## In other editors

From each editor’s own help pages, in our words. We haven’t run these ourselves.

Built in: **Typewriter text animation** · desktop

1. Import the video, then go to Text > Add text > Default text.
2. Type or paste your headline.
3. Click Animation in the basic editing section and select Typewriter.

Source: [Make Your Content Shine with Typewriter Effects | Captivate Your Audience](https://www.capcut.com/resource/typewriter-effects) (CapCut), checked October 22, 2026.

## Without the skill

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

```
Add a typewriter text effect to input.mp4: the line "3 reasons this serum sold out" types out from 0.3 seconds at 14 characters per second, white bold text with a black outline, left-aligned near the top, with a blinking cursor after the last letter. Use Python with Pillow to draw it and ffmpeg to put it on the video (don't rely on ffmpeg's drawtext filter), keep the audio, and save it as output.mp4.
```

## Run it without Claude

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

```
python3 typewriter-text.py input.mp4 output.mp4
```

```
#!/usr/bin/env python3
"""Typewriter text: a line of text types itself out letter by letter, with a cursor at the end.

Usage: python3 typewriter-text.py input.mp4 output.mp4
Needs ffmpeg and Pillow (pip install pillow).
"""
import json
import math
import subprocess
import sys
from pathlib import Path

from PIL import Image, ImageDraw, ImageFont

TEXT = "3 reasons this serum sold out"
START = 0.3      # second the typing starts
CPS = 14         # characters typed per second
SIZE = 0.075     # text height as a share of the frame width
TOP = 0.12       # top of the text block (0 = top of the frame)
MARGIN = 0.08    # left and right margin, as a share of the frame width
FONTS = ["/System/Library/Fonts/Supplemental/Arial Bold.ttf",     # macOS
         "/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf",  # Linux
         "C:/Windows/Fonts/arialbd.ttf"]                          # Windows
FONT_FILE = next((f for f in FONTS if Path(f).exists()), None) or sys.exit("No bold font found: add one to FONTS")

def wrap(text, font, width):
    """Split text into lines that fit, decided once for the whole text so lines don't jump while typing."""
    lines, line = [], ""
    for word in text.split():
        trial = f"{line} {word}".strip()
        if font.getlength(trial) <= width or not line:
            line = trial
        else:
            lines.append(line)
            line = word
    return lines + [line]

def overlay(t):
    img = Image.new("RGBA", (w, h))
    draw = ImageDraw.Draw(img)
    shown = max(0, int((t - START) * CPS))
    y = h * TOP
    for line in lines:
        part = line[:max(shown, 0)]  # lines not reached yet stay empty
        shown -= len(line) + 1
        draw.text((w * MARGIN, y), part, font=font, fill="white", stroke_width=round(w * 0.008), stroke_fill="black")
        if 0 >= shown > -len(line) - 1 and int(t * 2) % 2 == 0 and t >= START:  # blinking cursor after the last letter
            x = w * MARGIN + font.getlength(part) + 4
            draw.rectangle([x, y + font.size * 0.1, x + font.size * 0.12, y + font.size * 1.05], fill="white")
        y += font.size * 1.25
    return img

def probe(path):
    info = json.loads(subprocess.check_output(["ffprobe", "-v", "error", "-select_streams", "v:0", "-show_entries",
                                               "stream=width,height,r_frame_rate:format=duration", "-of", "json", path]))
    s = info["streams"][0]
    num, den = s["r_frame_rate"].split("/")
    return s["width"], s["height"], s["r_frame_rate"], float(num) / float(den), float(info["format"]["duration"])

def render(src, out):
    """Draw overlay(t) on every frame of src and save to out, keeping the audio."""
    ff = subprocess.Popen(["ffmpeg", "-y", "-v", "error", "-i", src,
                           "-f", "rawvideo", "-pix_fmt", "rgba", "-s", f"{w}x{h}", "-r", rate, "-i", "-",
                           "-filter_complex", "[0:v][1:v]overlay=shortest=1,format=yuv420p[v]",
                           "-map", "[v]", "-map", "0:a?", "-c:v", "libx264", "-crf", "18", "-c:a", "copy", out],
                          stdin=subprocess.PIPE)
    for i in range(math.ceil(duration * fps)):
        ff.stdin.write(overlay(i / fps).tobytes())
    ff.stdin.close()
    if ff.wait():
        sys.exit("ffmpeg failed")

src, out = sys.argv[1:3]
w, h, rate, fps, duration = probe(src)
font = ImageFont.truetype(FONT_FILE, round(w * SIZE))
lines = wrap(TEXT, font, w * (1 - 2 * MARGIN))
render(src, out)
```

## More captions and text

- [AI chat reply animation **AI chat reply animation**](https://www.recharm.com/effects/ai-chat-typing)
- [Animated bar chart **Animated bar chart**](https://www.recharm.com/effects/animated-bar-chart)
- [Animated checklist **Animated checklist**](https://www.recharm.com/effects/animated-checklist)
- [Animated line graph **Animated line graph**](https://www.recharm.com/effects/animated-line-graph)
- [Animated pie chart **Animated pie chart**](https://www.recharm.com/effects/animated-pie-chart)

## 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)
