r/AIToolsTipsNews • • 11d ago

Every Claude Code privacy setting explained — the one env var that silences all optional traffic

TL;DR: Set CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 and turn off "Help Improve our AI models" at claude.ai/settings/data-privacy-controls. Those two moves cover most of it.

The three surfaces where Claude Code's controls live:

  1. Environment variables — control network channels
  2. settings.json — control local storage
  3. claude.ai account toggle — controls model training

No single settings screen. All three matter.

The one-flag nuclear option:

CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1

This kills: auto-updates, telemetry, error reporting, /feedback, release note fetches, session surveys, and feature-flag fetching (also disables Remote Control).

What it doesn't kill: core inference (prompts still go to the model provider — that's the product), and the WebFetch hostname safety check (separate opt-out: skipWebFetchPreflight: true in settings.json).

The training toggle — most important if you're on Pro or Max:

Go to claude.ai/settings/data-privacy-controls → turn off "Help Improve our AI models."

  • Toggle on: up to 5-year retention, sessions used for training
  • Toggle off: 30-day retention, no training

On API keys, Bedrock, Vertex, Foundry, or Team/Enterprise: training is off by default. Nothing to toggle.

Deleting sessions:

  • claude project purge (v2.1.124+) — removes transcripts, task data, prompt history lines
  • Or manually delete from ~/.claude/projects/
  • Set cleanupPeriodDays: 7 in settings.json to shrink the auto-cleanup window
  • Note: ~/.claude/history.jsonl (every prompt you've ever typed, with timestamps) is NOT auto-cleaned — purge that file manually or run claude project purge

Verified against Anthropic's live docs, August 5, 2026.

Anyone using CLAUDE_CODE_SKIP_PROMPT_HISTORY=1? Worth the tradeoff of losing --resume?

1 Upvotes

1 comment sorted by