Privacy and telemetry
Control how long Claude Code keeps session data and what it sends. The switches that turn off usage metrics and error reports are environment variables, not settings keys: set DISABLE_TELEMETRY, DISABLE_ERROR_REPORTING, or CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC in the env key or in the shell. Telemetry services says what each one stops. Two exceptions turn off from a settings file: feedbackDrafts below for Claude-drafted feedback, and feedbackSurveyRate below for the session survey.
cleanupPeriodDays
Set how many days Claude Code keeps session transcripts and other application data before deleting them. Claude Code runs the deletion as a background sweep after a session starts, as long as it can safely determine the retention period.
- Scope:
Any file - Type: number of days, a whole number, minimum
1 - Default:
30
{
"cleanupPeriodDays": 20
}Setting 0 fails validation, so pick a large value such as 3650 for long retention. To stop Claude Code from writing transcripts at all, see Plaintext storage.
desktopSessionCleanupPeriodDays
Set an age limit in days for the transcripts of sessions you started or most recently continued in Claude Desktop or Cowork. Without this key, Claude Code keeps those transcripts at any age. Claude Code deletes each one once it's older than both this limit and cleanupPeriodDays, so with cleanupPeriodDays at its default of 30, a value of 7 still keeps them 30 days. When managed settings set cleanupPeriodDays, that period applies instead and this key is ignored. Requires Claude Code v2.1.248 or later.
- Scope:
User or managed. Claude Code also reads the key from a file you pass with--settings, and ignores it in project and local settings. - Type: number of days, a whole number, minimum
0 - Default:
0, which sets no age limit
{
"desktopSessionCleanupPeriodDays": 90
}feedbackDrafts
Control Claude-drafted feedback: whether Claude can queue feedback drafts for you to review, and whether Claude Code shows a card when Claude queues one.
- Scope:
User or managed - Type: string, one of
"notify","quiet", or"off""notify": Claude Code shows a card above the prompt when Claude queues a draft, up to three cards in a session by default"quiet": Claude drafts without a card. You see the count of queued drafts in the prompt footer and review them in/feedback"off": Claude Code removes the SendFeedback tool, so Claude can't queue drafts
- Default:
"notify" - Per-session overrides:
CLAUDE_CODE_SEND_FEEDBACKset to0turns the feature off for one session
{
"feedbackDrafts": "quiet"
}Appears in /config as Claude-drafted feedback, which writes this key to your user settings. You see the /config row only in sessions where Claude can draft feedback; setting "off" doesn't hide it, so you can turn the feature back on from the same row. A value in managed settings takes precedence over your user setting, so when an administrator sets this key, the row shows the managed value and changing it has no effect. Claude Code ignores this key in project and local settings.
feedbackSurveyRate
Set the probability that the session quality survey appears when a session is eligible for it. Set 0 to keep the survey from appearing.
- Scope:
Any file - Type: number between
0and1 - Default: unset, so Claude Code uses the rate Anthropic sets remotely, or its built-in rate of
0.005on Amazon Bedrock, Google Cloud's Agent Platform, and Microsoft Foundry, which don't receive remote configuration - Per-session overrides:
CLAUDE_CODE_DISABLE_FEEDBACK_SURVEYset to1turns the survey off for one session whatever rate this key sets
{
"feedbackSurveyRate": 0.05
}The same rate applies to the survey in the VS Code extension.
skipWebFetchPreflight
Skip the WebFetch domain safety check, which sends each requested hostname to api.anthropic.com before fetching. Set true in environments that block traffic to Anthropic, such as Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry deployments with restrictive egress.
- Scope:
Any file - Type: Boolean
true: Claude Code skips the WebFetch domain safety checkfalse: the check runs before the first fetch to each hostname in a session, and again for a hostname whose earlier check was blocked or failed
- Default: unset, so the check runs before the first fetch to each hostname in a session
{
"skipWebFetchPreflight": true
}With the check skipped, WebFetch attempts any URL without consulting the blocklist, so pair it with WebFetch permission rules if you need to restrict which domains Claude can reach.
<span id="managed-policy" />