bokuwalily/claude-code-skills/memory-md-inject-bloat-audit
Claude Code and agent skill by bokuwalily/claude-code-skills
- community
Checking that the SKILL.md file is still in the repository.
inject_bytes が cc-self-audit 閾値(40KB)の75%超を超えた時に MEMORY.md が支配的な原因であることを診断し、不要エントリを刈り込む手順。2026-08-05に inject_bytes=34.9KB(87%閾値)・MEMORY.md=26KB(70%占率)を検出したパターンの再利用版。
Install
npx vskill@latest install bokuwalily/claude-code-skills/memory-md-inject-bloat-auditSKILL.md
The same SKILL.md was published earlier as bokuwalily/claude-code-skills/memory-md-inject-bloat-audit.
背景
cc-self-audit.sh が週次で測定する inject_bytes は以下の合算:
MEMORY.md は会話を重ねるにつれて自動蓄積され、260ファイル超になると 単体で inject_bytes の 70%+ を占める(2026-08-05実測: 26.6KB / 34.9KB)。
閾値 TH_INJECT_BYTES=40000(40KB)を超えると cc-self-audit が RED 発動 → claude -p による自己修正スクリプトが起動される。
トリガー条件
以下のいずれかで本スキルを参照する:
inject_bytes > 30000(閾値の75%)wc -c ~/.claude/projects/-Users-you/memory/MEMORY.md> 20000- cc-self-audit.log に
RED: inject_bytesが出現
Procedure
1. 現在値の診断
2. MEMORY.md が主因の場合: 古い memory エントリ候補を特定
3. MEMORY.md index の刈り込み(手動 or claude -p 委譲)
刈り込み基準(いずれかに該当すれば削除候補):
- stale project: 対象プロジェクトが終了・アーカイブ済み
- code pattern: コードのパターン・アーキは記憶でなくコードベースが正本
- duplicate: 同じ内容の feedback が別名で2件以上ある
- resolved bug: 修正済みバグの workaround メモ(コードに取り込まれた)
- line 150+: MEMORY.md は 200 行でトランケートされる → 150 行以内に保つ
4. 削除後の検証
inject_bytes 成長トレンド(2026年実績)
| 日付 | inject_bytes | 対閾値 | |
|---|---|---|---|
| 2026-07-11 | 21,798 | 54% | |
| 2026-07-19 | 23,855 | 60% | |
| 2026-07-26 | 31,620 | 79% | |
| 2026-07-31 | 32,299 | 81% | |
| 2026-08-02 | 34,872 | 87% |
7月下旬のジャンプ(+7,765 in 7d)は memory 蓄積と CLAUDE.md 拡張が重なった時期と一致。
Pitfalls
- MEMORY.md だけ削っても index が残る → 個別
.mdファイルと MEMORY.md index エントリを両方削除すること - feedback 記憶は慎重に → 削除すると同じ過ちを繰り返す。stale でなければ残す
- inject_bytes 計算式は自分の集計スクリプトが正本 → 週次バッチで自動計測しているなら、その
collect()相当の関数と定義を揃える(rules は再帰 find、MEMORY.md は固定パス、が上のProcedureの前提) - 定期監査は週1程度が目安 → 削減効果は次回の定期実行まで確認できないことがある
関連スキル
claude-plugin-context-audit— プラグイン/スキル側の bloat 診断(inject_bytes の内訳が違う)pre-completion-self-audit— 完了前の自己監査テンプレ
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/memory-md-inject-bloat-audit/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/bokuwalily/claude-code-skills/memory-md-inject-bloat-audit)