Skip to content
Back to skills

Vhs

ASecurity

Techniques for creating deterministic terminal demo screencasts with VHS

  • 11 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 6, 2026
toolsbashdebugginggit

Works with

  • terminal

Security analysis

A100/100

Scanned October 6, 2026

npx -y skills add juspay/skills --skill vhs --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Vhs?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Vhs
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/juspay-vhs/badge)](https://www.skillsdirectory.com/skills/juspay-vhs)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: vhs
description: Techniques for creating deterministic terminal demo screencasts with VHS
---

# VHS Demo Recording

[VHS](https://github.com/charmbracelet/vhs) records terminal sessions by scripting keystrokes in `.tape` files and rendering them as GIFs. Use `Wait+Screen /regex/` to synchronize with interactive TUI elements instead of fragile fixed `Sleep` durations. VHS can only detect text *appearing* on screen, not disappearing — keep this constraint in mind when designing wait conditions.

## Non-Deterministic TUI Responses

When recording an LLM-powered TUI, detecting when a response is **complete** requires special care. Naive approaches all fail:

| Approach | Why it fails |
|---|---|
| Fixed `Sleep` | Not deterministic |
| Unique marker in prompt (`XYZENDXYZ`) | Appears in the typed prompt on screen — `Wait+Screen` matches immediately |
| Math formula (`347+829` → wait for `1176`) | LLM computes the answer in its visible *thinking trace* before the response finishes |
| `Wait+Line /^MARKER$/` | TUI padding/borders prevent exact line matching |
| `Hide` + type marker | `Hide` only hides VHS command log, not terminal content |

### The concatenation trick

Ask the LLM to **concatenate two words** and print the result. The prompt contains both words *separately* but never the combined string:

```tape
Type "briefly explain this repo. Then print ALFA concatenated with BRAVO."
Enter
Wait+Screen /ALFABRAVO/
```

**Why it works:**
1. **Typed prompt** shows `...ALFA concatenated with BRAVO` — no `ALFABRAVO`
2. **Thinking trace** says "I need to concatenate ALFA and BRAVO" — no `ALFABRAVO`
3. **Response** outputs `ALFABRAVO` — the only match

Use uncommon words (ALFA, BRAVO, ZULU) so the combined form can't appear accidentally.

## Tips

- **Run VHS from the correct CWD** — it inherits the working directory. If the prompt references "this repo", the CWD must be the repo root, not a subdirectory.
- **Inspect GIF frames** when debugging timing issues:
  ```bash
  ffmpeg -i demo.gif -vf "select='eq(n\,100)'" -vsync vfr /tmp/frame.png
  ```

## Nix Integration

- If the project uses Nix, create a dedicated `flake.nix` for the demo (e.g., `doc/demo/flake.nix`) so anyone can reproduce the recording with `nix run`.
- **Reference tape by Nix store path** in flake apps (`vhs "${./.}/demo.tape"`) — don't `cd` into the store, as it may contain a `flake.nix` that confuses `nix run` inside the recording.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…