Added
- Interactive
installwizard —npx -y @latitude-data/claude-code-telemetry installnow prompts forLATITUDE_API_KEYandLATITUDE_PROJECT, merges them into~/.claude/settings.jsonunderenv, and installs the Stop-hook entry if missing. On macOS it also offers to setBUN_OPTIONSvialaunchctland persist it with a~/Library/LaunchAgents/so.latitude.claude-code-telemetry.plist. Existing values are shown as defaults (API keys masked); a backup ofsettings.jsonis always written tosettings.json.latitude-bakbefore any change. - Flag-driven install for CI / automation:
--api-key=…,--project=…,--base-url=…(flag-only — no prompt),--no-launchctl,--no-prompt/--yes. Snake_case aliases also accepted (--api_key,--base_url, etc.). uninstallsubcommand —npx -y @latitude-data/claude-code-telemetry uninstallshows a plan and asks for confirmation, then reverses only what this package installed: removesLATITUDE_*/BUN_OPTIONSfromsettings.json.env, removes our Stop-hook entry (leaves other hooks alone), clearslaunchctlBUN_OPTIONSonly when it points at our preload, unloads and removes the LaunchAgents plist, and deletes~/.claude/state/latitude/(preload, state, captured requests).- Idempotent settings merge — rerunning install with the same inputs is a no-op. The hook-detection regex matches both the published npm command and dev-checkout
dist/index.jspaths.
Changed
- Non-interactive
install(no TTY, no flags) now just copies the preload file, unchanged from before. Any flag or TTY opts into the wizard.
Fixed
- Race between the intercept preload and the Stop hook — the preload used to buffer the whole response in the background and only write the request file after
.text()resolved. If Claude Code firedStopbefore that write completed, the hook saw an empty dir and spans didn't get enriched. The preload now tees the response stream and writes the file the momentmessage_startarrives (the first SSE event), guaranteeing the file is on disk well before any hook can run. - 250ms flush delay at Stop-hook startup — Claude Code could fire Stop before the transcript writer had flushed the final assistant row, so the last text-only
llm_requestspan was occasionally missing and some turns weren't captured. The hook now waits briefly for disk flushes before reading.
Added
- Diagnostic span attributes for the capture pipeline (
latitude.debug.message_ids,latitude.debug.captured_message_ids,latitude.debug.captured_count,latitude.debug.lookup_message_id,latitude.debug.request_file_found) so the Latitude UI exposes exactly what the hook saw when a span isn't enriched.
Docs
- Claude Desktop setup correction —
BUN_OPTIONSin~/.claude/settings.json'senvdoes NOT reach the claude runtime; that field is only applied to hook subprocesses. README andinstallsubcommand output now direct users tolaunchctl setenvfor macOS Claude Desktop (followed by a full quit/relaunch) and to shell rc exports for terminalclaude. A LaunchAgents plist template is included for persistence across reboots.