flutter-memory-leak-engineering

flutter-memory-leak-engineering is a skill for Claude Code, Codex from ariaramin/flutter-skills. It costs 131 tokens per session (4,086 once invoked), scanned A, original, MIT.

A guide for finding and preventing Flutter and Dart lifecycle memory defects. It checks whether controllers, subscriptions, and similar resources are properly disposed of and uses leak-tracking tools and DevTools to investigate retained memory.

In plain words
What is it for?
Use it to inspect ownership and cleanup, investigate controllers and listeners that outlive their widgets, diagnose retaining references, and add regression tests for fixed lifecycle bugs.
Why use it?
It distinguishes a resource that was not cleaned up from memory that remains reachable for another reason. This avoids hiding failures or treating every increase in process memory as the same kind of leak.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to inspect ownership and cleanup, investigate controllers and listeners that outlive their widgets, diagnose retaining references, and add regression tests for fixed lifecycle bugs.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ariaramin/flutter-skills/flutter-memory-leak-engineering
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ariaramin/flutter-skills --skill flutter-memory-leak-engineering
Clone the repo
git clone --depth 1 https://github.com/ariaramin/flutter-skills

Made for: Claude Code, Codex.

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 flutter-memory-leak-engineering

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/ariaramin/flutter-skills/flutter-memory-leak-engineering"><img src="https://agentmods.dev/badge/skills/ariaramin/flutter-skills/flutter-memory-leak-engineering.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 131 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,086 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00131 $0.04086
Opus 5.5 $0.00052 $0.01634
Sonnet 5.5 $0.00026 $0.00817
Haiku 4.5 $0.00013 $0.00409

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

Security

Grade A, and why

flutter-memory-leak-engineering 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 7d 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.

skills/flutter-memory-leak-engineering/SKILL.md · 418 lines

How it starts

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

Flutter Memory Leak Engineering

Operating rules

  • Diagnose ownership before adding cleanup calls.
  • Treat leak_tracker as lifecycle verification, not as a universal heap leak detector.
  • Distinguish notDisposed, notGCed, and gcedLate; they describe different failures and require different fixes.
  • Separate disposal from garbage collection: disposed objects can remain retained, and collected objects can still have violated a cleanup contract.
  • Prefer one clear owner for every disposable/cancelable/removable resource.
  • Keep longer-lived objects from retaining shorter-lived widgets, routes, sessions, controllers, or BuildContext unless the lifetime is intentional.
  • Use standard not-disposed checking as the high-signal default; enable expensive/experimental retention diagnostics only for focused investigations.
  • Do not silence failures before finding the creation site, owner, teardown path, and retaining reference.
  • Do not treat increasing RSS as proof of a tracked Dart lifecycle leak.
  • Escalate unresolved growth or retaining chains to Flutter DevTools Memory.
  • Keep fixed lifecycle bugs as deterministic regression tests.
  • Preserve repository architecture unless ownership/lifetime is actually wrong.

Research baseline and freshness

The supplied guide targets leak_tracker 11.0.2 and the current split between:

  • leak_tracker for core tracking/classification;
  • leak_tracker_testing for test helpers;
  • leak_tracker_flutter_testing for Flutter widget-test integration;
  • Flutter FlutterMemoryAllocations for framework lifecycle instrumentation;
  • Flutter DevTools Memory for heap, diff, allocation, and retaining-reference investigation. The guide explicitly notes that direct leak-tracker DevTools integration from older releases was removed in 11.0.0. Do not copy old tutorials that assume that integration still exists.

Before implementation:

  1. inspect pubspec.yaml and pubspec.lock;
  2. identify Flutter and Dart versions;
  3. identify current leak-tracker package versions;
  4. verify experimentalLeakTesting, LeakTesting.settings, and allocation instrumentation against that SDK;
  5. treat running-app, Web, not-GCed, and other experimental behavior as version-sensitive.

Read the full file on GitHub · 418 lines

Files

What ships with it

5 files 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. 7d ago First seen · 418 lines · 131 tokens per session scan A 1d891fb728d1

Subscribe to this mod's changes

flutter-memory-leak-engineering is a skill published in the GitHub repository ariaramin/flutter-skills (6 stars, last pushed 7d ago), licensed MIT. It adds 131 tokens to every session and 4,086 once invoked, about $0.0005 per session on Opus 5.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-10-11.