# Claude Code Bloat Audit
<!--
ref: @wildeagency-public/audit-bloat
tags: [claude-code, audit, context, memory, skills, hooks, groom-op]
triggers: [slow response times, high session costs, excessive memory usage, unused skills]
trigger_prompt: When the user notices performance issues, increased costs, or feels their Claude Code setup is cluttered with unused or outdated components.
version: 3
updated_at: 2026-09-10T16:27:54.358Z
-->
Audit your Claude Code setup for context bloat — oversized CLAUDE.md files, stale memories, unused skills, dead hooks, broken symlinks. Returns a prioritized cut list.
Every token in your default session prompt is a tax on every request you make for the rest of the session — paid in latency, cost, and the model's attention being pulled across surface area it doesn't need. Most Claude Code setups accumulate cruft: CLAUDE.md files that grew past the point where the model can hold them, memory directories full of point-in-time observations about projects that shipped months ago, plugin-injected skill catalogs the user never invokes, hooks that fetch dead URLs every session.
This protocol audits your setup and returns a prioritized cut list.
## How to run
Tell Claude Code:
> Load `https://api.protocol.supply/audit-bloat` and run the audit.
(Or `/protocol audit-bloat` if you have the protocol CLI installed.)
Claude will work through the checklist below and produce a report. Nothing is deleted automatically — every cut is proposed for your approval.
---
## Audit checklist
Work through every section. For each finding, capture: **what was found** (with size in bytes/lines), **why it's bloat** (specific reason, not "looks unused"), and **proposed remediation** (exact command or edit). Use Bash for the measurements; do not approximate.
### 1. CLAUDE.md files
Files loaded into every session's system prompt. The hard rule: if you wouldn't paste it into every Slack DM with a new coworker, it doesn't belong here.
**Check:**
```bash
# Global
wc -l ~/.claude/CLAUDE.md 2>/dev/null
# Project (current dir + git root)
wc -l ./CLAUDE.md 2>/dev/null
wc -l "$(git rev-parse --show-toplevel 2>/dev/null)/CLAUDE.md" 2>/dev/null
# Parent dirs (Claude Code walks upward)
ls -la ~/CLAUDE.md /CLAUDE.md 2>/dev/null
```
**Flag as bloat:**
- Any single CLAUDE.md > 200 lines. The model's attention to instructions degrades sharply past this — every additional rule competes for weight with every other rule.
- Sections that duplicate guidance the model already follows by default ("be concise", "use markdown", "ask clarifying questions").
- References to tools, paths, scripts, or projects that no longer exist (`grep` the file for paths and verify each one).
- Pinned model-version notes from prior eras (e.g. instructions specific to a deprecated model).
- "Workflow" sections describing one-off projects that have shipped.
- Stale dates ("as of <date>" lines older than 90 days).
**Remediation pattern:** propose a trimmed version inline. Don't just say "this is too long" — show the exact lines to cut.
### 2. Memory directory
Per-project memory lives at `~/.claude/projects/<project-slug>/memory/`. The `MEMORY.md` index loads into every session in that project; individual memory files load on demand.
**Check:**
```bash
PROJ_DIR=$(echo "$PWD" | sed 's|/|-|g')
MEM=~/.claude/projects/-${PROJ_DIR#-}/memory
ls -la "$MEM" 2>/dev/null
wc -l "$MEM/MEMORY.md" 2>/dev/null
# Find oversized individual memories
find "$MEM" -name '*.md' -size +3k -exec ls -la {} \; 2>/dev/null
# Find stale memories (>60 days old by mtime)
find "$MEM" -name '*.md' -mtime +60 -exec ls -la {} \; 2>/dev/null
```
Also check all other projects:
```bash
find ~/.claude/projects -name 'MEMORY.md' -exec wc -l {} \;
```
**Flag as bloat:**
- `MEMORY.md` > 200 lines (the system truncates after that, so anything past is dead weight that wastes file budget).
- Individual memory files > 3 KB. Memory entries should be tight — if a file is the size of a small README, it's documentation pretending to be a memory and probably duplicates something in code.
- Memory entries about projects that have shipped, been abandoned, or migrated. Open each `project_*.md` and check the description against current reality.
- Multiple memories about the same topic (look for overlapping descriptions in MEMORY.md). Consolidate.
- Memories that just restate what's obvious from reading the code (file paths, function names, conventions). The model can derive these.
- Memories referencing paths or services that no longer exist.
**Remediation pattern:** for each bloat finding, propose either *trim* (rewrite the file shorter, keeping only load-bearing facts) or *archive* (delete the file and remove the corresponding line from MEMORY.md).
### 3. Skills
Custom skills at `~/.claude/skills/`, plus plugin-injected skills.
**Check:**
```bash
# Custom skills
ls -la ~/.claude/skills/ 2>/dev/null
# Detect broken symlinks
find ~/.claude/skills -type l ! -exec test -e {} \; -print 2>/dev/null
# Enabled plugins
grep -A 20 'enabledPlugins' ~/.claude/settings.json 2>/dev/null
# Plugin-injected skills (these auto-load into the system prompt)
ls ~/.claude/plugins/marketplaces/*/skills/ 2>/dev/null
```
**Flag as bloat:**
- Broken symlinks in `~/.claude/skills/` — orphans from prior project paths. The agent sees the name but can't load the body; pure noise.
- Custom skills you've never used. If you don't recognize the name, it's probably stale.
- Enabled plugins whose skill catalog is big and rarely invoked. The `document-skills` plugin, for example, injects ~16 skill descriptions (algorithmic-art, brand-guidelines, canvas-design, doc-coauthoring, docx, frontend-design, internal-comms, mcp-builder, pdf, pptx, skill-creator, slack-gif-creator, theme-factory, web-artifacts-builder, webapp-testing, xlsx) into your system prompt on every session. If you make a deck once a quarter, it's pure overhead.
**Remediation pattern:** delete broken symlinks. For unused plugins, propose flipping them to `false` in `enabledPlugins` in `~/.claude/settings.json` (the user can re-enable when they actually need to render a deck).
### 4. Hooks
Hooks run on session lifecycle events. They add latency and inject output into context.
**Check:**
```bash
grep -A 200 '"hooks"' ~/.claude/settings.json 2>/dev/null
# Project-level hooks
grep -A 50 '"hooks"' "$(git rev-parse --show-toplevel 2>/dev/null)/.claude/settings.json" 2>/dev/null
grep -A 50 '"hooks"' ./.claude/settings.json 2>/dev/null
```
**Flag as bloat:**
- Hooks that `curl` a URL. Verify the URL still returns content (`curl -sf <URL> | wc -c`). A hook hitting a dead URL silently fails every session — pure latency, no value.
- The same hook bound to multiple lifecycle events when one would do.
- Synchronous hooks (no `"async": true`) that run shell commands on every event — these block tool calls.
- Hooks that reference scripts in paths that no longer exist (`ls` each script path).
**Remediation pattern:** propose the exact JSON edit. For dead-URL hooks, either fix the URL or remove the hook block.
### 5. Permissions allow-list
`.claude/settings.local.json` (project) and `~/.claude/settings.json` (global) hold an `allow` list. Stale entries are cosmetic clutter — they don't hurt context, but they signal an unmaintained setup and they hide which rules are actually load-bearing.
**Check:**
```bash
# Global
grep -A 200 '"permissions"' ~/.claude/settings.json 2>/dev/null
# Project
cat ./.claude/settings.local.json 2>/dev/null
cat "$(git rev-parse --show-toplevel 2>/dev/null)/.claude/settings.local.json" 2>/dev/null
```
**Flag as bloat:**
- Allow-rules referencing paths that no longer exist on disk. Test each path-specific rule.
- Allow-rules for commands you no longer use (one-off scripts from a closed project).
- Allow-rules that duplicate broader rules already present (e.g. `Bash(ls -d /foo/*)` when `Bash(ls:*)` is already allowed).
**Remediation pattern:** propose a rewritten allow-list with the dead rules removed.
### 6. Slash commands
`~/.claude/commands/` holds custom slash commands. Each one is small but they accumulate.
**Check:**
```bash
ls -la ~/.claude/commands/ 2>/dev/null
```
**Flag as bloat:**
- Commands you don't recognize.
- Commands referencing tools/paths that no longer exist.
- Commands that overlap with built-in slash commands or with a more general protocol.
**Remediation pattern:** list each unused command for the user's review.
### 7. Marketplaces and plugins (deep check)
Plugin metadata caches in `~/.claude/plugins/`. The directory itself doesn't bloat your prompt, but enabled plugins do.
**Check:**
```bash
ls ~/.claude/plugins/marketplaces/ 2>/dev/null
cat ~/.claude/plugins/installed_plugins.json 2>/dev/null | python3 -m json.tool 2>/dev/null | head -40
```
**Flag as bloat:**
- Installed marketplaces you've forgotten about. Each plugin from an enabled marketplace can inject skills, hooks, or commands.
- Plugins enabled (`true` in `enabledPlugins`) that you can't articulate a use case for.
---
## Output format
Return a single report in this shape:
```
# Claude Code Bloat Audit — <date>
## Summary
- CLAUDE.md files: <count> checked, <count> over budget
- Memory entries: <count> total, <count> flagged
- Skills: <count> custom, <count> broken, <count> plugin-injected
- Hooks: <count> total, <count> dead
- Permissions: <count> stale
- Slash commands: <count> total, <count> unused
## Biggest wins (in order)
1. <highest-impact cut — sized, with the exact command/edit>
2. <next>
3. <next>
...
## All findings
### CLAUDE.md
<table or list of files, sizes, issues, proposed trim>
### Memory
<per-file findings>
### Skills
<per-skill findings>
### Hooks
<per-hook findings>
### Permissions
<list of stale rules>
### Slash commands
<list of suspect commands>
## Nothing to cut here
<sections that were checked and came back clean — so the user knows you didn't skip them>
```
Then ask: **"Want me to execute the cuts? (all / pick which / no)"** Wait for the answer; do nothing destructive without confirmation.
---
## Notes for the auditor
- **Measure, don't guess.** Use `wc -l`, `du -h`, `find -size`, `curl -sf | wc -c`. A "looks bloated" finding without numbers is rejected.
- **Prove dead, don't assume dead.** If you suspect a hook URL is dead, fetch it. If you suspect a path doesn't exist, `ls` it. If you suspect a memory is stale, open it and check the dates and claims against current reality.
- **Order findings by impact**, not by file location. The single biggest win goes first. Impact = (bytes saved) × (frequency loaded) — so a 2 KB plugin that injects on every session beats a 20 KB memory file that loads only when relevant.
- **Don't propose cuts you can't justify.** "Looks unused" isn't a reason. "References `/Users/.../diles/` which doesn't exist on disk" is.
- **Show diffs for edits.** When proposing a CLAUDE.md trim or a settings.json edit, show the before/after, not just a verbal description.
- **Never delete without confirmation.** The output of this protocol is a proposal. Execution is the user's call.
*Part of the grooming ecosystem: the master pass is `@protocol/grooming`; sibling operations are `/search?q=tag:groom-op`.*
---
*Related: `@content/web/xinyadu/2026-11-29-claude-code-task-framing-study` · `@content/web/huggingface/2026-11-27-model-managed-context-nvidia-harness` · `@content/web/github/2026-11-27-resume-command-osc-7577-issue-112408` · `@protocol/groom-protocols` · `@content/web/github/2026-11-26-opus-context-fills-faster-issue-112194`*
---
*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*
*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*