ai-prune

ai-prune is a skill for Claude Code, Codex from PaulRBerg/agent-skills. It costs 48 tokens per session (1,322 once invoked), scanned A, original, MIT.

A macOS-only cleanup workflow for old agent scratch files. It archives clearly outdated files in .ai and moves clearly outdated cache entries to the Trash while protecting notes and active agent state.

In plain words
What is it for?
Use it to inspect a repository's .ai and .cache folders, archive old scratch files, remove old cache entries, or report what would change.
Why use it?
It reduces stale temporary files without touching user-owned notes or folders that another agent may still be using. A dry-run option lets you review planned changes first.

Skill for Claude CodeCodex

Written for Claude Code and Codex: disable-model-invocation in frontmatter, but also agents/openai.yaml present. Also seen: mentions CLAUDE.md; mentions AGENTS.md.

Good fit Use it to inspect a repository's .ai and .cache folders, archive old scratch files, remove old cache entries, or report what would change.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/paulrberg/agent-skills/ai-prune
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 PaulRBerg/agent-skills --skill ai-prune
Clone the repo
git clone --depth 1 https://github.com/PaulRBerg/agent-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 ai-prune

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/paulrberg/agent-skills/ai-prune"><img src="https://agentmods.dev/badge/skills/paulrberg/agent-skills/ai-prune.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,322 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.00048 $0.01322
Opus 5.5 $0.00019 $0.00529
Sonnet 5.5 $0.00010 $0.00264
Haiku 4.5 $0.00005 $0.00132

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

Security

Grade A, and why

ai-prune 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 1mo 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/ai-prune/SKILL.md · 93 lines

How it starts

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

AI Prune

If a slash or dollar invocation already added these instructions to the conversation, follow them directly. In that case, do not invoke this skill again through a skill tool.

Review everything under .ai/ and .cache/. Decide which entries are clearly outdated relative to the repository's current state. Archive the matching .ai/ entries. Move the matching .cache/ entries to the macOS Trash. Prefer to keep entries. Change only entries with concrete evidence that they are outdated.

This skill runs only on macOS. If uname -s is not Darwin or /usr/bin/trash is missing, stop and report.

Arguments

  • path (optional): Repository root or any path inside the repository. Default to the current directory.
  • --dry-run (optional): Report the planned moves and deletions without changing the filesystem.

Never Touch

  • .ai/todos/ and .ai/archive/ (including everything beneath them).
  • TODO.md and PROMPT.md files anywhere: they are user-owned notes. Do not read or move them.
  • Live agent state: coordination ledgers, leases, locks, inboxes, and notification queues (for example .ai/coord/, .cache/job-leases/). If another agent may currently write to a directory, treat it as live, not outdated.
  • Tool-managed caches that the repository's configuration still uses (prettier, ruff, pytest, uv, vitest, coverage, bundler and package-manager caches). Tools regenerate them on demand. They are never "outdated".
  • Anything modified within the last 24 hours, unless it is unambiguously a leftover of finished work.

Workflow

  1. Resolve the root. For a supplied file, use its containing directory. For a supplied directory, use that directory. Inside Git, resolve the Git root with git -C "$start_dir" rev-parse --show-toplevel. Outside Git, use the directory itself.

    Store the root as repo_root. Compute today=$(date +%Y-%m-%d). If neither .ai/ nor .cache/ exists, stop.

  2. Inventory both trees with modification times, excluding the protected paths:

Read the full file on GitHub · 93 lines

Files

What ships with it

1 file 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. 1mo ago Changed · +5 lines · -1 tokens per session 9ae799aecf1d
  2. 1mo ago Changed · +3 lines a34194d2218e
  3. 1mo ago First seen · 85 lines · 49 tokens per session scan A a532f8b04389

Subscribe to this mod's changes

ai-prune is a skill published in the GitHub repository PaulRBerg/agent-skills (104 stars, last pushed 2d ago), licensed MIT. It adds 48 tokens to every session and 1,322 once invoked, about $0.0002 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-22.

Related

ai-prune compared with skills from other repositories

ai-prune next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ai-prunePaulRBerg/agent-skillsSkill1042d agoMITA48Claude Code, Codex
orbit-notionnexu-io/open-designSkill107kyesterdayApache-2.0A117Claude Code, Codex
agentmailpaperclipai/paperclipSkill112ktodayMITA30Claude Code, Codex
Cortexdanielmiessler/LifeOSSkill20k3d agoMITA184Claude Code
rowboat-spacesrowboatlabs/rowboatSkill18kyesterdayApache-2.0A60Claude Code, Codex
feishuHmbown/CodeWhaleSkill41kyesterdayMITA33Claude Code, Codex
pinchtab-mcppinchtab/pinchtabSkill11k12d agoMITA52Claude Code, Codex