agent-resource-guard

agent-resource-guard is a skill for Claude Code from yogasw/wick. It costs 231 tokens per session (9,624 once invoked), scanned A, original, MIT.

A guide to limiting and measuring the memory, processor, disk-input/output, and process use of AI agents and the programs they start.

In plain words
What is it for?
Use it to configure resource limits, detect out-of-memory events, analyze usage history, control whether new agents may start, and report resource use.
Why use it?
It helps prevent agents, browsers, and helper programs from exhausting machine resources, and explains what happened when a limit is reached.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions Codex.

Not installable on its own: it runs a file from its repository that does not travel with it. Clone the repository, or install whatever ships that file. The line is go test -tags integration ./internal/agents/provider/memscope/ -v.

Install

Getting it into your agent

There is no command for this one: it runs only inside a plugin, and the catalogue could not identify which plugin ships it. The source is linked below.

Made for: Claude Code.

Wrote 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.

agentmods badge for agent-resource-guard

README.md
[![agentmods](https://agentmods.dev/badge/skills/yogasw/wick/agent-resource-guard.svg)](https://agentmods.dev/skills/yogasw/wick/agent-resource-guard)
Your own site
<a href="https://agentmods.dev/skills/yogasw/wick/agent-resource-guard"><img src="https://agentmods.dev/badge/skills/yogasw/wick/agent-resource-guard.svg" alt="Measured on agentmods" height="20"></a>
Per session 231 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 9,624 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.1 $0.00231 $0.09624
Opus 5 $0.00115 $0.04812
Sonnet 5 $0.00046 $0.01925
Haiku 4.5 $0.00023 $0.00962

Measured 6d ago against content hash 88149f41b61d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

agent-resource-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 6d 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.

.claude/skills/agent-resource-guard/SKILL.md · 738 lines

How it starts

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

Agent Resource Guard

Wick spawns agents (claude, codex, gemini) as child processes, and those agents spawn their own children — MCP servers, tool subprocesses, browsers. This subsystem bounds what all of that may consume, and measures what it actually does consume.

It is not only memory. Memory is the part that kills, so it gets the deepest treatment; CPU, block-IO, and process count are bounded too, and all four are measured. The name "memory guard" survives in config keys for compatibility — read it as "resource guard".

The one idea to keep

The kernel enforces. Wick observes and explains.

Every design decision below follows from that. A userspace sampler cannot win against a browser that allocates a gigabyte between two ticks, so wick never tries to kill on a sample. It asks the kernel to enforce a ceiling, then reads back what happened so a human gets a sentence instead of exit code 137.

Easy to read backwards

These four have already been misread — twice from the skill's own description, before it said this. If you are answering a question about any of them, quote this section rather than paraphrasing:

Sounds like Actually means
"measure writes nothing" Writes no limits. Records usage in full — that is the mode's purpose.
"swap must stay off" Not about OOM-killer predictability. With swap, the process never dies; it thrashes and holds its slot forever.
"the guard ships off by default" Enforcement is off. Usage history is on and independent of the mode.
"unavailable without systemd" Limits still apply without systemd — the cgroupfs backend enforces them. What systemd adds is the ability to name an OOM kill. And measurement, admission, the Resources page, and oom_score_adj never needed either. See the degradation table.

The shared shape: measurement and enforcement are separate axes. Nearly every misreading here comes from collapsing them into one.

Why this exists

Production wick was being OOM-killed. Not from a leak in wick — an agent or a tool subprocess would balloon (usually a browser or a large file read), and because every one of them was a child of wick inside wick's own cgroup, the kernel's OOM killer took wick down with them.

Read the full file on GitHub · 738 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. 6d ago First seen · 738 lines · 231 tokens per session scan A 88149f41b61d

Subscribe to this mod's changes

agent-resource-guard is a skill published in the GitHub repository yogasw/wick (5 stars, last pushed 2d ago), licensed MIT. It adds 231 tokens to every session and 9,624 once invoked, about $0.0012 per session on Opus 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-08-31.

Related

Other skills, from other repositories

opencli-sitemap-author

Use when creating or maintaining OpenCLI site sitemaps: agent-facing navigation, page-state, action, workflow, API-reference, pitfall, and fallback knowledge for a website. Use after browser exploration discovers durable site context, when a sitemap is stale, or when promoting local site knowledge into the repo.

jackwener/OpenCLI · 67 tokens

specification-writing

Write the full patent specification from claims and invention disclosure. Use when user says "撰写说明书", "write specification", "写说明书", "patent description", or wants to draft the complete patent specification.

wanshuiyin/Auto-claude-code-research-in-sleep · 49 tokens

training-check

Interactively monitor training metrics from the current Codex session, periodically checking WandB or fallback logs for NaN, divergence, plateaus, and broken runs.

wanshuiyin/Auto-claude-code-research-in-sleep · 35 tokens

golden-rss

Use when testing the rss golden build.

yusufkaraaslan/Skill_Seekers · 12 tokens

overleaf-sync

Two-way sync between a local paper directory and an Overleaf project, so ARIS audit/edit workflows stay on the local copy while collaborators edit in the Overleaf web UI. Use when user says "同步 overleaf", "overleaf sync", "推送到 overleaf", "connect overleaf", "Overleaf 桥接", "pull overleaf", "push overleaf", or wants to…

wanshuiyin/Auto-claude-code-research-in-sleep · 97 tokens

omh-code-review

This is a Hermes-native code-review workflow skill.

rlaope/oh-my-hermes · 46 tokens