A freshly configured OpenClaw setup is fast and focused. After a month of real use, memory.md has grown to 400 lines, your workspace has half a dozen memory log files, and your agent's responses feel slower and less sharp. This is normal โ€” and fixable.

The underlying problem: everything added to memory gets injected into every conversation context window. A bloated memory file means the model spends tokens processing stale facts instead of focusing on your actual request. The fix is regular memory hygiene: prune what's stale, archive what's historical, and convert recurring patterns into skills.

The Three Types of Memory (and What to Do with Each)

๐ŸŸข Keep

Stable facts about you, preferences, ongoing projects. Changes rarely. Lives in memory.md permanently.

๐ŸŸก Archive

Historical context โ€” completed projects, old decisions, past conversations. Move to memory/archive/, not delete.

๐Ÿ”ต Skill-ify

Repeating behaviors, workflows, and instructions. Convert these to a SKILL.md file instead of keeping in memory.

Step 1 โ€” Ask Your Agent to Audit memory.md

The fastest path to memory hygiene is having the agent do it for you. This is the power tip that's been circulating in r/openclaw but doesn't have a written guide:

Review my memory.md file. Identify: (1) facts that are stale or no longer relevant, (2) items that should be archived because they're historical, (3) items that appear more than once or could be consolidated, and (4) patterns or behaviors that repeat enough to warrant their own skill. Give me a specific list of suggested changes before making any edits.

Your agent will read memory.md, analyze it, and give you a structured list of what to cut, archive, and convert. Review the list, approve or modify, then:

Implement those changes. For anything to archive, move it to memory/archive/[date]-archive.md. For the skill candidates, create draft SKILL.md files in my workspace/skills/ folder. Don't delete anything โ€” just reorganize.

Step 2 โ€” The Memory โ†’ Skill Conversion

This is where real leverage comes from. Certain things in memory.md aren't really facts โ€” they're behavioral instructions that repeat on every task. Examples:

These instructions are repeated in memory.md but they're more accurately described as skills โ€” reusable procedures the agent should apply in specific contexts. Moving them to a SKILL.md file means:

Example SKILL.md structure for a recurring workflow:

# research-competitor-scan

## Purpose
Standard competitor research scan for new market opportunities.

## When to Use
When Josh asks to evaluate a new niche, market, or SaaS idea.

## Steps
1. Search Product Hunt for recent launches in the category
2. Check r/SaaS and r/indiehackers for discussion
3. Search Indie Hackers for builders in the space
4. Look for pricing pages to understand market rates
5. Summarize: market size signal, top competitors, pricing range, Josh's edge

## Output Format
Brief (300 words max): opportunity score, key competitors, recommended action.

Save that to workspace/skills/research-competitor-scan/SKILL.md and remove the equivalent instructions from memory.md. Your agent will find and apply the skill automatically when the context triggers it.

Step 3 โ€” Archiving Historical Memory

Memory entries about completed projects, past decisions, and resolved issues don't belong in active memory.md โ€” they bloat context without providing value. But you don't want to delete them either. Archive them:

memory/
  memory.md              โ€” active facts only
  archive/
    2026-q1-context.md   โ€” first quarter context
    lobstercondo-launch.md โ€” completed project history
    2026-03-decisions.md โ€” major decisions made in March

Archive files don't get automatically injected. You or your agent can reference them explicitly when needed ("look in my March archive for context on the KKOS email") without them consuming context on every turn.

Size targets: Active memory.md should ideally be under 2,000 tokens (~1,500 words). If it's longer than that, you have archive candidates. Run wc -w memory/memory.md to check.

Step 4 โ€” Memory Consolidation on Heartbeat

For ongoing memory hygiene without manual effort, add a consolidation step to your HEARTBEAT.md:

# In HEARTBEAT.md

## Weekly Memory Consolidation (Sundays)
- Review memory.md for entries older than 30 days
- Archive completed project context to memory/archive/[month]-archive.md
- Flag any memory entries that have become skills (repeating behavioral instructions)
- Keep memory.md under 1,500 words

This way your agent handles the cleanup on a schedule rather than letting things accumulate until it's a big job.

What NOT to Put in memory.md

A few categories that shouldn't be in memory.md at all:

The rule of thumb: memory.md is for facts about you and your world. SOUL.md is for how you want the agent to behave. Skills are for repeating workflows. Archive is for history. If something doesn't clearly fit one category, it's probably a skill candidate.

Checking the Impact

After a good memory pruning session, you should see:

A good proxy metric: run wc -l memory/memory.md before and after. Getting it from 400 lines to under 100 is a meaningful improvement.