Unclear Setting the variable changes one more behaviour that has not been identified.
What
CLAUDE_CODE_ATTACHMENTS_BY_PATH is a new environment variable, a setting handed to Claude Code when it starts. It was not in v2.1.299. When it is set:
preserveToolUseResultInSubagentson the send-user-file tool is forced on, so the tool's results are kept inside subagents (helper copies of Claude given part of a task). Before, only the remote switchtengu_lucky_whisperdecided this. That switch is still read when the variable is not set, with a fallback of false.- The send-file tool's
isEnabled()check skips the first-party provider check and theallow_send_filecheck, and the tool's availability check returns true, as it already did forCLAUDE_CODE_REMOTE. - The choice of where to upload attachments returns "none", so files are not uploaded.
- The check for whether Claude Code runs in a remote environment returns true, alongside
CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPEandCLAUDE_CODE_REMOTE. - The variable is on several lists of environment variables Claude Code checks or allows at startup.
Why
Whatever sets this variable, typically a program hosting Claude Code, gets the send-file tool without the usual provider and permission checks, no attachment uploads, and remote-session behaviour. If you set it yourself, expect all of these together.
tengu_lucky_whisper Not enough to sayNothing here resolved what this flag was doing on this version, so nothing here should be read as on or off.
This account: no value returned · anonymous baseline: no value returned · compiled default in v2.1.300: off
These values were read against a different version of Claude Code, so treat them as the nearest reading available instead of one taken on this release.
tengu_send_user_file Not enough to sayNothing here resolved what this flag was doing on this version, so nothing here should be read as on or off.
This account: no value returned · anonymous baseline: no value returned · compiled default in v2.1.300: on
These values were read against a different version of Claude Code, so treat them as the nearest reading available instead of one taken on this release.
Read once, for one account on one subscription tier, against v2.1.300. It isn't a statement about your account. What a flag value here can and cannot tell you
Setting the variable changes one more behaviour that has not been identified.
New in this build: CLAUDE_CODE_ATTACHMENTS_BY_PATH