{"version":"2.1.301","anchor":"remote-session-attachments-in-user-data-path-env-gated-and","canonical_anchor":"remote-session-attachments-in-user-data-path-env-gated-and","heading":"Remote-session attachments can be stored in a user-data folder behind CLAUDE_CODE_ATTACHMENTS_IN_USER_DATA","tier":"use","area":"Cloud Sessions","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.301\/e\/remote-session-attachments-in-user-data-path-env-gated-and","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.301","markdown":"### Remote-session attachments can be stored in a user-data folder behind CLAUDE_CODE_ATTACHMENTS_IN_USER_DATA\n\nNew `CLAUDE_CODE_ATTACHMENTS_IN_USER_DATA` variable lets remote sessions keep attachments in a user-data folder, with retention checks and hardened writes\n\n**What**\n\nA new environment variable, `CLAUDE_CODE_ATTACHMENTS_IN_USER_DATA`, sets up a way for remote sessions to keep attachments (files sent into the conversation) in a folder under a user-data root. An environment variable is a named setting passed to a program when it starts. The variable is new in this build and has been added to two lists of variables Claude Code passes through.\n\n- At startup, the routine runs only when both `CLAUDE_CODE_ATTACHMENTS_IN_USER_DATA` and `CLAUDE_CODE_REMOTE_SESSION_ID` are set.\n\n- It checks your organization's data-retention policy first. If the retention exemption is disabled it backs off with the reason `retention_governed`. If the retention state cannot be determined it backs off with `retention_unknown`. In both cases the feature is recorded as not used.\n\n- It then checks that the user-data root is usable. If so, it looks for the session's existing attachment folder and how many files it holds.\n\n- Saving an attachment into that folder now opens each part of the path one step at a time. It refuses symbolic links (shortcuts to other locations) and folders not owned by the current user, and checks whether the file system honours the \"do not follow links\" option.\n\n- When a save is refused, it fails with `nothing was saved: the attachments folder cannot be used`. Before, the folder was created with a plain `mkdir` and the file written directly.\n\n**Why**\n\nThe feature is off unless the variable is set, and it steps aside for organizations under retention rules. The stricter save path guards against an attachment being redirected somewhere unexpected, but it can make saves fail in unusual setups, such as folders owned by another user.\n\n- Area: Cloud Sessions\n- Names: `CLAUDE_CODE_ATTACHMENTS_IN_USER_DATA`, `CLAUDE_CODE_REMOTE_SESSION_ID`\n- Tier: Use it now\n- Useful: 5\/5\n- Signal: 4\/5\n- Scope: individual\n- Heads-up: no"}