# memory-compaction

memory-compaction is a Claude Code skill that shortens and cleans up bloated memory.md files. It triggers automatically when limits are exceeded or upon user request.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf (Devin Desktop), Claude.ai · ★ 285 repo stars
- Author: makushingu
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/makushingu/harness-maxxing/tree/HEAD/skills/memory-compaction/SKILL.md
- Updated: 2026-11-17
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/memory-compaction

## What it does

This skill scans project `memory.md` files for outdated facts, duplicates, and redundant entries. It performs content summarization while enforcing a consistent structure with sections for rules, current state, and decisions. It ensures essential project context and commands remain while reducing line counts and file weight.

The tool restricts modifications exclusively to memory files, avoiding code or config files. It integrates with Git, allowing users to restore previous versions if necessary using `maxxing-backup`. It applies a default limit of 200 lines and 20 KB per file to maintain optimal context management.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add makushingu/harness-maxxing --skill memory-compaction -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/memory-compaction/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/memory-compaction/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add makushingu/harness-maxxing --skill memory-compaction -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/memory-compaction/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add makushingu/harness-maxxing --skill memory-compaction -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/memory-compaction/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install makushingu/harness-maxxing skills/memory-compaction
```

2. **Manually: put the files in place**
- File: `.github/skills/memory-compaction/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add makushingu/harness-maxxing --skill memory-compaction -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/makushingu/harness-maxxing --path skills/memory-compaction
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/memory-compaction/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/makushingu/harness-maxxing/tree/HEAD/skills/memory-compaction/SKILL.md

## When to use it
- remove memory file duplicates
- shrink bloated memory.md files
- resolve contradictory facts
- reorganize context history

## Example prompts
- Clean up my project memory files
- memory-compaction: shorten long memory files
- remove duplicates from memory.md

## Similar
- [codex-memory-curator](https://affpapa.org/en/nevibecode/skills/codex-memory-curator.md) — skill · 2700 installs
- [memory-evolution](https://affpapa.org/en/nevibecode/skills/memory-evolution.md) — skill · 759 installs
- [groove-utilities-memory-log-daily](https://affpapa.org/en/nevibecode/skills/groove-utilities-memory-log-daily.md) — skill · 583 installs
- [groove-utilities-memory-retrospective](https://affpapa.org/en/nevibecode/skills/groove-utilities-memory-retrospective.md) — skill · 517 installs
- [memory-mcp](https://affpapa.org/en/nevibecode/mcp/memory-mcp.md) — MCP server · ★ 100 repo stars
- [para-memory-files](https://affpapa.org/en/nevibecode/skills/para-memory-files.md) — skill · 1900 installs

From the same set: [makushingu/harness-maxxing](https://affpapa.org/en/nevibecode/by/makushingu/harness-maxxing.md) — 21 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
