Diagnoses garbage-collection and memory pressure across .NET, JVM, Go, Node/V8, and Python runtimes. Recommends config, allocation, retention, and pooling fixes based on GC logs, heap snapshots, and container limits.
Ships in AI for Developers Toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Diagnose why the garbage collector (or the memory manager) is working hard and recommend concrete fixes - runtime config, allocation reduction, retention fixes, and pooling - based on data, not guesses.
Works on a target (a project, repo, or GitHub URL) and/or data the user shares: GC counters, GC logs, gctrace output, heap snapshots, RSS graphs, container limits, OOM events. If no data is available, tell the user exactly what to capture first (see per-runtime "Measure") and audit config and code in the meantime.
| Manifest | Runtime | Where GC config lives |
|---|---|---|
*.csproj | .NET CLR | .csproj properties, runtimeconfig.json, DOTNET_* env vars |
pom.xml, build.gradle(.kts) | JVM | JVM flags in Dockerfile/JAVA_TOOL_OPTIONS/start scripts |
go.mod | Go | GOGC, GOMEMLIMIT env vars, debug.SetGCPercent / debug.SetMemoryLimit |
package.json | Node (V8) | node flags / NODE_OPTIONS |
pyproject.toml, requirements*.txt | CPython | gc module calls, server config (gunicorn/uvicorn workers), allocator env vars |
Then check deployment: container memory/CPU limits (Dockerfile, k8s manifests, Helm values). Most GC misbehavior in containers is a runtime that doesn't know, or isn't told, its real limit.
memory-allocation-analyzer).Measure: dotnet-counters monitor -p <pid> --counters System.Runtime (GC heap size, gen 0/1/2 counts, % time in GC, allocation rate, LOH size); dotnet-trace with the GC providers; dotnet-gcdump for retention.
Config sweep: grep -rn "ServerGarbageCollection\|ConcurrentGarbageCollection\|GCHeapHardLimit\|GarbageCollectionAdaptationMode" <target> plus .csproj/runtimeconfig.json.
<ServerGarbageCollection>true</ServerGarbageCollection>; ASP.NET Core defaults to it). Workstation GC on a busy server = avoidable pauses.ArrayPool<T>.Shared, RecyclableMemoryStream), stream instead of buffering, chunk large payloads.GC.AllocateArray(..., pinned: true)) for buffers that must stay pinned.GCHeapHardLimit/GCHeapHardLimitPercent when other memory in the process needs explicit headroom.Measure: unified GC logs -Xlog:gc*:file=gc.log, JFR (jcmd <pid> JFR.start) for GC pauses and allocation by stack, async-profiler in alloc mode, jcmd <pid> GC.heap_info, heap dump + Eclipse MAT for retention.
-XX:+UseZGC; generational ZGC is available from JDK 21 and the default mode in newer JDKs). Parallel GC for pure batch throughput.-XX:MaxRAMPercentage (e.g. 70-80%) over a hard-coded -Xmx so the heap follows the container limit; leave room for metaspace, thread stacks, direct buffers. Set -Xms equal to -Xmx for services where predictable footprint matters.-XX:G1HeapRegionSize.-XX:MaxGCPauseMillis is a target, not a guarantee; tightening it trades throughput.ObjectMapper/formatter creation.-XX:MaxDirectMemorySize, Native Memory Tracking -XX:NativeMemoryTracking=summary).Measure: GODEBUG=gctrace=1 (per-GC heap sizes and pause times), runtime/metrics or runtime.ReadMemStats, go tool pprof heap profile (-sample_index=alloc_space for allocation volume, inuse_space for retention).
GOGC=off with care) for steady memory use.go build -gcflags=-m ./... shows what escapes to the heap. Common causes: returning pointers to locals, storing in interfaces, closures capturing variables, slices whose size isn't known at compile time.sync.Pool for short-lived buffers on hot paths; preallocate slices/maps with capacity; strings.Builder/bytes.Buffer reuse.Measure: node --trace-gc, process.memoryUsage() (heapUsed vs rss vs external/arrayBuffers), PerformanceObserver for gc entries, heap snapshots (--heapsnapshot-signal, Chrome DevTools via --inspect, v8.writeHeapSnapshot()), --heap-prof for allocation sampling, clinic.js heapprofiler.
--max-old-space-size (MB) to roughly 75% of the container limit, leaving room for Buffers and native memory.--max-semi-space-size can reduce promotion for allocation-heavy workloads - measure before keeping it.Buffers live outside the V8 heap (external/arrayBuffers); stream instead of readFile + concat for big payloads.Measure: RSS over time, tracemalloc snapshots (compare two), memray for native + Python allocations, gc.get_stats() / gc.callbacks for collection counts and pause time, objgraph for growth by type, scalene for per-line memory.
gc only handles reference cycles. Frequent gc runs mean many container allocations; long pauses mean large tracked object graphs.weakref.gc.get_threshold() / gc.set_threshold() tune collection frequency; raise only with measurements. Don't gc.disable() in long-running services.gc.freeze() after loading the app moves startup objects out of collection, reducing copy-on-write memory growth in workers.MALLOC_ARENA_MAX, jemalloc, or recycling workers (max_requests).functools.lru_cache without maxsize on methods (it also keeps self alive), growing lists of results.## Detected
<runtime + version, collector/config in use, container limits>
## Diagnosis
<symptom class: allocation rate / retention / large objects / heap sizing - and the evidence>
## Findings
1. [config] <file/setting> - <problem> -> <fix>
2. [allocation] <file:line> - <source> -> <fix>
3. [retention] <type/cache> - <why it grows> -> <fix>
## Recommended config
<exact settings/flags/env vars for this runtime>
## Measure next
<what to capture to confirm, and what "fixed" looks like>
"Why is GC eating CPU", "reduce GC pauses in this service", "LOH keeps growing", "should I use Server GC", "G1 or ZGC for this service", "tune GOGC/GOMEMLIMIT for our pods", "JavaScript heap out of memory", "Python worker memory keeps growing". Pairs with memory-allocation-analyzer and hotpath-profiler-assistant.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
gc-tuning, memory-pressure, oom-diagnosis, heap-analysis, runtime-config
/ai-dev-toolkit:gc-pressure-auditorfrom AI for Developers Toolkit
npx claudepluginhub stefanthecode/ai-for-developers --plugin ai-dev-toolkit45 skills in this plugin
/api-endpoint-scaffolderScaffold HTTP API endpoints in any stack - ASP.NET Core Minimal APIs or controllers, Express, Fastify, NestJS, FastAPI, Django REST Framework, Spring Boot controllers, Go net/http, chi, Gin - one feature per endpoint (REPR style) with request validation, typed responses, route grouping, auth, and OpenAPI metadata. Use this skill whenever the user wants to add an endpoint or route, convert controllers to minimal APIs, structure routes or routers, set up endpoint groups, TypedResults, route handlers, request DTOs/schemas (zod, Pydantic, Bean Validation, binding tags), or asks "how do I add an endpoint / structure my API routes". Always use this skill for endpoint scaffolding; it generates a complete, validated endpoint that matches the project's conventions./architecture-test-generatorGenerate architecture tests / fitness functions that fail the build when architectural rules are violated - layer dependencies, module boundaries, cycles, naming, and visibility conventions - in any stack: NetArchTest or ArchUnitNET (.NET), ArchUnit or Konsist (Java/Kotlin), dependency-cruiser or eslint-plugin-boundaries (TypeScript/JavaScript), import-linter (Python), go-arch-lint or depguard (Go). Use this skill whenever the user wants architecture tests, to enforce layering or the dependency rule, dependency rules as tests, import rules, forbidden imports, no circular dependencies, naming conventions, fitness functions, or asks "how do I stop people breaking the architecture / enforce my layers / keep modules from importing each other". Always use this skill for architecture-test requests; it generates rules matching the project's real structure./async-await-auditorAudit async and concurrent code in any language for correctness and performance bugs - C#/.NET (async/await, Task), JavaScript/TypeScript (Promises, async/await), Python (asyncio), Java/Kotlin (CompletableFuture, virtual threads, coroutines), Go (goroutines, channels, context), Rust (tokio/async). Use this skill whenever the user shares async or concurrent code, or asks about deadlocks, hangs, blocking calls, .Result/.Wait(), async void, ConfigureAwait, floating or unhandled promises, await in a loop vs Promise.all, blocking the event loop, forgotten await, asyncio.gather/TaskGroup, CompletableFuture.join, virtual thread pinning, goroutine leaks, context cancellation, WaitGroup/errgroup, holding a lock across .await, fire-and-forget tasks, cancellation tokens, or "why does my async code hang". Always use this skill for async/concurrency reviews instead of answering from memory; it applies a fixed checklist and rewrites the code./authorization-setupDesign API authorization in any stack - policy-based, role-based, claims/permission-based, and resource-based (ownership) checks. Covers ASP.NET Core policies and AuthorizationHandler, NestJS guards, Express middleware and CASL, FastAPI dependencies/scopes, Django and DRF permission classes, Spring Security (@PreAuthorize, SecurityFilterChain), Go middleware, and Casbin/OPA. Use this skill whenever the user wants authorization policies, role/claim/permission checks, RBAC/ABAC, custom authorization rules, resource-based authorization, IDOR protection, "deny by default", or asks "how do I authorize this / policy vs role / restrict this endpoint to X / stop users seeing other users' data". Always use this skill for authorization requests; it generates policies, handlers, and endpoint wiring./benchmark-setupSet up correct micro-benchmarks in any stack and interpret the results - BenchmarkDotNet (.NET), JMH (Java/Kotlin), pytest-benchmark / pyperf (Python), Vitest bench / tinybench / mitata (JavaScript/TypeScript), Go testing.B + benchstat, Rust criterion. Use this skill whenever the user wants to benchmark code, measure performance, compare two implementations or functions, set up a benchmark harness, or asks "which is faster", "benchmark these two functions", "how do I benchmark this", "is this optimization worth it", or "interpret these benchmark results". Always use this skill for micro-benchmarking requests; it writes correct benchmarks, avoids the classic pitfalls, and explains the numbers./caching-strategy-setupAdd the right caching to an app in any stack - in-process, distributed (Redis/Valkey/Memcached), two-level, or HTTP/output caching - with correct keys, expiration, stampede protection, and invalidation. Covers HybridCache / IMemoryCache / IDistributedCache / output caching in .NET, lru-cache / keyv / cache-manager / ioredis in Node, functools / cachetools / redis-py / Django cache in Python, Spring Cache with Caffeine or Redis in Java/Kotlin, and ristretto / groupcache / singleflight / go-redis in Go. Use this skill whenever the user wants caching, to cache a query/response, Redis caching, @Cacheable, lru_cache, HybridCache, cache-aside, output caching, or asks "how do I cache this / add caching / avoid cache stampede / invalidate this cache". Always use this skill for caching requests; it picks the right layer and wires expiration + invalidation correctly.Other plugins' skills for the same job