The more rules you put in CLAUDE.md, the less closely Claude follows them. It is the file Claude Code reads at the start of every session, so everything in it is competing for attention on every job, including jobs it has nothing to do with.
Anthropic's memory docs say it plainly: aim for under 200 lines per CLAUDE.md file, because longer files use more context and reduce how closely Claude follows them. This guide is how to get there without throwing your rules away.
01 / 05
The split in five steps
1. Count your lines
In Claude Code, ask:
How many lines is my CLAUDE.md, and what are its section headings? Under about 200 is the target.
2. Decide what stays and what moves
Stays (applies to almost every job):
- Who you are and how you like answers.
- Rules that apply every time, such as "ask before spending money".
- The one-line pointers from step 4.
Moves out (applies to one kind of job):
- How you write emails, do invoices, review code or format reports.
- Long examples and templates.
- Anything
Claude can work out by reading your files.
Anthropic's best-practices page says CLAUDE.md works best when it holds only what Claude cannot work out from your files. A good test for each line: would removing it cause mistakes? If not, cut it.
3. Move each job into its own file
Make a plain folder for the files, such as .claude/jobs/, with one file per job: emails.md, invoices.md, reports.md.
One thing to avoid: do not put them in .claude/rules/. According to Anthropic's memory docs, rule files there load at launch unless they have a paths setting, so moving rules into that folder does not shrink what Claude reads every session. Rule files with a
paths setting load only when Claude works on matching files, which is a second option.
Paste this and let Claude do the move:
4. Add one pointer line per file
This is what stays in CLAUDE.md for each moved job:
- Emails: read .claude/jobs/emails.md before writing or editing any email. - Invoices: read .claude/jobs/invoices.md before creating an invoice. - Reports: read .claude/jobs/reports.md before building a weekly report.
Claude opens the file when the job comes up. A pointer line is a request, not a lock, so check in a new session that it does. Do not use an
@ import for this: Anthropic's docs say imports organize a long file but do not reduce its context cost, because imported files load with the CLAUDE.md that imports them.
5. Put rare jobs in a skill
If a job has its own steps and comes up rarely ("run the monthly client audit"), make it a skill. A skill is a folder with a file called SKILL.md. Anthropic's best-practices page says a skill Claude can start on its own shows Claude only its name and description each session, and the full file is read when the task calls for it.
--- name: JOB-NAME description: DO THE JOB. Use when I ask for THE JOB IN MY WORDS. --- # JOB TITLE Steps: 1. FIRST STEP 2. SECOND STEP 3. THIRD STEP Rules for this job: - A RULE THAT ONLY MATTERS HERE Output: WHAT TO HAND BACK, AND WHERE TO SAVE IT
Save it as ~/.claude/skills/JOB-NAME/SKILL.md for all projects, or .claude/skills/JOB-NAME/SKILL.md for one. Windows: C:\Users\YOU\.claude\skills\JOB-NAME\SKILL.md. The description line is how Claude decides when to use it, so write it as "Use when I ask for ...".
Download the ZIP for the split prompt, the skill template and the optional line-cap hook.
02 / 05
If one rule still gets skipped
An older habit is to mark the line IMPORTANT. Anthropic's best-practices page now says that probably will not fix it. Either the file has grown long enough that the line gets lost, so shorten it, or it is a rule with no exceptions, and that belongs in a hook. Do not add a second copy of the rule.
03 / 05
Optional: a hard 200-line cap
A written limit is advice. A hook is a small script Claude Code runs automatically, and it can say no. The kit's
claudemd-linecap.js blocks any edit that would push a file named CLAUDE.md past 200 lines and tells Claude to move something out instead. It still lets you trim a file that is already too long.
Copy
claudemd-linecap.jsto~/.claude/hooks/(create the folder if needed).In your
Claude Code settings file, add a PreToolUse hook with the matcher
Edit|Write. The kit has a ready-madesettings-snippet.jsonto copy from, and Anthropic's hooks guide shows the same shape.Set its command to
nodefollowed by the real full path to the file (on Windows, forward slashes, for exampleC:/Users/YOU/.claude/hooks/claudemd-linecap.js).Restart
Claude Code. Ask Claude to paste 250 lines into a copy named
CLAUDE.mdin a scratch folder. It should be blocked.
It needs Node.js (node --version prints a number). Without Node, skip this part. The written rules work without it. To remove it, delete the entry from your settings.
04 / 05
Test it safely
Save a backup of your CLAUDE.md first. The prompt does this, but check the file exists.
After the split, start a new session and ask for one of the moved jobs, such as an email.
Watch whether
Claude opens the job file before it starts. If it does not, make the pointer line more specific about when to read it.
Where was this tested? The line-cap hook was run on made-up edit requests (a 250-line write was blocked, a 100-line write and a one-line edit were allowed). The split prompt and the pointer lines were not run in a live Claude Code session for this guide, and neither was the hook inside one. Treat both as a first draft and check the result.
Common mistakes
Putting job files in
.claude/rules/. They still load every session.Rewording rules while moving them. Move them word for word.
Using
@imports to "move" rules. They still count against the context.Never checking a pointer works. Test in a new session.
Piling emphasis on a skipped rule. Shorten the file or use a hook.
What is a CLAUDE.md?
A file Claude Code reads at the start of every session, with your standing instructions. It can live in your project or in your home folder.
Is 200 lines a hard limit?
No. It is Anthropic's recommended target. The hook in the kit makes it a hard limit if you want one.
Will Claude always read the job file?
Not always. A pointer line is a request. Test it, and if a rule must never bend, use a hook.
Do I need to code?
Not for the split. The optional hook needs Node.js and a small settings edit.
Finish line
What to do next
Ask
Claude how many lines your CLAUDE.md has.
If it is over 200, paste the split prompt and read the plan.
Test one moved job in a new session.
Back to all the free guides. Two that pair well with this one: teach Claude your business and build your first Claude skill.
You reached the end of the guide