# My CLAUDE.md grew to 43 KB, so I had Claude split it into files that only load when needed — retained record

> Retained reddit record from reddit:ClaudeCode.

Canonical: https://highsignal.app/data/records/2b69cd1defbfd68b

[← sources](https://highsignal.app/data)


source: [reddit](https://highsignal.app/data/reddit) (reddit:ClaudeCode)  published 2026-11-15 20:57 ingested 2026-11-16 02:38

[original source ↗](https://www.reddit.com/r/ClaudeCode/comments/1xx6jyz/my_claudemd_grew_to_43_kb_so_i_had_claude_split/)

## retained text



```
My project's CLAUDE.md had reached 43 KB, roughly 10k tokens, and every session loaded all of it. That included sessions that only touched the web app and never went near the plugin engine rules or the Linux service notes.

Why it matters

- Context cost. Those tokens load into every session before you've typed anything.
- Attention. The rules for the folder you're working in end up buried among rules for folders you aren't touching.
- It only gets bigger. Every "remember this" lands in the same file.

What Claude Code gives you for this

1. A CLAUDE.md in a subfolder (core/CLAUDE.md, web/CLAUDE.md) loads only when Claude reads a file in that folder.
2. .claude/rules/*.md files with a paths: glob in their frontmatter load when Claude reads a matching file. They suit topics that span several folders, like a security layer that has code in two places.

---
paths:
  - "core/src/guard.ts"
  - "plugins/guard/**"
---
# The guard
...

Result: the root file went from 43 KB to 10 KB. The rest now lives in 4 folder files and 4 topic rules. No rule was dropped; Claude checked by comparing every backticked name in the old file against the new files.

How I prompted it

I did it in two steps. First I asked for a plan only:

▎ Can our CLAUDE.md be refactored? Could portions be split out into sub-directories?

Claude came back with a table showing what would go where. It also raised the one real risk: some rules must apply everywhere (in my case, "docs must never say X"), and they can't move into a file that only loads sometimes. Once the plan looked right, I said:

▎ Go ahead with the plan. Keep every rule somewhere, and show me the new root file before committing.

Tips if you try it:

- Ask for the plan first. Check the proposed table before any files change.
- Keep the root file short: what the project is, a short repo map, build/test commands, workflow rules, and a short list of rules that hold everywhere, plus pointers to the detail files.
- Ask it to check nothing was lost, for example by comparing the names and identifiers in the old file with the new files.
- Ask it to move text word for word. Trimming or rewriting rules can be a separate pass.
- Watch for files that ship. If part of the repo gets packaged or published (mine ships plugin folders), make sure a new CLAUDE.md doesn't land inside it.
- Add a line to the root file saying new details go in the file for their folder or topic. Otherwise the root starts growing again.

---
```



document fetched 2026-11-16 00:35 · canonical https://reddit.com/r/ClaudeCode/comments/1xx6jyz/my_claudemd_grew_to_43_kb_so_i_had_claude_split
