[DOCS] Background shell docs omit memory-pressure reaping and `CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP`
Documentation Type
Missing documentation (feature not documented)
Documentation Location
https://code.claude.com/docs/en/tools-reference
Section/Topic
Bash tool background tasks, agent view shell jobs, and environment variables.
Current Documentation
The tools reference currently says:
For long-running processes such as dev servers or watch builds, Claude can setrun_in_background: trueto start the command as a background task and continue working while it runs. List and stop background tasks with/tasks.
The agent view page describes shell jobs:
The command runs as a PTY-backed job and appears as a row in agent view, with the most recent line of output as its status.
The environment variables page documents related background waits such as:
CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS| Maximum time in milliseconds that non-interactive mode with the-pflag waits after the final turn for background subagents and workflows whose result is part of the output.
What's Wrong or Missing?
Claude Code v2.1.193 added automatic memory-pressure reaping for idle background shell commands, with an opt-out environment variable: CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP=1.
The current docs do not explain:
- that idle background shell commands may be reaped under memory pressure
- what counts as an idle background shell command
- how this affects
/tasks, agent view shell jobs, and Bashrun_in_background - how to disable the behavior with
CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP=1 - where users should look when a long-running idle shell disappears
Suggested Improvement
Add a note to the Bash/background task docs:
Claude Code may automatically stop idle background shell commands under memory pressure. If you need to keep idle background shell commands alive even under pressure, set CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP=1.
Also add CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP to the environment variables reference, including the default behavior and any supported values.
Impact
Medium - Makes feature difficult to understand
Additional Context
Affected Pages:
| Page | Context |
|------|---------|
| https://code.claude.com/docs/en/tools-reference | Describes Bash run_in_background but not memory-pressure reaping |
| https://code.claude.com/docs/en/agent-view | Describes background shell jobs but not idle reaping under memory pressure |
| https://code.claude.com/docs/en/env-vars | Omits CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP |
Total scope: 3 pages affected
Version context: Claude Code v2.1.193 release note: "Added automatic memory-pressure reaping for idle background shell commands (disable with CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP=1)."