Environment: Cursor 3.24.9, macOS arm64, Privacy Mode on (PRIVACY_MODE_NO_STORAGE).
What the shipped code does
In Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js, the contribution workbench.contrib.externalCliAnalytics:
- Runs at startup and then every hour (
3600*1e3ms, task idexternal-cli-analytics-poll). - On each run, checks the feature gate
enable_ex_hs. If the gate is on, it reads all of~/.claude/history.jsonland~/.codex/history.jsonl, and for Claude Code also~/.claude/projects/<project>/sessions-index.json. These files contain the prompts typed into Claude Code and Codex. - For each history entry newer than the last one it processed, it calls
analyticsService.trackEvent("ex_hs2", …)with:tool:"ac"(Claude Code) or"cx"(Codex)ts: the entry’s timestampsessionId: the CLI session IDn: the prompt’s length in charactersmsgCount: the Claude Code session’s message count
- Stores the newest processed timestamp in
globalStorage/state.vscdbunderexternalCliAnalytics.lastTimestamp.claudeandexternalCliAnalytics.lastTimestamp.codex.
trackEvent queues an event for the backend if analyticsEnabled() returns true, and in this build analyticsEnabled() is return!0, so it always returns true. Privacy Mode changes only whether git attributes are attached to events (privacyModeAllowsGitTelemetryInAnalytics). I found no setting, other than the server-side gate, that the job or trackEvent checks.
What I observed on my machine
Both externalCliAnalytics.lastTimestamp.* keys exist in my state database, and the Codex value equals the timestamp of the newest entry in my ~/.codex/history.jsonl. The code writes that value only after calling trackEvent for the entry, so the job ran on my machine with the gate on. I did not capture network traffic, so I have not seen the events leave the machine.
How to check your own install (macOS)
cd "/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench"
rg -o 'async _poll\(\)\{if\(this\.experimentService\.checkFeatureGate\("enable_ex_hs"' workbench.desktop.main.js
rg -o 'joinPath\(e,"\.(claude|codex)","history\.jsonl"\)' workbench.desktop.main.js | sort -u
rg -o 'trackEvent\("ex_hs2",\{[^}]*\}' workbench.desktop.main.js
rg -o 'analyticsEnabled\(\)\{return!0\}' workbench.desktop.main.js
sqlite3 "$HOME/Library/Application Support/Cursor/User/globalStorage/state.vscdb" \
"SELECT key, value FROM ItemTable WHERE key LIKE 'externalCliAnalytics%'"
Minified identifiers change between builds. The string literals enable_ex_hs, ex_hs2, and externalCliAnalytics stay the same and work as search terms.
Questions
- What is
externalCliAnalyticsfor, and which accounts haveenable_ex_hsturned on? - Where do the privacy policy or the data-use page describe reading other applications’ history files?
- Which local setting stops this job? Per the code above, Privacy Mode does not.
- Where are
ex_hs2events stored, for how long, and how can a user get the events already collected deleted?
Request
Make this job opt-in, document the events it sends, and have Privacy Mode or telemetry.telemetryLevel: "off" stop it.