defragmenting-memory
Decomposes and reorganizes agent memory files into focused, single-purpose components.
Skill by edmundmiller
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/edmundmiller-defragmenting-memory
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/defragmenting-memory
What's inside
- Skill name
defragmenting-memory- Description
- Decomposes and reorganizes agent memory files into focused, single-purpose components. Use when memory has large multi-topic blocks, redundancy, or poor organization. Trigger phrases: "defrag memory", "reorganize memory", "clean up memory files", "split memory blocks".
- License
- MIT
- Instructions
- 119 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Memory Defragmentation
> **Requires context-repo extension** with memory at `.pi/memory/`
Splits large, multi-purpose memory blocks into focused single-purpose files
with hierarchical `/` naming.
## When to Use
- Memory blocks have redundant information
- Files mix multiple unrelated topics
- Memory lacks structure (walls of text)
- After major project milestones
- Every 50-100 conversation turns
## Workflow
### Step 1: Backup (MANDATORY)
Use the `memory_backup` tool before proceeding. This is your safety net.
### Step 2: Analyze Current Memory
```bash
find .pi/memory -name '*.md' | while read f; do
echo "=== $f ($(wc -l < "$f") lines) ==="
head -5 "$f"
echo
done
```
For each file, determine:
- Does it serve 2+ distinct purposes? → needs splitting
- Is it >40 lines? → candidate for splitting
- Does it overlap with another file? → consolidate
### Step 3: Decompose
Split multi-purpose blocks into focused files using hierarchical naming:
**Before:**
```
system/project.md (80 lines mixing overview, tooling, conventions, gotchas)
```
**After:**
```
system/project/overview.md
system/project/tooling.md
system/project/conventions.md
system/project/gotchas.md
```
Use `memory_write` for each new file, then delete the original:
```bash
rm .pi/memory/system/project.md
```
### Step 4: Clean Up
For each file (new and existing):
- Add markdown structure (headers, bullets)
- Remove redundancy across files
- Remove speculation ("probably", "maybe")
- Keep only actionable, concrete information
- Resolve contradictions
### Step 5: Commit
```
memory_commit({ message: "refactor: defragment memory — split N files into M focused blocks" })
```
### Step 6: Report
Provide a summary:
- Files created (new decomposed blocks)
- Files modified (what changed)
- Files deleted (if any, explain why)
- Before/after file counts and line counts
## Evaluation Criteria
1. **DECOMPOSITION** — Each file has ONE clear purpose described by its filename
2. **STRUCTURE** — Headers, bullets, scannable at a glance
3. **CONCISENESS** — No redundancy, no speculation, only unique value
4. **CLARITY** — Contradictions resolved, plain language, actionable
5. **ORGANIZATION** — General to specific within files, important first
## Naming Rules
- Use `/` hierarchy: `project/tooling/testing.md` (not `project-tooling-testing.md`)
- 2-3 levels of nesting
- ~40 lines max per file
- Descriptive frontmatter descriptions
## What to Preserve
- User preferences (sacred — never delete)
- Project conventions discovered through experience
- Important context for future sessions
- Learnings from past mistakes
## Rollback
If something goes wrong:
```
/memory-backups # list available backups
/memory-restore <backup-name>
```From edmundmiller/dotfiles, MIT.
More from edmundmiller/dotfiles
- 0.673score
build-audit-logs
edmundmiller
Build or review audit trails in TypeScript/JavaScript apps using evlog (pipelines, typed actions, denials, retention, compliance-style reviews).
SkillAFreshness: A★ 80Claude Code +9 - 0.671score
analyze-logs
HugoRCD
Analyze application logs from the .evlog/logs/ directory.
SkillAFreshness: A★ 80Claude Code +9 - 0.671score
excalidraw-cli
edmundmiller
Create, inspect, update, and locally render Excalidraw scenes with the Excalidraw CLI.
SkillAFreshness: A★ 80Claude Code +9 - 0.668score
code-search
edmundmiller
Compares semantic, text, and structural search strategies.
SkillAFreshness: A★ 80Claude Code +9 - 0.665score
verify
edmundmiller
Verify dotfiles changes at runtime without switching the system.
SkillAFreshness: A★ 80Claude Code +9 - 0.636score
auditing-decision-data
edmundmiller
Checks whether observations support a consequential decision.
SkillBFreshness: B★ 80Claude Code +9 - 0.636score
challenging-expert-assumptions
edmundmiller
Examines the assumptions and evidence behind categorical technical claims.
SkillBFreshness: B★ 80Claude Code +9 - 0.633score
derive-web-api-client
edmundmiller
Derives a task-focused API client from authorized HAR/browser traffic.
SkillBFreshness: B★ 80Claude Code +9 - 0.633score
hass-config-flow
edmundmiller
Uses Home Assistant APIs on NixOS for integration config flows, entity/device inspection, and token setup.
SkillBFreshness: B★ 80Claude Code +9 - 0.633score
done
edmundmiller
Close an explicit repository task by shaping, landing, publishing, proving, and cleaning it up; also handles narrower commit, publish, and…
SkillBFreshness: B★ 80Claude Code +9 - 0.633score
honcho-integration
edmundmiller
Integrates Honcho memory into Python or TypeScript agents.
SkillBFreshness: B★ 80Claude Code +9 - 0.633score
home-assistant-best-practices
edmundmiller
Selects Home Assistant automation, helper, device-control, and dashboard patterns.
SkillBFreshness: B★ 80Claude Code +9
Signals
- Stars
- 80
- Forks
- 6
- Open issues
- 4
- Last commit (this folder)
- May 25, 2026 (5 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/edmundmiller/dotfiles
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from edmundmiller
- 0.673score
build-audit-logs
edmundmiller
Build or review audit trails in TypeScript/JavaScript apps using evlog (pipelines, typed actions, denials, retention, compliance-style reviews).
SkillAFreshness: A★ 80Claude Code +9 - 0.671score
excalidraw-cli
edmundmiller
Create, inspect, update, and locally render Excalidraw scenes with the Excalidraw CLI.
SkillAFreshness: A★ 80Claude Code +9 - 0.668score
code-search
edmundmiller
Compares semantic, text, and structural search strategies.
SkillAFreshness: A★ 80Claude Code +9 - 0.665score
verify
edmundmiller
Verify dotfiles changes at runtime without switching the system.
SkillAFreshness: A★ 80Claude Code +9 - 0.636score
auditing-decision-data
edmundmiller
Checks whether observations support a consequential decision.
SkillBFreshness: B★ 80Claude Code +9 - 0.636score
challenging-expert-assumptions
edmundmiller
Examines the assumptions and evidence behind categorical technical claims.
SkillBFreshness: B★ 80Claude Code +9
Cite this page
defragmenting-memory skill. Agent Mart. https://agentmart.dev/skills/edmundmiller-defragmenting-memory (last updated 2026-10-24)