.claude/skills/review-resource-leaks-open/SKILL.md
Open Audit for memory leaks, handle leaks, GDI leaks, and CPU churn
npx skillsauth add cwilliams5/Alt-Tabby review-resource-leaks-openInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Enter planning mode. Systematically audit the codebase for resource/memory leaks and unnecessary CPU churn. Use maximum parallelism — spawn explore agents for independent areas.
gD2D_Res brush/font cache — intentional lifetime cache, cleaned up on exitstatic buffers in hot-path functions — intentional reuse per ahk-patterns.md.bak sentinel files — intentional crash-safety patternAfter explore agents report back, validate every finding yourself. Resource "leaks" are frequently false positives where cleanup happens in a different function, on a timer, or at process exit.
For each candidate:
file.ahk lines X–Y" with actual code quoted.Group by severity (per-paint > per-event > per-session > theoretical):
| File | Lines | Resource Type | Leak Description | Impact | Fix |
|------|-------|--------------|-----------------|--------|-----|
| file.ahk | 42–58 | D2D Brush | D2D brush created in paint loop, never released | ~60 handles/sec | Use D2D_GetCachedBrush or static |
For CPU churn findings, use a separate table:
| File | Lines | Pattern | Frequency | Fix |
|------|-------|---------|-----------|-----|
| file.ahk | 100–120 | Timer polls every 100ms, no-ops 99% of the time | 10/sec idle | Adaptive interval or event-driven |
Ignore any existing plans — create a fresh one.
tools
Create a new git worktree and switch the session into it
tools
Spawn agent to trace code flow via query tools — answer only, no context cost
tools
Commit, push, and create a PR for the current branch
tools
Retire a shader by moving its files to legacy/shaders_retired