Product telemetry¶
agent-strace can send anonymous product usage events to a PostHog project owned
by the project maintainer. This is separate from agent tracing. The CLI client
never reads .agent-traces/; the editor extension sends only session success,
duration, and aggregate tool/error counts from the state it already maintains.
Neither client sends trace contents.
Telemetry is enabled by default on configured CLI and editor-extension builds. Each surface shows a one-time, non-blocking disclosure, and sends events only after that notice has been shown or telemetry was explicitly enabled. The CLI notice appears either on stderr during the first interactive command or, for hooks-only installs, inside the agent's own UI at session start where the agent can show it; see When sending starts. CI, test runs and temporary home directories remain disabled by default to avoid throwaway installation identifiers; see Throwaway environments.
When sending starts¶
The CLI shows its notice once per installation, in the first of these places that reaches a person. From then on, both CLI commands and hooks send events.
| Where | When the notice appears |
|---|---|
Interactive agent-strace command |
On stderr, before the first interactive command. Piped or scripted runs never show it. |
Claude Code hooks (plugin or setup --cli claude) |
As a hook message at the start of an interactive claude terminal session. Session events are sent from that session's end onward. Other entry points, such as claude -p and the Agent SDK, never show it. |
| Gemini CLI hooks | As a hook message at session start: in the terminal UI, or on stderr for gemini -p. Session events are sent from that session's end onward. |
| Codex hooks | As a warning: line at the start of an interactive session. codex exec never shows it. On Codex versions that run the SessionEnd hook, session events are sent from that session's end onward. Codex 0.143.0 ignores SessionEnd. Installs made before setup registered SessionEnd send none until you run agent-strace setup --cli codex again and trust the new hook in /hooks. The notice still enables later agent-strace commands. |
| Cursor and GitHub Copilot CLI hooks | Never: their session-start hooks have no output the user sees. These installs send nothing until one of the places above shows the notice, agent-strace telemetry enable is run, or AGENT_STRACE_TELEMETRY=1 is set. |
The hook message reads:
agent-strace: Anonymous product telemetry is enabled by default. No prompts, arguments, paths, repository data, or trace contents are sent. Disable at any time with: agent-strace telemetry disable
It uses each agent's display-only systemMessage field, so it is not added to
the model's context. A hook marks the notice as shown only after writing it for
a session that displays it, and only one of several hooks starting at once
shows it. No notice is shown, and nothing is sent, when DO_NOT_TRACK=1 or
AGENT_STRACE_TELEMETRY=0 is set, after agent-strace telemetry disable, or
in CI or another throwaway environment.
User controls¶
agent-strace telemetry status
agent-strace telemetry enable
agent-strace telemetry disable
# Environment-level overrides
DO_NOT_TRACK=1 agent-strace list
AGENT_STRACE_TELEMETRY=0 agent-strace list
AGENT_STRACE_TELEMETRY=1 agent-strace list
An unset preference means telemetry is enabled, waiting for the one-time notice;
agent-strace telemetry status says when it is still waiting. A random
installation ID is created on the first event that is sent and stored in
~/.agent-strace/telemetry.json
(mode 0600; updates are locked and atomic, see Security).
agent-strace telemetry disable persists the opt-out and deletes the
identifier and the current analytics session. DO_NOT_TRACK=1 and AGENT_STRACE_TELEMETRY=0 disable telemetry
without changing the stored preference. CI and other
throwaway environments are disabled by default;
AGENT_STRACE_TELEMETRY=1 is required to enable them there.
The VS Code/Open VSX extension has its own application-scoped preference:
- Set
agentTrace.telemetry.enabledtofalse, or run agent-trace: Disable Product Telemetry from the Command Palette. - Run agent-trace: Enable Product Telemetry to re-enable it.
- VS Code's editor-wide telemetry switch,
DO_NOT_TRACK=1, andAGENT_STRACE_TELEMETRY=0also disable extension events.
Like the CLI, the extension sends nothing until its own notice has been shown,
or until telemetry was explicitly enabled with the setting, the enable command,
or AGENT_STRACE_TELEMETRY=1.
The extension stores a separate random ID in VS Code global state and deletes it, along with its in-memory analytics session, when disabled. CLI and extension preferences are separate; environment-level opt-outs apply to both when inherited by the editor extension host.
Throwaway environments¶
Every fresh home directory gets a new installation ID, so test suites, sandboxes and short-lived containers would otherwise look like new users. The CLI therefore sends nothing, and shows neither the notice nor the research invite, when any of these hold:
- A CI variable is set:
CI,CONTINUOUS_INTEGRATION,GITHUB_ACTIONS,GITLAB_CI,BUILDKITE,JENKINS_URL,TF_BUILD,CIRCLECI,TRAVIS,APPVEYOR,BITBUCKET_BUILD_NUMBER,CODEBUILD_BUILD_ID,TEAMCITY_VERSION,DRONE,SEMAPHORE,CIRRUS_CI,BITRISE_IO,BUDDY_WORKSPACE_ID,HEROKU_TEST_RUN_IDorCF_BUILD_ID. Any non-empty value counts,CI=falseincluded. PYTEST_CURRENT_TESTis set.- The home directory resolves to, or inside,
TMPDIR,TEMPorTMP, or (on Linux and macOS)/tmpor/var/tmp. Relative paths and a temp variable that names a filesystem root are ignored.
This applies even after agent-strace telemetry enable; only
AGENT_STRACE_TELEMETRY=1 sends events from these environments.
agent-strace telemetry status names the reason as CI default or
test or temporary HOME default. Events sent with the override carry
ci: true or ephemeral: true, so reports can leave them out.
Research invite¶
After the first review, share, or cognitive-debt run in a terminal, the
CLI prints one line on stderr that links the
use-case poll:
agent-strace: how do you use review, share or cognitive-debt? Tell us in the use-case poll: https://github.com/Siddhant-K-code/agent-trace/discussions/556 (shown once)
- It appears after the command finishes, whatever its exit code, and only when both stdout and stderr are terminals. Piped, redirected, or scripted runs, other commands, and hooks never show it. It never goes to stdout.
- It is shown once.
"research_invite_shown": truein~/.agent-strace/telemetry.json(or the fileAGENT_STRACE_TELEMETRY_CONFIGnames) records it. The flag is written before the line is printed; if the file cannot be written, the invite is not shown. Turning telemetry off and on again keeps the flag, andagent-strace telemetry statussays whether the invite was shown. - It is never shown in CI or another
throwaway environment, even with
AGENT_STRACE_TELEMETRY=1, whenDO_NOT_TRACK=1orAGENT_STRACE_TELEMETRY=0is set, or afteragent-strace telemetry disable. - It sends nothing and adds no event or field. Answering the poll is optional.
- It is separate from the telemetry notice: a first
interactive
reviewcan show the notice before the command and the invite after it.
Collected fields¶
The CLI emits three events:
| Event | Event-specific fields |
|---|---|
agent_strace_cli_command_completed |
command, subcommand, success, exit code, duration, error type, integration, export format/backend |
agent_strace_session_completed |
provider, capture method, success, duration when known |
agent_strace_telemetry_enabled |
explicit enablement source |
Every event also includes the anonymous installation ID, a random
analytics session ID, telemetry schema version,
agent-strace version, Python major/minor version, OS family, a ci boolean,
and an ephemeral boolean. ephemeral is true only when a test run or
temporary home directory opted in with AGENT_STRACE_TELEMETRY=1; see
Throwaway environments.
The agent_strace_session_completed duration covers the latest run of the
agent session: from the last resume, or from the start if it was never
resumed. Resuming an agent session keeps its trace, so the trace's own
duration still spans every run and the idle time between them. Earlier
releases sent that whole span, which made long-lived, often-resumed
sessions (common with GitHub Copilot CLI) report durations of days.
The editor extension emits five events:
| Event | Event-specific fields |
|---|---|
agent_strace_vscode_extension_activated |
none |
agent_strace_vscode_command_completed |
fixed command name, success, duration, error type |
agent_strace_vscode_session_started |
none |
agent_strace_vscode_session_completed |
success, duration, aggregate tool-call count, aggregate error count |
agent_strace_vscode_telemetry_enabled |
enablement source |
Extension events also include the random extension installation ID, a random analytics session ID, schema and extension versions, editor family/version, desktop/web UI kind, remote boolean, and OS family.
The schema does not accept prompts, responses, command arguments, file paths, repository names or hashes, usernames, hostnames, endpoints, trace contents, trace or agent session IDs, model input/output, exception messages, or stack traces. PostHog person-profile processing and GeoIP enrichment are disabled for every event. Like any direct HTTPS destination, PostHog still receives the network request under its own infrastructure and privacy terms.
Analytics sessions¶
PostHog's server-side SDKs send no $session_id, so without one every event
stands alone and PostHog's session aggregations are empty. Each client
therefore adds its own random
$session_id
that groups one stretch of use:
- agent-strace uses a fresh UUIDv7 and follows PostHog's custom session ID requirements. The UUIDv7's embedded time is the session's start, which is never later than the session's first event.
- A new session starts after 30 minutes without an event, or 24 hours after the session started, matching how PostHog defines a session. A new session also starts if the clock moves back before the last event or the stored session is malformed. A session is never reused after it ends.
- The CLI keeps the current session in
~/.agent-strace/telemetry.json(analytics_session_idandanalytics_session_last_event_ms), so CLI commands and agent hooks running in separate processes share it. - The extension keeps its session in memory, so each editor window has its own, and a restarted window starts a new one.
- It is random. It is never derived from, and never equals, a trace session ID
or an agent's session ID, so it cannot link an event to a recorded trace.
The CLI drops any
$session_idorsession_idpassed as an event property. - Disabling telemetry deletes it with the installation ID.
Maintainer setup¶
No database or deployed service is required. Use a managed PostHog project:
- Create a PostHog Cloud project and choose the US or EU region.
- Open Project settings and copy the Project token. This is the public event-ingestion token, not a personal API key.
- Set the public project token and regional host in
src/agent_trace/telemetry.py. Set the same values invscode-extension/src/telemetry.tsfor extension releases.
DEFAULT_POSTHOG_PROJECT_TOKEN = "phc_your_project_token"
DEFAULT_POSTHOG_HOST = "https://us.i.posthog.com" # or https://eu.i.posthog.com
const POSTHOG_PROJECT_TOKEN = "phc_your_project_token";
const POSTHOG_HOST = "https://us.i.posthog.com";
- Verify locally without editing the constants first. Run these in an
interactive terminal:
listshows the one-time notice and then sends its event, while a piped or scripted run sends nothing until the notice has been shown.
export AGENT_STRACE_TELEMETRY_TOKEN="phc_your_project_token"
export AGENT_STRACE_TELEMETRY_HOST="https://us.i.posthog.com"
export AGENT_STRACE_TELEMETRY_CONFIG="$(mktemp)"
agent-strace list
agent-strace telemetry status
agent-strace telemetry disable
- In PostHog's live events view, confirm that
agent_strace_cli_command_completedarrived and contains only the documented properties. Runningagent-strace telemetry enableexplicitly also sendsagent_strace_telemetry_enabled. - Install a development VSIX, activate a workspace containing
.agent-traces/, and confirmagent_strace_vscode_extension_activatedarrives. Exercise one extension command and verify only allow-listed properties are present. - Commit the public project token and publish the release. End users do not set a token; it is part of the distributed package.
AGENT_STRACE_TELEMETRY_TOKEN, AGENT_STRACE_TELEMETRY_HOST, and
AGENT_STRACE_TELEMETRY_CONFIG are intended for development, downstream
distributions, and tests. Network delivery uses a 0.5-second timeout and is
best-effort; failures never change CLI behavior or exit status. The extension
also uses a 0.5-second timeout, keeps no on-disk queue, and never changes editor
behavior when delivery fails.
Real installs¶
Raw installation counts are mostly noise. Every fresh home directory gets a new
ID, and releases before 0.113.0, the first to ship tests/_no_telemetry.py
(#419), still send
events from their own test suites. Product questions should use real installs
instead.
An installation counts as a real install when it sent
agent_strace_cli_command_completed or agent_strace_session_completed
events that meet all of these on at least 2 distinct days in the last 30
(project time zone):
ciisfalse;ephemeralis nottrue;agent_strace_versionis 0.113.0 or later, compared numerically on (major, minor), so 0.99 sorts below 0.113.
The filters apply to each event before active days are counted, so an installation that upgraded to 0.113.0 counts once it has 2 days on 0.113.0 or later.
Why there is no PostHog cohort¶
PostHog cohorts are built from person profiles, and every agent-strace event is sent with person processing disabled (ADR-0014), so the project has no persons to put in a cohort. Each insight applies this HogQL property filter instead. Paste it as a HogQL expression filter to limit any insight to real installs:
distinct_id IN (
SELECT distinct_id FROM events
WHERE timestamp > now() - INTERVAL 30 DAY
AND event IN ('agent_strace_cli_command_completed', 'agent_strace_session_completed')
AND properties.ci = false
AND coalesce(toString(properties.ephemeral), '') != 'true'
AND (toIntOrZero(splitByChar('.', coalesce(properties.agent_strace_version, ''))[1]),
toIntOrZero(splitByChar('.', coalesce(properties.agent_strace_version, ''))[2])) >= (0, 113)
GROUP BY distinct_id
HAVING uniq(toDate(timestamp)) >= 2
)
Filter audit¶
To see what each filter removes, add the event filters one at a time and count the installations still active on 2 or more days after each step:
- Any CLI or session event in the last 30 days.
- Active on 2 or more days.
- And
ci = false. - And not
ephemeral. - And agent-strace 0.113.0 or later.
The CLI sends nothing from CI or throwaway environments unless
AGENT_STRACE_TELEMETRY=1 is set, so the ci and ephemeral steps guard
against opted-in runs and can drop nothing. The version step removes older
releases that still send events from their own test suites, the pattern of
test runs before #419. The filter audit tile computes these steps live.
Real-installs dashboard¶
The maintainer's PostHog project has an agent-strace real installs dashboard. Every tile except the last uses the filter above:
| Tile | What it shows |
|---|---|
| Real installs (last 30 days) | The cohort size. |
| Filter audit | The steps above, computed live. |
| Weekly real installs by provider and by OS | Unique installs per week, 90 days. |
| Activation funnel | setup (not setup verify) → agent_strace_session_completed → review, share or cognitive-debt → the same again, within 7 days, over 90 days. |
| Command mix | Weekly commands by class: core is HELP_GROUPS in cli.py (the agent-strace --help groups), plumbing is PLUMBING_COMMANDS, and everything else, including commands added later, counts as labs. Update the query when those lists change. |
Running stats or watch |
Share of real installs that ran stats or watch in the last 30 days, with review for comparison. |
replay or explain → review |
Two funnels: by installation across the 30-day window, and by analytics session. Only 0.126.0 and later send a session ID, so the session funnel leaves older events out. |
| Install noise by filter outcome | All installations per week, by the first event filter they fail. Shows how much of the raw count is noise. |
Because real installs must be active on 2 days, the activation funnel overstates conversion for brand-new installations. Read it for where real users stop, not as a new-user conversion rate.
More suggested insights¶
Apply the real-installs filter to these to keep test and sandbox noise out:
- Weekly active installations: unique users performing
agent_strace_cli_command_completed. - Command adoption: event count grouped by
command, filtered to successful events, excludingshareevents withsubcommand = dry_run(share --dry-runpreviews). - Integration adoption: successful
setupevents grouped byintegration, excludingsubcommand = verify. - Reliability: failed command events divided by all command events, grouped by command and agent-strace version.
- Activation funnel: successful
setupcommand (excludingsubcommand = verify) →agent_strace_session_completed→ successfulreplay,inspect,explain, orexportcommand. - Retention: users whose first
agent_strace_session_completedevent is followed by another successful command in later weeks. - Extension adoption: unique installations performing
agent_strace_vscode_extension_activated, grouped by editor and extension version. - Extension feature usage:
agent_strace_vscode_command_completedgrouped by command and success. - Sessions per installation: a trends formula
A / Boveragent_strace_cli_command_completed, where A aggregates by Unique sessions and B by Unique users. Repeat with the extension events. - Commands per session: the same event's total count divided by its Unique sessions, grouped by agent-strace version.
- Session length: Property value median of the Session duration
session property on
agent_strace_cli_command_completed.
Do not use this telemetry for billing, access control, compliance, or security evidence. Open-source clients and public ingestion endpoints can be modified or spoofed.