claude: stop Claude Code killing background shells under memory pressure #1508

Merged
JakeHillion merged 1 commits from jj/slnxkxqwzytp into main 2026-12-06 14:01:37 +00:00
1 Commits
Author SHA1 Message Date
JakeHillion 656627a611 claude: stop Claude Code killing background shells under memory pressure
commit-validation / validate-single-commit (pull_request) Successful in 4s
buildbot/nix-eval Build done. (30 warnings)
buildbot/nix-build Build done.
buildbot/nix-effects Build done.
When the system reports critical memory pressure and a session has been
idle for 30 minutes, Claude Code terminates its background shells. On
maverick that killed long-running watchers using a few megabytes, while
the process actually exhausting memory kept running until the kernel's
OOM killer dealt with it.

Set CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP in the managed settings'
env, so reclaiming memory is left to the OOM killer.

Test plan:
- CI
- Built maverick's toplevel: /etc/claude-code/managed-settings.json sets
  the variable
2026-12-06 12:02:15 +00:00