{"version":"2.1.274","anchor":"memory-pressure-background-shell-reaper-gets-an-explanatory","canonical_anchor":"memory-pressure-background-shell-reaper-gets-an-explanatory","heading":"Background shell memory-pressure reaping made smarter and better explained","tier":"notice","area":"Background Tasks","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.274\/e\/memory-pressure-background-shell-reaper-gets-an-explanatory","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.274","markdown":"### Background shell memory-pressure reaping made smarter and better explained\n\nClaude Code checks real host memory scarcity before killing idle background shells and explains why, with an opt-out env var\n\n**What**\n\n- Before killing a background shell command because of a memory-pressure event, Claude Code now checks actual host memory scarcity (reading `\/proc\/meminfo` on Linux\/WSL, comparing available memory against both a percentage and an absolute floor) instead of reaping almost unconditionally.\n\n- More situations now skip a reap: a turn is currently running, delegated agents (subagents) are running, or the session was recently reaped, with deduplicated diagnostic logging explaining why a reap was skipped.\n\n- When a background shell is stopped for memory pressure, the explanation shown to the agent now explicitly tells it not to debug or auto-restart the command, to report what happened instead, and to only restart it if the user asks.\n\n- The message also tells the agent about the new `CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP` environment variable, which lets users turn this reaping behavior off entirely.\n\n**Why**\n\nThis avoids killing background commands unnecessarily, stops the agent from reflexively trying to restart a command the system deliberately stopped, and gives users a way to disable the safeguard if it gets in their way.\n\n- Area: Background Tasks\n- Names: `CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP`\n- Tier: You'll notice\n- Useful: 3\/5\n- Signal: 2\/5"}