What
A new environment variable, CLAUDE_CODE_KEEP_AGENT_MEMORY, asks Claude Code to keep agent memory on. An environment variable is a named value you set in your shell or in a settings file before Claude Code starts. It takes effect when all of these hold:
CLAUDE_CODE_KEEP_AGENT_MEMORYis set- auto memory is not disabled
- a further internal check passes
The check for CLAUDE_CODE_DISABLE_AUTO_MEMORY now also looks at the environment sections inside your settings files, not only at variables set in your shell.
Why
You can keep agent memory on with one variable, while a disable written into a settings file still wins over it.
Names in the bundleCLAUDE_CODE_KEEP_AGENT_MEMORY