MON-04: Add opt-in telemetry system using PostHog#1
Merged
Conversation
Implement a privacy-respecting telemetry system that: - Prompts for consent on first run (opt-in only) - Respects DO_NOT_TRACK environment variable - Adds --no-telemetry flag to disable per session - Adds --privacy flag to display telemetry info - Tracks command execution and errors (type only) - Uses PostHog Python SDK with async batching - Never collects PII (no paths, usernames, stack traces) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add GitHub Actions workflows (build-test.yml, publish.yml) - Add pre-commit check script (scripts/ci/run-checks.sh) - Add dev dependencies (ruff, black, pytest) to setup.py - Add CLAUDE.md with agent instructions - Add .gitignore - Fix all ruff linting errors (unused imports, undefined vars) - Format all files with black
- Hardcode PostHog API key for automatic telemetry (users can still opt-out) - Switch from module-level API to Posthog class instance pattern - Use client.shutdown() instead of posthog.flush() for proper cleanup - Update host to us.i.posthog.com for US region
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DO_NOT_TRACKenvironment variableFeatures
--no-telemetryflag to disable telemetry for a single session--privacyflag to display telemetry information and settingscli_installed,command_executed,api_generated,error_occurred,session_duration,onboarding_completedTest plan
ant --privacydisplays telemetry infoant --no-telemetrydisables telemetry for sessionDO_NOT_TRACK=1environment variable is respected🤖 Generated with Claude Code