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.
npx skills add eaglesakura/agent-skills --skill maintenance-measure-cache-sizegit clone --depth 1 https://github.com/eaglesakura/agent-skillsWrote 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.
[](https://agentmods.dev/skills/eaglesakura/agent-skills/maintenance-measure-cache-size)<a href="https://agentmods.dev/skills/eaglesakura/agent-skills/maintenance-measure-cache-size"><img src="https://agentmods.dev/badge/skills/eaglesakura/agent-skills/maintenance-measure-cache-size/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.
<a href="https://agentmods.dev/skills/eaglesakura/agent-skills/maintenance-measure-cache-size"><img src="https://agentmods.dev/badge/skills/eaglesakura/agent-skills/maintenance-measure-cache-size.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00147 | $0.01783 |
| Opus 5 | $0.00073 | $0.00892 |
| Sonnet 5 | $0.00029 | $0.00357 |
| Haiku 4.5 | $0.00015 | $0.00178 |
Grade C, and why
maintenance-measure-cache-size scanned grade C with 1 finding 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 10d 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.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
| ~/.npm | 2.4GiB | npm キャッシュ | 再取得可能 | rm -rf ~/.npm/_cacache | How it starts
The opening of the file, as written. The whole thing — 142 lines — stays where its author put it; the contents beside it link to each section on GitHub.
メンテナンス / キャッシュサイズ特定
ローカル環境のキャッシュ・ビルド成果物の占有量を測り、削除してよいか判断できる情報まで揃える。 目的は「何が何 GiB か」ではなく「どこを消せば空き容量が増え、消しても復元できるか」を短時間で示すこと。
いつ使うか
- ディスク容量不足・キャッシュ肥大・開発ツール掃除の相談
- ユーザーが追加で Workspace 等の調査ディレクトリを指定したとき
やってはいけないこと
- ユーザー確認なしに削除・prune・
docker system prune等を実行しない - サイズ未測定のまま削除コマンドだけ列挙しない
- 1GiB 未満を表に混ぜてノイズを増やさない(ルールを変える明示指示がある場合のみ例外)
基本手順
1. 測定単位と除外
- 占有量は GiB(1024³ バイト)で報告する。表示は小数第1位まででよい(例:
2.4) - 1GiB 未満は表から除外する
- 占有サイズの 降順 で並べる
2. ディレクトリ探査アルゴリズム
既定の探索対象(後述)と、ユーザー指定パスを対象にする。
- 対象パスが存在しなければスキップ(エラーで止めない)
- 各対象の占有を測る(下記コマンド)
- 10GiB 超なら、その直下の子ディレクトリを同様に測る(ドリルダウン)
- ドリルダウンは 起点から最大 2 階層まで(起点=0、子=1、孫=2)
- 子も 10GiB 超かつ階層余裕があれば、さらに掘る
実ディスクの空きに効くのはアロケート済みブロックなので、通常は du のデフォルト(見かけサイズではなく実使用)を使う。
# macOS: 1階層の子を人間可読+ソートしやすい数値で
du -hd 1 <path> 2>/dev/null | sort -hr
# Linux(GNU du)
du -hd 1 <path> 2>/dev/null | sort -hr
トップレベル一覧が欲しいだけのときは du -sh <path>。権限エラーは無視して次へ進む。
3. 用途・復元可否・削除コマンドの埋め方
| 列 | 埋め方の指針 |
|---|---|
| 予想される用途 | パス名から推定(npm キャッシュ、Gradle、Pub、Homebrew、Docker ビルドキャッシュ等) |
| 復元可否 | 再取得可能 / 再ビルドで復元 / OS・アプリ用(削除非推奨) / 要確認 など短く |
| 削除コマンド | 安全な例を1つ。非推奨なら -。実実行はしない |
開発ツールのレジストリ/パッケージキャッシュは多くが 再取得可能。Applications や OS 管理下は削除非推奨としコマンドは -。
4. 出力フォーマット
必ず次の表にする(列名は固定)。サイズ列は数値+GiB。
| Path | サイズ(GiB) | 予想される用途 | 復元可否 | 削除コマンド |
|---|---|---|---|---|
| ~/.npm | 2.4GiB | npm キャッシュ | 再取得可能 | rm -rf ~/.npm/_cacache |
| ~/Library/Caches/Homebrew | 1.2GiB | Homebrew キャッシュ | 再取得可能 | brew cleanup |
| Docker Build Cache | 12.5GiB | Docker ビルドキャッシュ | 再取得可能 | docker builder prune |
表の前後に、測定範囲(HOME 想定か、追加パスか)と「削除は未実行」を1〜2文で書いてよい。
結果は cache-size-report.md に保存する(ユーザーが別パスを指定したらそれに従う)。
OSごとの探索対象ディレクトリ
存在するものだけ測る。~ はホームディレクトリ。
macOS / Linux 共通
~/.bundle~/.cache/~/.cargo/~/.cocoapods~/.composer/~/.dart*/(グロブで実在するもの)~/.dlv/~/.flutter*/~/.fvm/~/.gem/~/.gradle/~/.gsutil/~/.nodebrew/~/.npm/~/.pub-cache/~/.sdkman/~/.yarn/~/go/${GOMODCACHE}(未設定ならgo env GOMODCACHEで解決。失敗時はスキップ)
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.
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.
- 10d ago First seen · 142 lines · 147 tokens per session scan C 6d3664edd6f7
maintenance-measure-cache-size is a skill published in the GitHub repository eaglesakura/agent-skills (2 stars, last pushed 5d ago), licensed MIT. It adds 147 tokens to every session and 1,783 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
local-ai-agents
Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…
next-cache-components-adoption
Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…
insight-error-page
Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…
next-cache-components-optimizer
Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…
next-partial-prefetching-adoption
Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…