Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add serejaris/personal-corp-os --skill memory-cleanupgit clone --depth 1 https://github.com/serejaris/personal-corp-osWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/serejaris/personal-corp-os/memory-cleanup)<a href="https://agentmods.dev/skills/serejaris/personal-corp-os/memory-cleanup"><img src="https://agentmods.dev/badge/skills/serejaris/personal-corp-os/memory-cleanup/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/serejaris/personal-corp-os/memory-cleanup"><img src="https://agentmods.dev/badge/skills/serejaris/personal-corp-os/memory-cleanup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00077 | $0.01269 |
| Opus 5.5 | $0.00031 | $0.00508 |
| Sonnet 5.5 | $0.00015 | $0.00254 |
| Haiku 4.5 | $0.00008 | $0.00127 |
Grade A, and why
memory-cleanup scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 65 lines — stays where its author put it; the contents beside it link to each section on GitHub.
memory-cleanup
An active skill: it kills processes, so the snapshot and the kill are separate steps. The snapshot script only reads.
Typical picture on a 16 GB Mac: a few gigabytes held by Claude Code desktop sessions idle for days (30–400 MB each, dozens of them), a daemon of a closed app still running its workers, duplicate worker brokers, a Chrome for Testing left by puppeteer. A background npm run dev started inside a session dies together with that session.
When memory is really short
"13 of 16 GB used" and the Swap Used size mean nothing by themselves: macOS keeps memory busy with cache and compression, and swap does not shrink after memory is freed until a reboot. Shortage shows by three signs:
- pressure is yellow or red:
sysctl kern.memorystatus_vm_pressure_levelabove 1,memory_pressureshows less than 25–30% free; Swapoutsinvm_statgrow before your eyes (two readings a minute apart);- swap grows three readings in a row.
Measure a process by top -o mem or footprint: ps (RSS) does not see the compressed part and understates it. Look at the top of top -o mem before cleaning: one live job (a local whisper transcription, a model load) can hold more than all the tails together, and the script does not list children of active sessions.
Procedure
-
Snapshot. From the skill root:
bash scripts/tails-macos.sh # local ssh -o BatchMode=yes -o ConnectTimeout=8 <alias> 'bash -s' < scripts/tails-<os>.sh # remoteThe script reads only, never calls sudo, kills nothing. It prints a table of candidates and a summary: total RSS, swap, memory pressure. Keep the summary: it is the "before" for step 5. It skips launchd gui-domain services (on Linux, processes in
.serviceunits), system processes, Claude.app, the current shell and its ancestors; the current claude session is named on a separate line. It prints no process environment, only session ids. Output is in Russian; the class labels are:
What ships with it
4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 65 lines · 77 tokens per session scan A e027e511c446
memory-cleanup is a skill published in the GitHub repository serejaris/personal-corp-os (230 stars, last pushed today), licensed MIT. It adds 77 tokens to every session and 1,269 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-19.
Other skills, from other repositories
janitor-fix
Automatically fix skill problems (safe preview first). Also use with --prune to find and remove broken symlinks, empty directories, and orphaned skills. Trigger with '/janitor-fix'.
diagnosing-bugs
A structured process for diagnosing difficult software bugs and performance slowdowns. It starts by creating a repeatable pass-or-fail check, such as a failing test, HTTP request, command, or browser script.
incident-postmortem
Escribe un postmortem de incidente estructurado o revisión post-incidente. Úsalo cuando se te pida escribir un postmortem, reporte de incidente, revisión P1/P2, reporte de apagón o RCA (análisis de causa raíz). Produce un postmortem sin culpables con cronología, causa raíz, factores contribuyentes, resumen de impacto…
agent-design-review
Review an LLM agent design and find where it will be unreliable, expensive, or unsafe. Use when asked to review an agent architecture, critique a multi-step/tool-using agent, debug an agent that loops or goes off-task, or harden an agent before launch. Produces a structured review — task fit, control flow, tools…
agent-incident-postmortem
Run a blameless postmortem for an incident caused by an AI agent or LLM feature — hallucinated facts shipped to users, runaway tool use, prompt injection, cost blowouts, or wrong actions taken autonomously. Use when asked to write up an AI incident, analyse why an agent did something wrong, or produce corrective…
prompt-debugging
Figure out why a prompt isn't working and fix it — diagnose the actual failure (ambiguity, missing context, wrong format, conflicting instructions) instead of randomly rewording. Use when asked why isn't my prompt working, the AI keeps ignoring my instructions, my prompt gives inconsistent results, or how do I fix…