By Mahmoud "Michael" Kurdi
For the next instance of the agent
The quiet war on
token bloat & silent drift.
A configuration archaeology — diagnosing the ghosts in ~/.claude/, exorcising what was loaded but never used, and rewiring the system so it observes itself, prunes itself, and gets sharper every Friday at 3pm.
Nine ghosts
in the machine.
The visible symptom was "too many skills." The real disease was that almost every loaded surface was never invoked — only 4 of ~300 had fired across 150+ sessions. We named the ghosts before exorcising them.
Phantom plugins
31 enabled across 4 marketplaces. Each contributes skill metadata to the cold-start dump. Most never fired.
— 17 disabledInline doppelgängers
Six plugin install instances were inline+marketplace duplicates of the same code, all empty stubs.
— 8 removedThe orphan
plugin_011v5h6QUzBZvas64y44XLhy — no source, no manifest, no purpose. A leftover ID.
— deletedSkill cemetery
17 local skills authored over months. Telemetry says 4 ever fired. Thirteen were dead weight your context still paid for.
— 11 archivedRule auto-load
Fifteen .md files in rules/ auto-loaded on every cold start — 34 KB before the user typed a single character.
The dormant memory
MEMORY.md was three lines. No user/feedback/project/reference buckets. The protocol existed only on paper.
— wired liveTwin hubs
Two CLAUDE.md files competed. The global one ordered the agent to immediately fetch a 13 KB second one. Doubled cost.
— unifiedSilent router
SKILL-ROUTER.md existed but was never loaded. Beautifully written documentation of a feature that didn't exist.
— activatedNo telemetry
Zero data on what was actually used. Every pruning decision was a guess. We were optimising a black box.
— observedEleven pillars,
reversible-first.
Every destructive step was gated behind a backup. ~/.claude/ became a git repo before the first change — so rollback was always one command away.
The sequencing matters as much as the actions. Memory and router went in first because they're additive. Plugin flips came mid-sequence because they're reversible JSON. Disk deletes came last, gated by a Scout inspection that revealed all 8 orphan dirs were empty stubs — zero data loss, no real gate needed.
- idone
Backup foundation
git init · .gitignore · baseline commit · settings backup - iidone
Rule mechanism scout
Confirmed Claude Code auto-loadsrules/*.mdby convention - iiidone
Rules-as-skill lift
15 files moved toskills/rules/refs/+ dispatcher SKILL.md - ivdone
Plugin prune
17 of 33 enabled plugins flipped to false - vdone
Disk cleanup
8 empty stub plugin directories removed - vidone
Skill archive
11 unused local skills moved to_archived/ - viidone
Hub unification
Global CLAUDE.md slimmed 121 → 73 lines; Brain-hub demoted - viiidone
Router wiring
Pattern→skill table now inline in CLAUDE.md - ixdone
Memory protocol
4-bucket dir + MEMORY.md index live - xdone
Telemetry hooks
Skill, prompt, session-end logging →telemetry/ - xidone
Auto-evolution
Weekly autonomous prune + auto router-sync on save
Measured,
not guessed.
Baseline captured before any change. Re-measured after the dust settled. Every line of strikethrough is a real ghost laid to rest.
≈ 10,000 tokens off every
cold start. Forever.
What's now
under the hood.
CLAUDE.md
Slim hub. Identity, stack defaults, execution rules, inline router. 73 lines, every one earning its place.
always loadedMEMORY.md
Four-section index pointing to user, feedback, project, reference memory buckets.
always loadedSkill router
Pattern→skill table inline in CLAUDE.md. Deterministic. Local skills self-register via auto-sync.
deterministicrules dispatcher
The 15 conventions live here. Loads only the relevant file when keyword fires. Zero cold-start cost.
trigger-loadedmemory/user/
Preferences, profile facts, corrections you want me to remember across sessions.
write on signalmemory/feedback/
Session logs, prune reports, router suggestions, validated approaches. Self-improvement substrate.
auto-appendedmemory/project/
Per-project decisions, schemas, gotchas. Alexandria lives here.
manual writememory/reference/
External pointers: dashboards, repos, tools, useful patterns discovered in the wild.
manual writetelemetry/
Skill invocations, prompts, session ends — all logged. Substrate for the weekly auto-prune to reason against.
hooks · jsonlauto-prune-weekly.sh
Fridays 3pm. Spawns Claude CLI. Archives 60+ day dead skills. Writes router suggestions.
windows tasksync-local-skill-router.js
New SKILL.md written → router table auto-updates between markers. Manual edits never overwritten.
PostToolUse + SessionStartgit history
Three commits. Rollback = one command. Plugin re-enable = one JSON flip. Every step is reversible.
e0b4501 → b68fa99A system
that prunes itself.
Every Friday at 3pm Eastern, Windows Task Scheduler wakes a one-shot Claude CLI agent. Bounded prompt, narrow surface, hard 15-minute cap. It reads its own telemetry and acts.
The agent will never delete a skill — only archive. It will never edit CLAUDE.md directly — only write suggestions to memory/feedback/router-suggestions-YYYY-MM-DD.md for your weekend review. It will never touch plugins, settings.json, or any project repo.
All changes are committed in ~/.claude/ with a conventional message. Rollback any prune run with git reset --hard HEAD~1.
15:00
Speak the keyword,
load the skill.
Stop thinking about which skill to load. Phrase your request with the trigger keyword. The router does the rest. These are the most useful matches.
| "threat-model the auth flow" vulnerability · OWASP · RLS · SOC · NIST | security-scanning |
| "diagnose this race condition" broken · throwing · failing · regression | diagnose · superpowers:systematic-debugging |
| "code review on this PR" TDD · refactor · coverage · quality | superpowers:test-driven-development · code-quality |
| "scaffold a Next.js component" fullstack · API · server component | backend-development · ui-design |
| "what's our convention for API routes?" naming · error handling · perf rule | rules |
| "broad/long autonomous goal: …" vague · stalled · multi-task | goalbuddy |
| "caveman: list deltas" terse · low-token · be brief | caveman |
| "handoff this session" compact · baton-pass | superpowers:handoff · handoff |
| "knowledge graph this codebase" communities · viz | graphify |
| "schema, migration, PostgreSQL perf" dep audit · query plan | data-engineering · database-design |
New skill goes in ~/.claude/skills/<name>/SKILL.md — the router table auto-updates on save or next session start. No manual edit. The PostToolUse hook fires the sync; SessionStart catches anything added offline.
The highest-success
workflow you own.
Seven commands turn a vague idea into shipped, tested code without the usual hour-3 rework. The full visual lesson lives at ~/.claude/docs/lessons/spec-kit-tdd.html. Here's the gist.
/speckit.implement task 1 Use the superpowers:test-driven-development skill. Red-green-refactor. Show me the failing test before the implementation.
That second paragraph is what flips the agent from "write code that probably works" to "prove each step." Without it, you'll sometimes get implementation first, test second — which is not TDD. With it, every cycle is RED (failing test) → GREEN (minimum code) → REFACTOR (still green) → conventional commit.
How to get
the most out
of a new session.
Three habits
- Phrase requests with router-matching keywords.Stop pre-loading. One trigger keyword = one skill. The router does the rest.
- Default to spec-kit + TDD for non-trivial work.Seven commands. The magic prompt. No feature code without a spec.
- Feed memory when something is worth remembering."Remember that X" → I write to the right bucket. Six months of this compounds.
Weekly cadence
- Friday 3pm: autonomous prune fires.Monday morning, glance at
memory/feedback/router-suggestions-*.mdand apply what you agree with. - Fire it manually anytime.
Start-ScheduledTask ClaudeBrain-AutoPruneWeekly
When you add a new skill
Just drop the SKILL.md with YAML frontmatter. The router auto-registers on save. No manual CLAUDE.md edit.
When something feels worse
Everything is a git commit away from a clean rollback.
When you want to see your own usage
Cold-start carries identity, router, memory.
Everything else is opt-in by keyword,
observed by telemetry,
auto-pruned weekly,
self-registering when added.
╔═══════════════════════════════════════════════╗
║ CLAUDE-BRAIN · OPS LOG · VOL 01 ║
║ ──────────────────────────────────────── ║
║ files changed · 47 ║
║ plugins reduced · 33 → 16 ║
║ skills active · 17 → 7 ║
║ cold-start saved · ~10,000 tokens ║
║ commits shipped · 3 ║
║ automations live · 2 ║
║ ──────────────────────────────────────── ║
║ next prune · friday 15:00 ET ║
║ rollback handle · e0b4501 ║
╚═══════════════════════════════════════════════╝