CLAUDE_CODE_ATTACHMENTS_IN_USER_DATA

Updated by

CLAUDE_CODE_ATTACHMENTS_IN_USER_DATA is a Claude Code environment variable: Off unless set. In remote sessions it governs reading session attachments from a user-data uploads root, behind a retention check that withholds the path when retention is governed or cannot be confirmed. Present in v2.1.301 but not named in that release's changelog. Its release history is not tracked here. It is not in the official reference.

StatusPresent in v2.1.301
CategoryOther
Official docsNot listed

How to set it

For one session, export it in the shell that starts Claude Code:

export CLAUDE_CODE_ATTACHMENTS_IN_USER_DATA=<value>
claude

To apply it to every session, add it to the env object of a settings file:

// ~/.claude/settings.json
{
  "env": {
    "CLAUDE_CODE_ATTACHMENTS_IN_USER_DATA": "<value>"
  }
}

Release notes that mention it

Related variables

Frequently asked questions

What does CLAUDE_CODE_ATTACHMENTS_IN_USER_DATA do?

Off unless set. In remote sessions it governs reading session attachments from a user-data uploads root, behind a retention check that withholds the path when retention is governed or cannot be confirmed. Present in v2.1.301 but not named in that release's changelog.

Which Claude Code version has CLAUDE_CODE_ATTACHMENTS_IN_USER_DATA?

Its release history is not tracked here.

How do I set CLAUDE_CODE_ATTACHMENTS_IN_USER_DATA?

Export it before starting Claude Code (export CLAUDE_CODE_ATTACHMENTS_IN_USER_DATA=value), or add it to the "env" object in ~/.claude/settings.json to apply it to every session.

All variables, searchable: Claude Code environment variables.