Incident capture
For AI agents: this page is Markdown at https://squiggle.sh/docs/replay/incidents.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.
The recording you need most is the one nobody started. While your app is connected, Studio keeps its last five seconds in memory, and when something goes wrong it saves them, plus two seconds after, as a recording.
What Studio saves
An incident is an ordinary recording that opens on the seconds before the problem. It holds everything the app recorded, plus Studio’s own measurements: CPU, memory, threads, GPU and frame timing. Keeping the five seconds costs almost nothing; no video is recorded.
What counts as an incident
| Kind | When |
|---|---|
| Crash | The app’s connection closed and the simulator wrote a new crash report. A relaunch or a Metro reload isn’t a crash. |
| Error | A thrown JS error, an unhandled promise rejection, or an error boundary catching one. |
| Stall | The app’s main thread stopped responding. |
| Slowdown | A JS task of a second or more, event-loop lag of 500 ms or more, or frames taking 100 ms or more (95th percentile). |
| Spike | CPU or GPU at 95% or more for two samples in a row, memory or the JS heap jumping within ten seconds, or critical memory pressure. |
Each kind waits 30 seconds before it can fire again, and a second problem during a capture joins it instead of saving a second file. Spikes are ignored for the first 20 seconds after Studio connects, while its own measuring starts up.
Read an incident
Studio shows a notification with Open in Replay. The incident opens on a report: what set it off and the stack, the window’s peak CPU and GPU, how memory moved, the lowest frame rate and the worst lag, the longest JS task, and the errors. Values past a limit are marked, and a value the recording doesn’t have is left out rather than shown as 0. Beside it is the screen at the moment it happened. A crash has no screenshot, because the app is already gone.
Jump to incident moves the playhead to the moment it happened. Incidents that repeat are grouped into one entry, with a count and when each was first and last seen.
Where they go
Files are saved as .squiggle/recordings/incident_<kind>_<time>.sqrec, listed in History, and kept when old performance data is cleaned up. You can also list them from the terminal:
squiggle perf sql "select kind, title, datetime(triggered_wall / 1000, 'unixepoch') as at, path from incidents order by triggered_wall desc limit 10"