memory-optimize

Optimize Claude Code memory files through an interactive four-step process.

30|2|Updated Jan 24, 2026
One-click install
npx skills add https://github.com/kochetkov-ma/claude-brewcode --skill memory-optimize
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: memory-optimize
Source: https://github.com/kochetkov-ma/claude-brewcode/tree/main/skills/memory-optimize
Command: npx skills add https://github.com/kochetkov-ma/claude-brewcode --skill memory-optimize

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the growing inefficiency and cost associated with large, unoptimized Claude Code memory files, which can slow down context loading and increase API expenses.

Core Features & Use Cases

  • Duplicate Removal: Identifies and removes redundant entries already present in CLAUDE.md or rule files.
  • Intelligent Migration: Moves relevant rules and architectural decisions to persistent config files (CLAUDE.md, .claude/rules/, ~/.claude/rules/).
  • Token Compression: Reformats remaining entries into more token-efficient structures like tables.
  • Validation & Cleanup: Checks for broken references and orphaned files.
  • Use Case: Reduce your Claude memory token count by 30-50%, leading to faster responses and lower costs, by automatically cleaning and optimizing your memory files.

Quick Start

Run the memory-optimize skill to begin the interactive cleanup process for your Claude memory files.

Frequently Asked Questions about memory-optimize

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce token count in Claude Code memory files?

To reduce token count in Claude Code memory files, you can use an interactive optimization process that identifies redundant data, migrates misplaced rules to persistent config files, and compresses content into efficient formats like tables. This can lower token usage by 30-50%.

Why does my Claude memory file slow down context loading and increase API costs?

Your Claude memory file slows down context loading and increases API costs due to growing inefficiency from redundant entries, misplaced rules, and inefficient formatting within unoptimized auto-memory files, which require more tokens to process on each request.

How do I remove duplicate rules from auto-memory files and CLAUDE.md?

To remove duplicate rules from auto-memory files and CLAUDE.md, an optimization process analyzes your project and global rules to identify overlapping entries, removes the redundancies from memory files, and intelligently migrates the rules to persistent configuration directories.

What is the best way to compress Claude memory file content for token efficiency?

The best way to compress Claude memory file content for token efficiency is reformatting remaining entries into denser structures like tables after analyzing and migrating misplaced rules, which maximizes token reduction while preserving the required context.

Can I migrate architectural decisions from auto-memory files to persistent Claude rules?

Yes, you can migrate architectural decisions from auto-memory files to persistent Claude rules. The optimization process intelligently moves relevant rules from auto-memory into CLAUDE.md, .claude/rules/, or ~/.claude/rules/ to maintain persistent configurations.

How do I validate and cleanup orphaned files after optimizing Claude memory?

To validate and cleanup orphaned files after optimizing Claude memory, the process checks for broken references and orphaned files in the final validation step to ensure the remaining memory structure is clean and fully functional.