Borrowing it
Nothing to install: this file belongs to SegfaultSorcerer/heap-seance. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/SegfaultSorcerer/heap-seance/main/.claude/commands/leak-deep.mdgit clone --depth 1 https://github.com/SegfaultSorcerer/heap-seanceWrote 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/commands/segfaultsorcerer/heap-seance/leak-deep)<a href="https://agentmods.dev/commands/segfaultsorcerer/heap-seance/leak-deep"><img src="https://agentmods.dev/badge/commands/segfaultsorcerer/heap-seance/leak-deep/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/commands/segfaultsorcerer/heap-seance/leak-deep"><img src="https://agentmods.dev/badge/commands/segfaultsorcerer/heap-seance/leak-deep.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.00082 | $0.01346 |
| Opus 5 | $0.00041 | $0.00673 |
| Sonnet 5 | $0.00016 | $0.00269 |
| Haiku 4.5 | $0.00008 | $0.00135 |
Grade A, and why
leak-deep 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 9d 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.
How it starts
The opening of the file, as written. The whole thing — 95 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Run full deep Java leak forensics for $ARGUMENTS.
Interpret $ARGUMENTS as either a PID (integer) or a process name/pattern (string).
This command runs deep evidence collection unconditionally — it does not wait for scan signals to justify escalation. Use it when you already suspect a leak or want comprehensive evidence.
Step 1: Resolve target process
- If
$ARGUMENTSis an integer, use it directly as PID. - If
$ARGUMENTSis empty, calljava_list_processes()and list all discovered JVMs so the user can choose. Do not pick one silently. - If
$ARGUMENTSis a string, calljava_list_processes()and match by substring against each processdisplayfield (case-insensitive). If exactly one process matches, use it. If multiple match, list them and ask the user to narrow down. If none match, report this and stop.
Step 2: Capture baseline signals
These establish the growth and GC context that deep tools will corroborate or refute.
- Collect 3 histogram samples with
java_class_histogram(pid, live_only=true). Between each sample, ask the user to perform the suspected leaking action in their application (e.g., open/close a view, send requests, load/discard data) and confirm when done. Without exercising the app between snapshots, leaks stay invisible. This gives the monotonic growth baseline — classes whose retained bytes rise across all 3 snapshots are candidates. - Collect GC snapshot with
java_gc_snapshot(pid, interval_s=2, samples=6). This reveals whether old-gen is under pressure and Full GCs are occurring.
Step 3: Deep evidence collection
Run all of these unconditionally, in sequence:
- JFR recording:
java_jfr_start(pid, profile="profile", duration_s=45)— captures allocation events, GC activity, and object count data over 45 seconds. - JFR summary:
java_jfr_summary(jfr_file)— extracts event types and counts. Look forjdk.ObjectCountAfterGCevents and whether growth candidate classes appear in allocation-heavy events. - Heap dump:
java_heap_dump(pid, live_only=true)— full reachable-object snapshot.live_only=truetriggers GC first so the dump contains only retained objects, making dominator analysis cleaner. - MAT leak suspects:
java_mat_suspects(heap_dump_file)— runs Eclipse MAT's automated leak suspect analysis. This is the strongest signal: it identifies dominator holders, accumulation points, and retained byte chains. - Allocation profile:
java_async_alloc_profile(pid, duration_s=30)— flame graph of allocation hot spots. Only if async-profiler is available. Useful as tie-breaker when MAT and JFR are ambiguous.
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.
- 9d ago First seen · 95 lines · 82 tokens per session scan A 7f5eb789e813
leak-deep is a command published in the GitHub repository SegfaultSorcerer/heap-seance (4 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 82 tokens to every session and 1,346 once invoked, about $0.0004 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.
Other commands, from other repositories
qa-changes
This skill should be used when the user asks to "QA a pull request", "test PR changes", "verify a PR works", "functionally test changes", or when an automated workflow triggers QA validation of code changes. Provides a structured methodology for setting up the environment, exercising changed behavior, and reporting…
doctor
Diagnosticar y reparar problemas del framework Don Cheli, git y entorno. Usa cuando el usuario dice "doctor", "problemas del framework", "don cheli no funciona", "repair Don Cheli", "debug setup", "setup broken", "framework broken", "reparar entorno". Detecta y repara issues de configuración, git y dependencias…
fix
Universal debugging and fix application with semantic code analysis.
doctor
Badi configuration validation. Checks all Badi components and produces a diagnostic report.
http-service
Build, review or debug a Bun HTTP service. Loads the http-service skill, then works the task through its workflow.
gh-issue-use-cypress
Like /gh-issue-use-browser, but pinned to the Cypress MCP — use when your project runs the Cypress MCP for browser automation. Example — /gh-issue-use-cypress "Composer > Save" saving toasts failure but the record persists.