boxel: Skill for Claude Code

.claude/skills/host-test-memory-leak-hunting/SKILL.md

host-test-memory-leak-hunting is a skill for Claude Code from cardstack/boxel. It costs 89 tokens per session (2,587 once invoked), scanned A, original, MIT.

A guide to finding memory leaks in a browser-based test suite using V8 heap snapshots over the Chrome DevTools Protocol (CDP). A memory leak is data that remains held after it should be released, causing memory use to grow.

In plain words
What is it for?
Use it when test shards run out of memory, measured heap use keeps rising, or a new feature may retain browser or test objects between tests.
Why use it?
Even a small leak in each test can eventually exhaust the memory available to a continuous integration (CI) job. Heap snapshots and retained-object paths help identify what is keeping the memory alive.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

This is cardstack/boxel's own configuration. It tells Claude Code how to work on boxel itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything boxel configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is nohup node packages/host/scripts/heap-snapshot-runner.js > /tmp/snap-runner.log 2>&1 &.

Reuse

Borrowing it

Nothing to install: this file belongs to cardstack/boxel. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/cardstack/boxel/main/.claude/skills/host-test-memory-leak-hunting/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/cardstack/boxel

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 host-test-memory-leak-hunting

README.md
[![agentmods](https://agentmods.dev/badge/skills/cardstack/boxel/host-test-memory-leak-hunting/github.svg)](https://agentmods.dev/skills/cardstack/boxel/host-test-memory-leak-hunting)
Your own site
<a href="https://agentmods.dev/skills/cardstack/boxel/host-test-memory-leak-hunting"><img src="https://agentmods.dev/badge/skills/cardstack/boxel/host-test-memory-leak-hunting/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.

agentmods 80×15 button for host-test-memory-leak-hunting

Your own site · 80×15
<a href="https://agentmods.dev/skills/cardstack/boxel/host-test-memory-leak-hunting"><img src="https://agentmods.dev/badge/skills/cardstack/boxel/host-test-memory-leak-hunting.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 89 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,587 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.00089 $0.02587
Opus 5.5 $0.00036 $0.01035
Sonnet 5.5 $0.00018 $0.00517
Haiku 4.5 $0.00009 $0.00259

Measured 5d ago against content hash f12524be8af5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

host-test-memory-leak-hunting scanned grade A with 1 finding 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 5d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -sX PUT "http://localhost:9333/json/new?${ENCODED}"
.claude/skills/host-test-memory-leak-hunting/SKILL.md · 136 lines

How it starts

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

Host test memory leak hunting

The host test suite is large enough that a per-test leak as small as 5 MB will OOM a CI shard before the suite finishes. This skill is the playbook for finding and validating fixes. It exists because a single leak hunt can take days if you don't have the loop tightened — Chrome heap snapshots are slow, big, and ambiguous unless you reduce them to retainer paths.

See known-leaks.md for the catalog of leaks found so far and the patterns that cause them. Read it first — most "new" leaks rhyme with one of those.

When to use

  • CI host-test shard OOMs (V8 Reached heap limit Allocation failed in the test log).
  • Local pnpm test shows MEMPROBE used= climbing every 10 tests.
  • New feature added a service, modifier, or globalThis closure that captures the test's owner.
  • After landing a fix that is supposed to flatten the slope — verify before declaring victory.

What's already in the suite

Two pieces of permanent instrumentation in packages/host/tests/helpers/setup-qunit.js:

  1. Forced GC every test (requires Chrome --js-flags="--expose-gc"). Without this V8's opportunistic GC can't keep up and the heap drifts toward the 4GB ceiling regardless of leak size.
  2. MEMPROBE log line every 10 tests with used=/total=/app_instances=/alive=/destroying=/destroyed= — visible in CI output and used by the snapshot runner to trigger snaps.

Three diagnostic scripts in packages/host/scripts/ (only used during a hunt):

  • heap-snapshot-runner.js — CDP client. Watches Chrome console for PROBE t=N; at configured indices, takes a heap snapshot and streams chunks to disk (joining blows V8's max string length past ~300MB).
  • snapshot-diff.js — top-N constructor counts/retained-sizes that grew between two snapshots.
  • snapshot-retainers.js — backward BFS from target nodes to GC roots. Flags: --type=<native|object|closure|string>, --min-size=N, --strong (skips weak/shortcut AND WeakMap "part of key" internal edges; use this — it's the difference between a misleading WeakMap path and the real strong retainer).
  • snapshot-by-class.js — like snapshot-diff but truncates long names so output is scannable.
  • snapshot-diff-stream.js / snapshot-retainers-stream.js — use these when a snapshot file is >500 MB. Same flags and output as the non-streaming versions; they use stream-json to avoid fs.readFileSync('utf8') (which throws ERR_STRING_TOO_LONG above V8's ~512 MB cap). The retainers-stream variant also buffers nodes/edges into a growable Float64Array so huge snapshots don't hit Invalid array length around 100M+ items. Just swap the script name; all arguments are identical.

Read the full file on GitHub · 136 lines

Files

What ships with it

1 file 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.

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. 5d ago First seen · 136 lines · 89 tokens per session scan A f12524be8af5

Subscribe to this mod's changes

host-test-memory-leak-hunting is a skill published in the GitHub repository cardstack/boxel (27 stars, last pushed today), licensed MIT. It adds 89 tokens to every session and 2,587 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-21.

Related

Other skills, from other repositories

systematic-debugging

4-phase root cause debugging: understand bugs before fixing.

NousResearch/hermes-agent · 16 tokens

langsmith-observability

LLM observability platform for tracing, evaluation, and monitoring. Use when debugging LLM applications, evaluating model outputs against datasets, monitoring production systems, or building systematic testing pipelines for AI applications.

davila7/claude-code-templates · 45 tokens

experimental-code-coverage-local-debugger

Runs code coverage locally via Universal Test Runner (UTR) or helper scripts, mimicking LUCI trybots. Activate when CQ tryjobs fail or underreport coverage, to test local GN/recipe repairs before uploading, or to debug hermetic crashes.

chromium/chromium · 59 tokens

verify-omnigent

Drive Omnigent the way a user does and prove a behavior with recorded evidence, using an isolated server, runner, and mock model plus a feature map of every user entry point. Load before reproducing a user-facing bug, before claiming a fix works, or when reviewing whether a change covered every surface (session vs.…

omnigent-ai/omnigent · 100 tokens

cli-e2e

Write, modify, or debug Docker-based Composio CLI end-to-end tests under ts/e2e-tests/cli, including binary invocation, fixture isolation, output assertions, and package manifests. Use for CLI E2E test suites only; use cli-command for CLI source implementation.

ComposioHQ/composio · 62 tokens

adversarial-reviewer

Stress-test a code change for concrete correctness defects, unsafe assumptions, and failure modes. Use when the user explicitly asks for an adversarial review, a deep bug hunt, or to tear a change apart, or to check your own change before submitting it. Do not use for ordinary review, style feedback, or general…

emdash-cms/emdash · 72 tokens