{"version":"2.1.246","anchor":"per-class-memory-caps-on-spawned-processes-wired-through-but","canonical_anchor":"per-class-memory-caps-on-spawned-processes-wired-through-but","heading":"Per-class memory caps on spawned processes, wired through but off for everything except Bash","tier":"soon","area":"Sandbox","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.246\/e\/per-class-memory-caps-on-spawned-processes-wired-through-but","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.246","markdown":"### Per-class memory caps on spawned processes, wired through but off for everything except Bash\n\nMemory limits now reach npm, git, tmux, LSP, MCP and hooks, but everything except Bash is excluded.\n\n**What**\n\nClaude Code can put the processes it spawns into a Linux cgroup with a memory limit, and this build makes that decision per class of process rather than all at once. The plumbing now reaches nearly every launch site: npm, git, tmux, systemctl, xdg-open, LSP, MCP, plugin installs and hooks. In practice nothing new is capped in this build, because the exclusion list falls back to the entire set of new classes, leaving only the pre-existing Bash shell path limited.\n\n**Details**\n\n- The whole subsystem sits behind the server-side flag `tengu_tool_memory_cgroup`, which falls back to off, unless `CLAUDE_CODE_TOOL_MEMORY_LIMIT` is set.\n- Which classes are exempt comes from `CLAUDE_CODE_TOOL_MEMORY_CGROUP_EXCLUDE` as a comma-separated list, else the server value `tengu_tool_cgroup_exclude_classes`, whose fallback is empty and is treated as excluding all seven new classes: `mcp`, `lsp`, `hooks`, `plugin`, `tmux`, `helper` and `agent`, so only `shell` is capped.\n- The literal `all-new` in the exclusion list expands to every non-shell class.\n- A spawn that does not name a class is treated as `helper`, and capping is skipped whenever the class is in the exclusion set.\n- MCP is returned to the exclusion set even when otherwise enabled, unless `CLAUDE_CODE_MCP_MEMORY_CGROUP` or the server value `tengu_mcp_memory_cgroup` opts it back in.\n- The first time a given class is actually capped, the code reports `class_enabled`.\n- Alongside it: out-of-memory kills are counted by parsing `oom_kill (\\d+)` from the cgroup, and a cgroup directory deleted underneath a running process is self-healed and reported as either `recreated` or `vanished`.\n\n**Evidence**\n\n`CLAUDE_CODE_TOOL_MEMORY_CGROUP_EXCLUDE`, `tengu_tool_cgroup_exclude_classes`\n\n- Flag `tengu_tool_memory_cgroup`: Off in both readings (read for one account on one subscription tier against v2.1.246; this account: off, anonymous baseline: off, compiled default: not a boolean we can read)\n- Flag `tengu_tool_cgroup_exclude_classes`: Not enough to say (read for one account on one subscription tier against v2.1.246; this account: no value returned, anonymous baseline: no value returned, compiled default: not a boolean we can read)\n- Flag `tengu_mcp_memory_cgroup`: Off in both readings (read for one account on one subscription tier against v2.1.246; this account: off, anonymous baseline: off, compiled default: not a boolean we can read)\n- Area: Sandbox\n- Names: `CLAUDE_CODE_TOOL_MEMORY_CGROUP_EXCLUDE`\n- Tier: Nothing to try yet\n- Useful: 2\/5\n- Signal: 0\/5\n- Present in the build but not switched on"}