thedotmack/claude-mem · warning

DO_NOT_TRACK is set in your environment. It overrides…

Error message

DO_NOT_TRACK is set in your environment. It overrides everything: telemetry will remain OFF even after enabling here.

What it means

When running the telemetry enable flow, if DO_NOT_TRACK is set (to anything other than '0' or 'false') in the environment, the CLI warns that the opt-out env var overrides everything: telemetry stays OFF even if you confirm enable in the prompt. The library honors the standard DO_NOT_TRACK convention above its own settings.

Solutions

  1. Unset the variable for the session: `unset DO_NOT_TRACK` (or `DO_NOT_TRACK=0 claude-mem telemetry`), then run the enable flow.
  2. Remove the `export DO_NOT_TRACK=...` line from shell profile files (.bashrc/.zshrc/.profile) for a permanent change.
  3. Accept the override if the machine must stay opted out — the warning is informational, not a fault.

Example fix

// before
export DO_NOT_TRACK=1   # in ~/.zshrc
// after
unset DO_NOT_TRACK
npx claude-mem telemetry   # now enable takes effect
Defensive patterns

Strategy: validation

Validate before calling

// Check the override before enabling telemetry
const dnt = process.env.DO_NOT_TRACK;
const telemetryBlocked = dnt !== undefined && dnt !== '0' && dnt !== 'false';
if (telemetryBlocked) console.warn('DO_NOT_TRACK is set; enable will have no effect.');

Type guard

function isDoNotTrackSet(env: NodeJS.ProcessEnv): boolean {
  const v = env.DO_NOT_TRACK;
  return v !== undefined && v !== '0' && v !== 'false';
}

Try / catch

if (isDoNotTrackSet(process.env)) {
  p.log.warn('DO_NOT_TRACK is set in your environment. Telemetry will remain OFF even after enabling here.');
}

Prevention

When it happens

Trigger: Running `claude-mem telemetry` enable and confirming 'yes' while process.env.DO_NOT_TRACK is set to a truthy value (e.g. '1', 'true', 'yes').

Common situations: CI containers and corporate images commonly export DO_NOT_TRACK=1 globally; users set it system-wide earlier and forget; dotfiles (.bashrc/.zshrc) export it; Docker images bake it in.

Understand the failure class

Background: "environment variable is not set" and "Missing keys in environment" errors: what missing required env var messages mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of thedotmack/claude-mem@d8bc9755e7 (2026-09-17). Data as JSON: /api/errors/a302b4e3e6b52905. Report an issue: GitHub.

Appendix: source

Thrown at src/npx-cli/commands/telemetry.ts:166

      '',
      'Each event carries ONLY these fields:',
      ...COLLECTED_FIELDS.map((line) => `  ${line}`),
      '',
      'Plus coarse location (country / region / city), derived server-side',
      'at ingest from the request IP — the raw IP is discarded, never stored.',
      '',
      'NEVER collected — not now, not ever:',
      '  prompts or conversation content, file paths, source code,',
      '  project names, git remotes, search queries, error messages,',
      '  IP addresses, hardware IDs, env values, emails.',
      '',
      `Full details: ${DOCS_URL}`,
    ].join('\n'),
    'What telemetry collects'
  );

  if (process.env.DO_NOT_TRACK && process.env.DO_NOT_TRACK !== '0' && process.env.DO_NOT_TRACK !== 'false') {
    p.log.warn(
      'DO_NOT_TRACK is set in your environment. It overrides everything: telemetry will remain OFF even after enabling here.'
    );
  }

  const shouldEnable = await p.confirm({
    message: 'Enable anonymous usage telemetry?',
    initialValue: true,
  });

  if (p.isCancel(shouldEnable) || !shouldEnable) {
    p.cancel('Telemetry remains disabled. Nothing was written.');
    return;
  }

  // getOrCreateInstallId() persists a config if none exists; reuse its ID.
  const installId = getOrCreateInstallId();
  saveTelemetryConfig({
    enabled: true,

View on GitHub (pinned to d8bc9755e7)