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
Owner

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
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
JakeHillion added 1 commit 2026-12-06 14:00:20 +00:00
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.
656627a611
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
JakeHillion scheduled this pull request to auto merge when all checks succeed 2026-12-06 14:00:43 +00:00
JakeHillion merged commit 656627a611 into main 2026-12-06 14:01:37 +00:00
JakeHillion deleted branch jj/slnxkxqwzytp 2026-12-06 14:01:45 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: JakeHillion/nixos#1508