Asciinema v3 .cast file format reference. TRIGGERS - cast format, asciicast spec, event codes, parse cast file.
allowed-tools
Read, Bash
asciinema-cast-format
Reference documentation for the asciinema v3 .cast file format (asciicast v2 specification).
Platform: All platforms (documentation only)
Self-Evolving Skill: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.
[0.5,"o","$ ls -la\r\n"][1.2,"o","total 48\r\n"][1.3,"o","drwxr-xr-x 12 user staff 384 Dec 24 10:00 .\r\n"][5.0,"m","file-listing-complete"][10.5,"r","80x24"]
Timestamp Behavior
Timestamps are relative to recording start (first event is 0.0)
Measured in seconds with millisecond precision
Used for playback timing and navigation
Calculating Absolute Time
/usr/bin/env bash << 'CALC_TIME_EOF'
HEADER_TIMESTAMP=$(head -1 recording.cast | jq -r '.timestamp')
EVENT_OFFSET=1234.5 # From event array
ABSOLUTE=$(echo"$HEADER_TIMESTAMP + $EVENT_OFFSET" | bc)
date -r "$ABSOLUTE"# macOS# date -d "@$ABSOLUTE" # Linux
CALC_TIME_EOF
This strips ANSI codes and produces clean text (typically 950:1 compression).
TodoWrite Task Template
1. [Reference] Identify .cast file to analyze
2. [Header] Extract and display header metadata
3. [Events] Count events by type (o, i, m, r)
4. [Analysis] Extract relevant event data based on user need
5. [Navigation] Find markers or specific timestamps if needed
Markers are optional; not all recordings have them
Wrong version number
Older cast format
This skill covers v2 format (asciinema v3+)
Empty output from tail
File has only header
Recording may be empty or single-line
Post-Execution Reflection
After this skill completes, check before closing:
Did the command succeed? — If not, fix the instruction or error table that caused the failure.
Did parameters or output change? — If the underlying tool's interface drifted, update Usage examples and Parameters table to match.
Was a workaround needed? — If you had to improvise (different flags, extra steps), update this SKILL.md so the next invocation doesn't need the same workaround.
Only update if the issue is real and reproducible — not speculative.