{"version":"2.1.336","anchor":"claude-code-keep-agent-memory-env-var-and-claude-code-disabl","canonical_anchor":"claude-code-keep-agent-memory-env-var-and-claude-code-disabl","heading":"New CLAUDE_CODE_KEEP_AGENT_MEMORY variable, and auto memory can be disabled from settings","tier":"use","area":"Memory","scope":"both","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.336\/e\/claude-code-keep-agent-memory-env-var-and-claude-code-disabl","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.336","markdown":"### New `CLAUDE_CODE_KEEP_AGENT_MEMORY` variable, and auto memory can be disabled from settings\n\nSetting `CLAUDE_CODE_KEEP_AGENT_MEMORY` keeps agent memory on, unless `CLAUDE_CODE_DISABLE_AUTO_MEMORY` is set, including in settings files\n\n**What**\n\nA 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:\n\n- `CLAUDE_CODE_KEEP_AGENT_MEMORY` is set\n\n- auto memory is not disabled\n\n- a further internal check passes\n\nThe 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.\n\n**Why**\n\nYou can keep agent memory on with one variable, while a disable written into a settings file still wins over it.\n\n- Area: Memory\n- Names: `CLAUDE_CODE_KEEP_AGENT_MEMORY`\n- Tier: Use it now\n- Useful: 5\/5\n- Signal: 3\/5\n- Scope: both\n- Heads-up: no"}