resource-lifecycle-auditor

resource-lifecycle-auditor is an agent for Claude Code from acaprino/daodan. It costs 142 tokens per session (2,754 once invoked), scanned A, original, MIT.

A code-review guide for checking that resources such as files, connections, streams, locks, and event listeners are released correctly.

In plain words
What is it for?
Use it to trace resource ownership and verify cleanup on successful, failed, and cancelled operations.
Why use it?
It helps find leaks, double releases, and use-after-release bugs, including failures during errors and cancellation.

Agent for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: model in frontmatter.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the senior-review plugin — 3 skills, 3 commands, 12 agents shipped together

Good fit Use it to trace resource ownership and verify cleanup on successful, failed, and cancelled operations.

Compare 6 agents from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add acaprino/daodan
Claude Code
/plugin install senior-review

Made for: Claude Code.

Or install senior-review, the plugin that ships this one along with the rest of its 3 skills, 3 commands, 12 agents.

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 resource-lifecycle-auditor

README.md
[![agentmods](https://agentmods.dev/badge/agents/acaprino/daodan/resource-lifecycle-auditor/github.svg)](https://agentmods.dev/agents/acaprino/daodan/resource-lifecycle-auditor)
Your own site
<a href="https://agentmods.dev/agents/acaprino/daodan/resource-lifecycle-auditor"><img src="https://agentmods.dev/badge/agents/acaprino/daodan/resource-lifecycle-auditor/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 resource-lifecycle-auditor

Your own site · 80×15
<a href="https://agentmods.dev/agents/acaprino/daodan/resource-lifecycle-auditor"><img src="https://agentmods.dev/badge/agents/acaprino/daodan/resource-lifecycle-auditor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 142 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,754 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.00142 $0.02754
Opus 5.5 $0.00057 $0.01102
Sonnet 5.5 $0.00028 $0.00551
Haiku 4.5 $0.00014 $0.00275

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

Security

Grade A, and why

resource-lifecycle-auditor 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 8d 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.

exports/claude/plugins/senior-review/agents/resource-lifecycle-auditor.md · 159 lines

How it starts

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

Resource Lifecycle Auditor

You are a resource-ownership analyst. Every resource a program acquires is a debt, and your job is to audit the repayment plan. The defining question: who owns this, and does it get released on success, on error, AND on cancellation? Three paths, not one. Most leaks live on the paths nobody wrote: the exception between acquire and the release ten lines later, the promise that was cancelled, the component unmounted mid-request, the goroutine whose channel reader gave up.

PRIME DIRECTIVES

  1. Every acquire has three exits. Success, error, cancellation. A release that covers one of them is a leak with extra steps. Trace all three explicitly for every acquisition.
  2. Ownership must be singular and nameable. If you cannot say which scope, object, or task owns a resource, neither can the code, and both double-release and never-release become reachable. "Shared ownership" without a refcount or an explicit protocol is a finding.
  3. Cancellation is the forgotten path. Async systems multiply it: aborted requests, unmounted components, cancelled contexts, dropped futures, closed channels. Audit what happens to in-flight acquisitions when the surrounding operation is abandoned.
  4. Concrete evidence only. Every finding cites file:line for the acquisition AND for the missing or broken release path. No vague "this might leak".
  5. Prefer structural fixes. RAII, with/using/defer, try/finally, AbortController, scope-bound subscriptions. A manually paired open/close fixed today leaks again on the next edit; say so in the fix.
  6. No capability listing. Deliver findings immediately.

KNOWLEDGE BASE

Before analysis, load references from the defect-taxonomy skill using Read tool from ${CLAUDE_PLUGIN_ROOT}/skills/defect-taxonomy/references/:

  1. Always load: memory-resources.md -- leak categories, handle exhaustion, lifetime bugs
  2. When async/concurrent: concurrency-state.md -- task lifetimes, lock ordering, abandoned workers
  3. When scoring: review-frameworks.md

Read the full file on GitHub · 159 lines

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. 8d ago Changed · +16 lines c76c07d02040
  2. 1mo ago First seen · 143 lines · 142 tokens per session scan A f92aa58abe0c

Subscribe to this mod's changes

resource-lifecycle-auditor is an agent published in the GitHub repository acaprino/daodan (9 stars, last pushed today), licensed MIT. It adds 142 tokens to every session and 2,754 once invoked, about $0.0006 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-09-05.

Related

Other agents, from other repositories

build-failure-analyst

Expert build-failure analyst for .NET / MSBuild repositories. Invoke when a build produced a binary log (.binlog) and you need to identify the root cause(s) of failure, group related errors, and propose concrete fixes. Queries the binlog live through the binlog-mcp MCP server (containerised — see the calling…

dotnet/skills · 108 tokens

swiftui-performance-analyzer

Use this agent when the user mentions SwiftUI performance, janky scrolling, slow animations, or view update issues — expensive bodies, formatters, whole-collection dependencies, and missing lazy containers.

CharlesWiltgen/Axiom · 45 tokens

predictive-analyst

Precognition agent. Analyzes code changes to predict impact, regressions, and conflicts BEFORE they happen. Uses dependency graphs and historical data.

softspark/ai-toolkit · 35 tokens

gentle-ai-explore

Read-only exploration and mapping for generic non-SDD work.

Gentleman-Programming/gentle-pi · 18 tokens

silent-failure-hunter

Use this agent when reviewing code changes in a pull request to identify silent failures, inadequate error handling, and inappropriate fallback behavior. Invoke it after work involving error handling, catch blocks, fallback logic, or any code that could suppress errors. See "When to invoke" in the agent body for…

nota-america/forgecat-agent-profiles · 67 tokens

code-reviewer-bug

name: code-reviewer-bug description: Specialized code reviewer for bug patterns — null safety, race conditions, resource leaks, logic and error-handling defects. Returns scored findings (severity × impact × confidence). skills: code-review model: inherit.

zxpmail/ReqForge · 0 tokens