Repository navigation
feat: anonymous usage telemetry (opt-out) - #101
Merged
Merged
Conversation
Report coarse usage to the maintainers' PostHog project under a random install id so we can see active installs, versions, platforms and which features get used: - nadirclaw_cli: the CLI command name per invocation (never arguments) - nadirclaw_serve: routing config at server start (tier count, provider names, public model ids, classifier, optimize mode, feature toggles, credential source) - nadirclaw_usage: per-tier request, token, cost, cache and fallback deltas every 6h and at shutdown, only when requests were served Prompts, responses, keys, paths, hostnames and self-hosted or fine-tuned model names are never sent. `claude read-hook` sends nothing since it runs on every Claude Code file read. A first-run notice explains it; disable with `nadirclaw telemetry off`, NADIRCLAW_TELEMETRY=0 or DO_NOT_TRACK=1. Sends run on a daemon thread with a 3s timeout, CLI exit waits at most 1s, and every entry point swallows its own errors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
doramirdor
added a commit
that referenced
this pull request
Oct 15, 2026
- Anonymous usage telemetry, on by default with a first-run notice: CLI command names, routing config at server start, and per-tier request/token/cost counts every 6h, keyed by a random install id. Opt out with `nadirclaw telemetry off`, NADIRCLAW_TELEMETRY=0 or DO_NOT_TRACK=1 (#101). Bumps version to 0.25.0 and dates the changelog section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Adds anonymous usage telemetry so maintainers can see active installs, versions, platforms, and which features get used. It is on by default, prints a notice on first run, and can be turned off three ways:
Events go to PostHog (
us.i.posthog.com, the same project as getnadir.com), keyed by a random install id:nadirclaw_cliserve,claude onboard,auth openai login), never arguments or optionsnadirclaw_servenadirclaw_usagemetrics.py)Every event also carries the version, Python version, OS, CPU architecture, and whether it is running in CI or Docker.
Never sent: prompts, responses, keys, file paths, hostnames, command arguments, or model names from self-hosted or custom providers (Ollama, Together, Replicate, fine-tunes).
claude read-hooksends nothing, because it runs on every Claude Code file read.Design
nadirclaw/analytics.py, using only the standard library (urllib,threading). It is separate fromnadirclaw/telemetry.py, which is OpenTelemetry tracing to the user's own collector.sys.argvagainst the commands click has registered. A token that is not a registered command name stops the walk, so arguments are never sent.tests/conftest.pysetsNADIRCLAW_TELEMETRY=0, so the test suite never sends events.Known limits
anonymize_ips: false. The README says so.$HOMEis not writable (some containers), each run creates a new install id, which inflates user counts. Aponytail:comment in the code names the fix: hash/etc/machine-id.Test plan
tests/test_analytics.py(8 tests): only command names are sent, never arguments; the three opt-outs send nothing and create no id;telemetry offpersists; usage reports are deltas and skipped when idle; private model names are filtered out; telemetry errors never propagateHOME: 936 passed, 3 skippedtelemetry status/on/off, the env override message, and the exit delay with no networknadirclaw_telemetry_test) returned{"status":"Ok"}from the PostHog project the key belongs to🤖 Generated with Claude Code