Record and replay

For AI agents: this page is Markdown at https://squiggle.sh/docs/replay.md. Every docs page is listed at https://squiggle.sh/llms.txt, and all of them are one file at https://squiggle.sh/llms-full.txt.

A recording keeps everything your app did during a session: renders, screens, store changes, requests, errors and metrics. Replay it later and the Inspector, Performance and Analytics screens all work on it as if the app were running.

Loading the live Studio…
A recorded session, on one timeline. Live, in your browser.Open in Studio

Replay an incidentStudio tour · 9 steps

Record a session

In Studio, press Record session in the device panel’s Capture menu; for a React web app, choose its tab first (see React web apps). From the terminal:

Terminal
squiggle record                          # until you press Ctrl-Csquiggle record checkout --duration 60   # named, for 60 secondssquiggle record -o ./repro.sqrec         # to a file of your choice

Recordings are .sqrec files in .squiggle/recordings/. They aren’t videos: they hold what the app did, so they stay small and every tool can read them. squiggle record works while Studio is open. When an agent runs a program, a recording starts on its own, so a failure already comes with its replay.

Replay it in Studio

Open a recording on the Replay screen. You get a timeline to scrub, play at ×1, ×2, ×4 or as fast as possible, with markers where the screen changed. Under the timeline, a lane for each metric the recording has (renders per second, CPU, memory, frame rate, event-loop lag) shows its value at the playhead. Beside it, a list of events (screen changes, taps, errors, logs, requests, long tasks) highlights where you are; click one to jump there.

Click a component in the graph to see, at that moment, how often it had rendered, why it last rendered, and which props, state or context keys changed. A recording keeps which keys changed, not their values.

The recording’s name at the top opens another one. For an incident that happened more than once, the menu lists its repeats first, under This incident · N times, then Recent; All recordings goes back to the list.

Drive the device along with it

Turn on Drive device, at the end of the transport, and the app on the simulator follows the playhead, doing what the recording did: taps, double taps and long presses, swipes, drags that turn back on the way, and react-native-gesture-handler pinches with their scale. It waits for each screen the recording reached rather than tapping its way there, and typing isn’t in a recording, so it isn’t repeated. A line beside the switch says where the device stands. When the device can’t get to the playhead by going forward, because it is ahead of it, on a screen the recording doesn’t reach, or stopped at a step that didn’t land, Resync appears: it relaunches the app and replays the recording up to the playhead.

Share and follow up

  • The Performance and Analytics buttons on the Replay screen open the run the recording was made in. The Performance timeline moves with the replay’s playhead.
  • Copy report copies the cause, the stack, the numbers and the steps that led there as Markdown, ready for a ticket.
  • Make flow turns the taps and screen changes into a draft flow in incidents/. Add the assert that should hold, and the bug has a test.

Replay from the terminal

Terminal
squiggle replay                          # list recordingssquiggle replay checkout                 # replay onesquiggle replay checkout --speed 2

There is no device to wait for, so a replay runs as fast as possible unless you set --speed.

More

To turn a recording into a flow from the terminal, see Record and crawl.