Open History to see the last commit
1# Product analytics
2
3T3 Code sends anonymous product events from the server to PostHog. The server
4uses the first available hashed Codex account ID, hashed Claude user ID, or
5installation-scoped anonymous ID as the distinct ID. It also keeps the
6telemetry opt-out, event buffer, and batch delivery. Clients do not load the
7PostHog browser SDK.
8
9## Client events
10
11These events use the metadata from the WebSocket connection that caused them.
12The metadata is not a person property or server-global current-client value.
13Two clients connected to one server can report different values at the same
14time.
15
16| Event | Description |
17| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
18| `client.connected` | The server accepted an authenticated WebSocket connection. Reconnects count again. Use this event for connection diagnostics, not active-use counts. |
19| `client.thread.started` | The server accepted a command that created a thread. |
20| `client.turn.requested` | The server accepted a turn request. This is the standard active-use event. |
21
22`provider.turn.sent` stays a provider execution event. It does not receive
23client metadata because a provider turn can continue after the requesting
24client disconnects.
25
26## Recommended properties
27
28Client properties appear on the three client events when the connected client
29reports them. Older clients can omit every client property.
30
31| Property | Values and meaning |
32| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
33| `surface` | Product client: `web`, `desktop`, or `mobile`. |
34| `webDeployment` | Web delivery: `hosted` for the hosted app or `server` for web files served by a T3 server. Web only. This does not describe connection distance. |
35| `clientOs` | `macOS`, `Windows`, `Linux`, `iOS`, `Android`, `ChromeOS`, `other`, or `unknown`. |
36| `clientDeviceType` | `desktop`, `phone`, `tablet`, or `unknown`. This is separate from `surface`. |
37| `clientBrowser` | Normalized browser family. Web only. Browser detection is best effort. |
38| `clientAppVersion` | Version of the connected client. |
39| `clientOsMajorVersion` | Client OS major version when the native client reports it. Initially mobile only. |
40| `clientDeviceModel` | Hardware model when the native client reports it. Initially mobile only. This is not a user-assigned device name. |
41| `connectionMethod` | `direct`, `ssh`, `relay`, or `unknown`. `direct` means that the client connected to the server endpoint without an SSH or relay connection. It does not mean both processes run on one machine. |
42
43Server properties appear on all events, including server boot and background
44events.
45
46| Property | Values and meaning |
47| ------------------ | -------------------------------------------------------------- |
48| `serverOs` | Server process OS, normalized to the same names as `clientOs`. |
49| `serverArch` | Server process architecture. |
50| `serverWslDistro` | WSL distribution from `WSL_DISTRO_NAME`, when present. |
51| `serverAppVersion` | T3 server version. |
52| `serverMode` | Server runtime mode: `desktop` or `web`. |
53
54## Legacy properties
55
56Existing property meanings do not change:
57
58- `clientType` describes how the server runs. It is `desktop-app` for a desktop
59 server and `cli-web-client` for a CLI web server. It does not describe the
60 connected client. Use `surface` and `webDeployment` for new reports.
61- `platform`, `arch`, `wsl`, and `t3CodeVersion` describe the server. Use the
62 new `server*` names for new reports.
63- `appVersion` describes the connected client. Use `clientAppVersion` for new
64 reports.
65- Mobile connection events keep `os`, `osMajorVersion`, and `deviceModel`.
66 Use the new `client*` names for new reports.
67
68## PostHog dashboard
69
70Create one saved dashboard named `Client and platform usage`. Set
71`client.turn.requested` as the event for active-use reports. A user can appear
72in several client groups during one period, so do not add breakdown values to
73calculate a total.
74
75Save these insights:
76
77| Insight | Configuration |
78| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
79| Active users, daily | Trends, `client.turn.requested`, unique users, daily interval. |
80| Active users, weekly | Trends, `client.turn.requested`, unique users, weekly interval. |
81| Active users, monthly | Trends, `client.turn.requested`, unique users, monthly interval. |
82| Client usage | Trends, `client.turn.requested`, unique users. Save four filtered series: `surface = desktop`, `surface = mobile`, `surface = web` and `webDeployment = hosted`, and `surface = web` and `webDeployment = server`. Name them Desktop, Native mobile, Hosted web, and Server-served web. |
83| Client OS, active users | Trends, `client.turn.requested`, unique users, breakdown by `clientOs`. |
84| Client OS, turns | Trends, `client.turn.requested`, total events, breakdown by `clientOs`. |
85| Client versus server OS | Table, `client.turn.requested`, breakdown by `clientOs` and `serverOs`. |
86| Connection method, active users | Trends, `client.turn.requested`, unique users, breakdown by `connectionMethod`. |
87| Connection method, turns | Trends, `client.turn.requested`, total events, breakdown by `connectionMethod`. |
88| Mobile devices | Table, `client.turn.requested`, filter `surface = mobile`, breakdown by `clientOs`, `clientOsMajorVersion`, and `clientDeviceType`. |
89| Client version adoption | Trends, `client.turn.requested`, unique users, breakdown by `clientAppVersion`. |
90| Server version adoption | Trends, `client.turn.requested`, unique users, breakdown by `serverAppVersion`. |
91| Missing metadata | Table or SQL insight that shows the percentage of `client.turn.requested` events where each of `surface`, `clientOs`, `clientDeviceType`, `clientAppVersion`, and `connectionMethod` is absent. Track `webDeployment` and `clientBrowser` only within `surface = web`. |
92
93In PostHog Data management, use the event and property descriptions from this
94document. Mark the recommended properties as verified. Keep `clientType`
95visible with its legacy description so old reports remain understandable.
96
97## Collection and release boundary
98
99Client values are best effort. Invalid values are ignored and never reject a
100connection. Browser clients use user-agent data for broad OS, browser, phone,
101and tablet groups. They do not infer CPU architecture or an exact OS version
102from `navigator.platform`.
103
104This change does not collect URLs, tokens, prompts, IP addresses, or
105user-assigned device names. It measures authenticated product use. It does not
106measure a person who visits the hosted app without connecting to a server.
107
108The new fields start with the first client and server release that contains
109this metadata path. Historical events cannot reliably identify the client OS,
110hosted web use, device type, or connection method when the old client did not
111send those fields. Reports must treat missing values as pre-release or older
112client data instead of backfilling them from server fields.