media-gc

media-gc is a skill for Claude Code from aotter/mantle. It costs 50 tokens per session (867 once invoked), scanned A, original, Apache-2.0.

A maintenance guide for finding stale, unfinished public media uploads in a Cloudflare R2 storage bucket. R2 is cloud storage for files such as images.

In plain words
What is it for?
It is for checking Mantle media storage, identifying old objects without commit records, and deleting only approved objects that match the project's declared layout.
Why use it?
It helps distinguish abandoned uploads from committed media and prevents accidental deletion by requiring an audit and exact approval before removal.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the mantle plugin — 8 skills shipped together

Good fit It is for checking Mantle media storage, identifying old objects without commit records, and deleting only approved objects that match the project's declared layout.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/aotter/mantle/media-gc
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 aotter/mantle --skill media-gc
Clone the repo
git clone --depth 1 https://github.com/aotter/mantle

Made for: Claude Code.

Or install mantle, the plugin that ships this one along with the rest of its 8 skills.

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 media-gc

README.md
[![agentmods](https://agentmods.dev/badge/skills/aotter/mantle/media-gc/github.svg)](https://agentmods.dev/skills/aotter/mantle/media-gc)
Your own site
<a href="https://agentmods.dev/skills/aotter/mantle/media-gc"><img src="https://agentmods.dev/badge/skills/aotter/mantle/media-gc/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 media-gc

Your own site · 80×15
<a href="https://agentmods.dev/skills/aotter/mantle/media-gc"><img src="https://agentmods.dev/badge/skills/aotter/mantle/media-gc.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 867 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.00050 $0.00867
Opus 5 $0.00025 $0.00434
Sonnet 5 $0.00010 $0.00173
Haiku 4.5 $0.00005 $0.00087

Measured 9d ago against content hash b9aa15133aa6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

media-gc 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 9d 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/media-gc/SKILL.md · 86 lines

How it starts

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

Mantle Media GC

Use the connected Cloudflare API. Audit by default; delete only the exact objects approved by the user.

Preflight

  1. Read the project's Wrangler config and Mantle config. Resolve the R2 bucket binding, bucket name, and declared public media purpose names.
  2. Confirm the exact Cloudflare account and bucket. If either is ambiguous, ask; never choose by name similarity.
  3. Use the Cloudflare OpenAPI search before execution to resolve the current R2 List Objects and Delete Objects endpoints. If the connected account lacks access, stop. Do not create, request, or store credentials.
  4. Stop when the project has no public R2 media binding or no declared purpose.

Audit

For each declared purpose, list up to 1,000 objects per page under the exact <purpose>/ prefix. Use the API cursor until is_truncated is false.

An object is a deletion candidate only when all conditions hold:

  • last_modified is more than 24 hours old;
  • custom_metadata.committedAt is absent or empty;
  • the key matches the exact Mantle layout <purpose>/<group>/(primary|alternate|fallback).(png|jpg|webp|avif|gif|svg), where <purpose> is declared by this project and <group> contains only letters, digits, _, or -.

Skip committed, unknown-prefix, unprefixed, malformed, or ambiguous objects. Delete only an uncommitted variant, never its whole group.

Report the account, bucket, purpose prefixes, UTC cutoff, candidate object and group counts, total bytes, skipped count, and a SHA-256 digest of the sorted key + etag candidate set. Do not print object keys, upload group IDs, filenames, public URLs, signed URLs, or secrets.

Apply

  1. Show the audit summary and get explicit confirmation for that exact account, bucket, cutoff, count, byte total, and candidate-set digest.
  2. Re-run the complete audit with the same UTC cutoff. If the candidate count, bytes, or digest changed, stop and present the new audit for confirmation.
  3. Call Delete Objects with JSON arrays of exact keys, at most 1,000 keys per request. Never send the prefix query parameter: an empty prefix can empty the bucket.
  4. Do not automatically retry failed keys. Report safe API error codes and counts; a later invocation can audit and retry what remains.
  5. Re-list every inspected purpose prefix and report the remaining candidate count and bytes.

Read the full file on GitHub · 86 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. 9d ago First seen · 86 lines · 50 tokens per session scan A b9aa15133aa6

Subscribe to this mod's changes

media-gc is a skill published in the GitHub repository aotter/mantle (4 stars, last pushed today), licensed Apache-2.0. It adds 50 tokens to every session and 867 once invoked, about $0.0003 per session on Opus 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-08-31.

Related

Other skills, from other repositories

api-workers

Cloudflare Workers deployment using createWorkerHandler from @cyanheads/mcp-ts-core/worker. Covers the full handler signature, binding types, CloudflareBindings extensibility, runtime compatibility guards, and wrangler.toml requirements.

cyanheads/obsidian-mcp-server · 51 tokens

coolify

Operate a Coolify self-hosted PaaS through the @masonator/coolify-mcp server. Use this skill whenever the user asks Claude to inspect, deploy, restart, debug, or manage anything on Coolify — including applications, databases, services, servers, projects, environments, deployments, environment variables, private keys…

StuMason/coolify-mcp · 156 tokens

discovery-patterns

Configure ServiceNow Discovery — schedules, IP ranges, credential affinities, MID Server assignment, custom probes/sensors, identification rules, and run-status monitoring on discovery tables.

serac-labs/serac · 40 tokens

agoragentic-deploy

Prepare a bounded Agoragentic deployment handoff or preview. Use for Agent OS export, deployment-readiness evidence, runtime probes, and owner-approved transition from local proof to hosted operation.

rhein1/agoragentic-integrations · 45 tokens

coolify-compose

Convert Docker Compose files to Coolify templates. Use when creating Coolify services, converting docker-compose.yml for Coolify deployment, working with SERVICEURL/SERVICEPASSWORD magic variables, or troubleshooting Coolify compose errors.

Kastalien-Research/thoughtbox · 46 tokens

cdn-fallback

Put a 3x-ui inbound behind a CDN (WebSocket, gRPC or xhttp through Cloudflare) or share port 443 between several inbounds using Xray fallbacks. Use when REALITY is blocked or unsuitable, when the server IP must stay hidden behind a CDN, when a real domain and certificate are in play, or when several protocols need to…

pyworkload/3x-ui-mcp · 83 tokens