/linux-debugging:setup-oom-protectionfrom linux-debugging
Install and configure userspace OOM protection (systemd-oomd or earlyoom) so a desktop running out of memory kills the offending process before the kernel hard-locks the machine. Use when the user reports freezes under memory pressure, or proactively when setting up a new desktop. Ubuntu 22.04+ ships systemd-oomd by default; this skill verifies its config and falls back to earlyoom on older systems.
Ships in linux-debugging. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A Wayland desktop under heavy memory pressure (Chrome with 200 tabs, a runaway build, an LLM swallowing RAM) will freeze before the in-kernel OOM killer fires — the system thrashes swap and becomes unresponsive for minutes. Userspace OOM daemons watch pressure metrics (PSI) and kill earlier.
Check systemd version: systemctl --version | head -1
systemctl status systemd-oomd
systemd-cgls /sys/fs/cgroup/user.slice
oomctl
oomctl lists which cgroups are being watched. If empty, no slice has ManagedOOMSwap=kill or ManagedOOMMemoryPressure=kill set.
The Ubuntu default already enables ManagedOOMSwap=kill on [email protected]. Verify:
systemctl cat [email protected] | grep -i ManagedOOM
systemctl cat user.slice | grep -i ManagedOOM
If missing, drop in an override:
sudo systemctl edit [email protected]
Add:
[Service]
ManagedOOMSwap=kill
ManagedOOMMemoryPressure=kill
ManagedOOMMemoryPressureLimit=50%
Reload and verify with oomctl.
Edit /etc/systemd/oomd.conf.d/local.conf:
[OOM]
SwapUsedLimit=90%
DefaultMemoryPressureLimit=60%
DefaultMemoryPressureDurationSec=20s
sudo apt install earlyoom
sudo systemctl enable --now earlyoom
Defaults: kill at 10% free RAM and 10% free swap. Tune in /etc/default/earlyoom:
EARLYOOM_ARGS="-r 60 -m 5 -s 5 --avoid '(^|/)(systemd|sshd|init|bash|kwin_wayland|plasmashell)$' --prefer '(^|/)(chrome|firefox|node|python)'"
-m 5 -s 5 = trigger at 5% free RAM and 5% swap. --avoid protects critical desktop processes; --prefer targets memory hogs first.
Stress test (use a VM or be ready to lose unsaved work):
stress-ng --vm 4 --vm-bytes 90% --timeout 60s
Then check what fired:
journalctl -u systemd-oomd -b --no-pager # path A
journalctl -u earlyoom -b --no-pager # path B
Report:
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
10 skills in this plugin
/boot-inspectInspect boot health on a systemd Linux system — failed units, slow services, kernel boot messages, and boot-to-boot comparison. Use when the user reports slow boot, services not starting, or wants to check post-reboot health. Targets Ubuntu/Debian + Wayland desktops but works on any systemd host./inspect-oom-eventsFind past out-of-memory kill events in the journal — both kernel OOM killer invocations and userspace systemd-oomd / earlyoom kills — and reconstruct what was running at the time. Use when the user reports an unexplained freeze, lost work, or a process disappearing./interactive-debuggingCollaboratively debug a misbehaving Linux desktop app or service in real time with the user. Two modes — live (tail logs while the user reproduces) and retrospective (something just happened, capture evidence before it gets buried). Produces a diagnosis and optionally a written-up bug report with attached log excerpts. Use when the user says "something won't launch", "let's debug this together", "X just crashed", "a bug just happened", or describes an issue they want to reproduce./investigate-last-crashOpen a forensic investigation into the most recent Linux crash, freeze, or unexpected reboot. Collects kernel dumps, previous-boot journal, userspace core dumps, and sar metrics, correlates them around the crash timestamp, and writes a findings report. Use when the user says "investigate the crash", "why did my system reboot", "open a crash investigation", or similar./journal-inspectRun targeted journalctl queries to surface only the relevant log lines for a debugging task — by unit, time window, priority, boot, or kernel/user scope. Emits structured output (JSON or short-form) suited for AI analysis. Use when the user reports a problem and you need to inspect logs without dumping everything. Assumes systemd + journald (Ubuntu, Debian, Fedora, Arch, etc.)./log-inspectInspect non-journal log sources on a Linux desktop — Xorg/Wayland session logs, application logs in ~/.cache and ~/.local/state, /var/log/* leftovers, and dmesg — using AI-friendly tools (ripgrep, jq, structured queries) that produce focused, parseable output instead of raw log dumps. Use when journald doesn't have what you need or when an app writes its own log files.linux-debugging@danielrosehill is listed by danielrosehill/claude-code-plugins — review the source before installing
npx claudepluginhub danielrosehill/claude-code-plugins --plugin linux-debugging