subtext_url, opens that person’s real session, and walks the decisive moments with screenshots, the component tree, network, and console. Statsig detects; Subtext diagnoses.
This guide assumes the Subtext capture snippet is installed and capturing sessions, and the Statsig JS client (
@statsig/js-client) is initialized.Attach the session URL
Store the current Subtext session URL on your Statsig user object so it travels with the signal. There are two places to attach it, depending on how precise the link needs to be.On the user object
Attach the URL to the Statsig user’scustom field via updateUserAsync. Custom fields ride along on every subsequent exposure and logEvent call, so they show up in the logs that back your experiments. Call it wherever your app already identifies the user — on auth resolution, not at module top level.
On a specific event
When the exact moment matters, pass the URL directly on a singlelogEvent call. url.now carries a timestamp, so the link opens the replay at that instant — ideal for high-signal events like errors and conversion failures.
From signal to session
However you first hear about a problem in Statsig, the path is the same: get to thesubtext_url, then hand it to your agent for a Detect-vs-Diagnose read. The scorecard says the variant regressed; the session shows whether the new feature rendered correctly, errored, or simply confused people.
A guardrail or metric-drop Slack alert
A guardrail or metric-drop Slack alert
Statsig posts to Slack: “⚠️ Guardrail
checkout_error_rate triggered on experiment new-cart-v2, treatment group.”Open the experiment and drill into the affected treatment users via Pulse / the Users tab. Inspect a recent exposure for one of them and copy subtext_url from the custom fields. Grab a few, then hand them to your agent:An experiment readout meeting
An experiment readout meeting
In the weekly experiment review, a variant’s scorecard is red on a key metric and someone asks “but why?”In the Statsig Console, open the Users tab, enter a
userID from the regressed cohort, and read custom.subtext_url off the most recent exposure.A single suspicious exposure
A single suspicious exposure
You spot one user in the Events Explorer who got the treatment and had a clearly bad outcome.Open that log line and copy
subtext_url from the user custom fields or the event metadata.For agents
An autonomous agent can run the whole loop against Statsig: discover the regressed variant, extract thesubtext_url, and hand each session to the Subtext MCP. Statsig ships an official MCP server at https://api.statsig.com/v1/mcp (remote, HTTP), authenticated with a statsig-api-key header (a Console API key — read keys get read tools) or OAuth. Its tools front the Console API (experiments, gates, dynamic configs, layers, metrics, segments, autotunes), for example Get_List_of_Experiments and Get_Experiment_Details_by_ID. Docs: docs.statsig.com/integrations/mcp.
For this workflow the MCP is discovery-only: no MCP tool returns exposure records or the user
custom fields where subtext_url is stored, and no documented Console-API endpoint returns a single exposure record by ID with its custom field — that value lives in the warehouse, not the Console API. Extraction is warehouse- or webhook-based (see step 2); the warehouse route requires Statsig’s Enterprise tier — non-Enterprise projects must use the Event Webhook.1
Discover the regressed variant
Use the MCP tools (Near-real-time affected-user and event signals come from the Event Webhook, which forwards exposure, gate, and experiment events to your endpoint.
Get_List_of_Experiments, Get_Experiment_Details_by_ID) or the Console API directly — base https://statsigapi.net/console/v1, header STATSIG-API-KEY, version 20240601:2
Extract the session URL
Read The JSON-extraction syntax varies by warehouse — e.g.
subtext_url from the warehouse exposures table (best fit) — e.g. experimentation.statsig.exposures. This table only exists with warehouse access to exposures, which is Enterprise-tier on Statsig: Data Warehouse Exports are Enterprise-only, and Warehouse Native is likewise part of the Enterprise tier. On Developer or Pro plans, capture subtext_url via the Event Webhook instead. The user_dimensions column is JSON of the user’s attributes at first exposure:Databricks
JSON_VALUE(user_dimensions, '$.subtext_url') on BigQuery, PARSE_JSON(user_dimensions):subtext_url on Snowflake, JSON_EXTRACT_PATH_TEXT(user_dimensions, 'subtext_url') on Redshift.If you logged subtext_url on a custom event instead, it lands in that event’s metadata.3
Hand off to Subtext
For each URL, call
review-open(session_url=<subtext_url>) on the Subtext MCP. Event-level URLs are moment-precise, so the review opens exactly when the signal fired.subtext_url only round-trips if it was emitted into the exposure stream (as a user attribute) or onto a custom event at instrumentation time (see Attach the session URL). Event-level links are moment-precise; user- and exposure-level links open at session start.Related
- Session Review overview — what your agent does once a session is open.
- Install the capture snippet — required before any session URL exists to attach.

