My Story AI Challenge Free Guides Get the free kitFree kit
← All free guides
PromptsSet up ClaudeFree guide

The 3 Claude Code Cleanups I Run Every Few Weeks

Your Claude Code setup gets heavier every week, and Claude re-reads all of it before it does anything for you. These are the 3 cleanups I run, with the exact prompt for each one.

4 to copy6 min read
Zach CrawfordA free guide by Zach Crawford
Claude Code
Help me clean up my CLAUDE.md files. Change nothing until I say yes.
1. Find every CLAUDE.md that loads in this folder: the one in this folder, any in the folders above it, and my personal one at ~/.claude/CLAUDE.md. Tell me the line count of each.
2. First, copy each file to a backup next to it, named CLAUDE.backup.md, so I can undo this.
3. Go through each file and sort every instruction into one of these:
The whole prompt is in this guide. One click copies it.

This is the start of a real prompt from this guide. It is not a result.

Here's what happens to everyone who uses Claude Code for a while.

Claude messes something up, so you add a rule. It forgets something, so it saves a note. You try a new skill and never use it again.

Do that for a few months, and Claude reads a pile of old notes before it does anything for you. When I checked my own usage, 95.6% of it was Claude re-reading context. Not doing new work.

So every few weeks, I run these 3 cleanups. Each one takes about 10 minutes.

Before you start

Open the Claude desktop app, switch from Chat to Code at the top, and pick the folder you work in most.

Each prompt shows you a plan first and changes nothing until you say yes. Read the plan. You know which rules still matter. Claude doesn't.

Cleanup 1. Keep your main rules file short

Your main rules file is called CLAUDE.md. Claude Code reads it at the start of every chat. Anthropic's own docs say to keep each one under 200 lines, because a longer file costs more and Claude follows it less.

Mine holds rules and pointers only. The detail lives in other files Claude opens when it needs them.

Copy and paste this
Help me clean up my CLAUDE.md files. Change nothing until I say yes.

1. Find every CLAUDE.md that loads in this folder: the one in this folder, any in the folders above it, and my personal one at ~/.claude/CLAUDE.md. Tell me the line count of each.
2. First, copy each file to a backup next to it, named CLAUDE.backup.md, so I can undo this.
3. Go through each file and sort every instruction into one of these:
   - KEEP: a rule you need in every chat, written in one or two lines.
   - MOVE: detail you only need for one kind of job, like a step-by-step process or a long example. It goes into its own file, and CLAUDE.md keeps one line that says when to read it.
   - CUT: out of date, said twice, fights with another rule, or something you already do without being told.
4. Show me the plan as a short list for each file: what you'd keep, what you'd move and where, and what you'd cut, with the reason in a few words. Then show the new line count.
5. Wait for me. I'll cross out anything I want to keep as it is.

When I say yes: make the changes, put moved detail in a folder called docs, and show me the new line count of each file. Never cut a rule just to make the file shorter. If you're not sure a rule still matters, ask me.

Cleanup 2. Clean out the memory

Claude Code saves notes about how you work. The notes live in a memory folder, with an index file called MEMORY.md. Only the first 200 lines of that index load at the start of a chat. Past that, the end gets cut off, so your newest notes can be the ones Claude never sees.

My finished jobs move to an archive, so Claude stops loading old work. And I keep the index under about 200 lines.

You can see your memory any time: type /memory in Claude Code.

Copy and paste this
Help me clean out your memory for this project. Change nothing until I say yes.

1. Find your memory folder for this project. It's in ~/.claude/projects/, in the folder named after this project's path, inside a folder called memory. If you can't find it, tell me, and I'll open it with /memory.
2. Read MEMORY.md and every note it points to. Tell me how many lines MEMORY.md has, and whether any of it is past line 200, where it stops loading.
3. Sort every note into one of these:
   - KEEP: still true, and useful in future chats.
   - ARCHIVE: about a job that's finished, or something that was true once and isn't now.
   - MERGE: says the same thing as another note.
4. Show me the plan as a short list. Then wait for me.

When I say yes:
- Move ARCHIVE notes to a file called MEMORY_ARCHIVE.md in the same folder, one line each. Don't delete anything. MEMORY_ARCHIVE.md is not loaded at the start of a chat, so it costs nothing until you need it.
- Merge the MERGE notes into one.
- Rewrite MEMORY.md as one short line per note, newest work at the top, under 200 lines.
Then show me the new line count.

Cleanup 3. Run skill doctor

Every skill you add sits in the background of every chat, even the ones you never use. Skill doctor shows every skill you've loaded and how often you use it. On my setup it found 17 skills I'd never used once.

Type this in Claude Code:

Copy and paste this
/skill-doctor

It shows a table. Look at the "uses" column and the "last used" column. Any row that says 0 and never is a skill you're paying for and not using.

Don't turn them all off blind. Some are skills you'll want later. Paste the table into this prompt:

Copy and paste this
Here is my skill doctor report:

[paste the table here]

For every skill I've never used, tell me in one line what it does, and whether someone like me would miss it. I [one line on what you do, like "run a coaching business and make content"].
Then give me two lists: turn these off, and keep these. Keep any skill you're not sure about.
Then tell me how to turn off the ones on the first list.

To turn a skill off yourself: type /skills, find it in the list, and press Space or Enter until it shows off. It's still there if you want it back later. A skill that came with a plugin is turned off in /plugin instead.

Then do it again in a few weeks

Put a reminder on your calendar. Every few weeks, run all 3 again. Your setup needs maintenance, like anything else you use every day.

The limitations you should know

Want the next guide? Follow @zachcrawford.ai

More free guides