Skip to content
Development
Command

/find-leaks

Detect and diagnose memory leaks in the application.

From plugin
rohitg00-claude-code-toolkit
2.5k199 skills138 agents199 commands
Install
$ npx -y skills add rohitg00/awesome-claude-code-toolkit --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/find-leaks

Context preview

What this command does when you run it.

Detect and diagnose memory leaks in the application.

Command definition

find-leaks.md

/find-leaks - Find Memory Leaks

Detect and diagnose memory leaks in the application.

Steps

1. Configure the application for leak detection with appropriate tooling 2. Establish a baseline memory measurement at application startup 3. Run a repetitive workload: process N requests, render N times, or execute N iterations 4. Measure memory after each iteration to detect steady growth 5. Force garbage collection between measurements to isolate true leaks 6. Identify objects that grow in count across iterations without being released 7. Trace the retention path: what is holding references to leaked objects 8. Check common leak sources:

  • Event listeners not removed on cleanup
  • Closures capturing large scopes
  • Growing caches without eviction
  • Circular references preventing GC
  • Timers and intervals not cleared

9. For each leak, identify the source file, line, and the allocation site 10. Suggest specific fixes: removeEventListener, WeakRef, cache size limits 11. Verify the fix by re-running the leak detection scenario 12. Report: leaks found, estimated memory impact, fix suggestions

Rules

  • Run leak detection for at least 100 iterations to confirm a pattern
  • Distinguish between expected memory growth and actual leaks
  • Check both heap memory and native memory (buffers, file handles)
  • Verify leaks are reproducible before reporting
  • Consider the application lifecycle; some growth is expected during warmup
  • Check for connection pool leaks (database, HTTP, WebSocket)
  • Report the growth rate (bytes per iteration) for each detected leak
Read more
Ships withrohitg00-claude-code-toolkit

The most comprehensive toolkit for Claude Code -- 135 agents, 35 curated skills (+400,000 via SkillKit), 42 commands, 176+ plugins, 20 hooks, 15 rules, 7 templates, 15 MCP configs, 26 companion apps, 53 ecosystem entries, and more.

Get the whole plugin