memory-guard

A Linux-only resource guard that sets a separate memory limit for each running agent process. On Windows and macOS, it reports that no limit is applied.

In plain words
What is it for?
Use it to limit and monitor memory used by agents, especially agents running browsers or stuck in runaway loops.
Why use it?
It prevents one agent using excessive memory from exhausting the whole machine. It adds protection that a simple limit on the number of agents cannot provide.

Agent

Install

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.

agentmods
npx agentmods add agents/yogasw/wick/memory-guard
Clone the repo
git clone --depth 1 https://github.com/yogasw/wick
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,411 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.03411
Opus 5 $0.00000 $0.01706
Sonnet 5 $0.00000 $0.00682
Haiku 4.5 $0.00000 $0.00341

Measured 2d ago against content hash cc23c068e246, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

memory-guard 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 2d ago.

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.

docs/guide/agents/memory-guard.md · 170 lines

How it starts

The opening of the file, as written. The whole thing — 170 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Memory Guard

The agent pool (Pool & Sessions) caps how many agent processes run at once. It has no idea how much RAM any one of them uses — an idle agent at ~150 MB and one driving a browser at ~2 GB count as the same slot. A single runaway agent (a browser leak, a bad loop) can take the whole machine down with it, wick included.

The memory guard adds a second axis: byte limits, enforced by the kernel, per agent. It ships off — a fresh install and an upgraded one behave identically until you opt in.

::: info Source Config + arithmetic: internal/agents/config/memguard.go. Mechanism: internal/agents/provider/memscope/ (systemd scopes and the raw-cgroupfs fallback), internal/agents/provider/memguard.go (wiring into spawn). Measurement: internal/pkg/memreport/ (live /proc reads + history buffer). :::

Linux only

Enforcement needs a Linux kernel. Off Linux — Windows, macOS — the guard degrades cleanly: no limit is applied, and both the CLI and the Resources page say so plainly instead of silently doing nothing.

On Linux, wick probes two mechanisms in order at first use and caches whichever works, by actually creating and tearing down a throwaway group rather than guessing from paths or permissions:

Backend Requires Notes
systemd (preferred) a reachable systemd user session (systemd-run --user --scope) Scopes are reaped automatically (--collect), and cgroup v2's memory.events gives a real per-scope OOM-kill counter.
cgroupfs (fallback) a writable /sys/fs/cgroup/memory (cgroup v1) No systemd needed — the kernel is enough. Used on hosts whose PID 1 isn't systemd (a Fly.io Machine, a bare container, Termux without linger).
none Agents run unguarded; only /proc measurement remains.

Read the full file on GitHub · 170 lines

Changes

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.

  1. 2d ago First seen · 170 lines · 0 tokens per session scan A cc23c068e246

Subscribe to this mod's changes

memory-guard is an agent published in the GitHub repository yogasw/wick (5 stars, last pushed 4d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,411 tokens. 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-08-31.

Related

Other agents, from other repositories

desktop

Agent "desktop" from WrongStack/WrongStack, covering working rules and output.

WrongStack/WrongStack · 0 tokens

firecrawl-expert

Expert in Firecrawl API for web scraping, crawling, and structured data extraction. Handles dynamic content, anti-bot systems, and AI-powered data extraction.

0xDarkMatter/claude-mods · 36 tokens

forge-visual-verifier

Perceptual gate for spec [visual] acceptance criteria. Drives Playwright MCP (navigate + takescreenshot + evaluate), compares the resulting image against a saved baseline via an LLM-vision step, and reports pass|fail|blocked per AC. Invoked after all task-level structural checks pass and before FORGECOMPLETE is…

LucasDuys/forge · 81 tokens

project-manager

Project manager for CrawlForge MCP Server development. Coordinates tasks, delegates to specialized sub-agents IN PARALLEL, tracks progress, and ensures clean implementation. Use PROACTIVELY for any multi-step project coordination.

mysleekdesigns/crawlforge-mcp · 46 tokens

mcp-implementation

MCP server implementation specialist. Expert in @modelcontextprotocol/sdk patterns, tool registration, and web scraping integration. Use for implementing server code, tools, and core functionality.

mysleekdesigns/crawlforge-mcp · 40 tokens

security-auditor

Security specialist for CrawlForge MCP Server. Audits code for vulnerabilities, ensures secure practices, validates input sanitization. Use PROACTIVELY before deployments and after major changes.

mysleekdesigns/crawlforge-mcp · 40 tokens