Your CLAUDE.md Is Working Against You
Your CLAUDE.md Is Working Against You
After three months in a live email production workflow, a CLAUDE.md file typically reaches 400 lines. Claude does not ignore the rules — it deprioritizes the ones buried deep enough that they lose the competition for attention. Here is the architecture that fixes it.
It made sense when you wrote it. Six months later it is 400 lines long and Claude is quietly ignoring the bottom half. Not because the rules are wrong. Because a model working through a live production session cannot consistently apply guidance buried that deep in a long file.
How it happens
A client is running Claude as part of their email production pipeline. Newsletter sends, product launch announcements, promotional campaigns, welcome series variations. The workflow is working, so they keep extending it. Every time Claude produces something that misses (wrong tone on a product email, a claim that should not be in a newsletter, a subject line that does not match the brand register), they add a rule to CLAUDE.md. The file grows one sensible addition at a time.
By month three, a typical client workflow managing 500 or more email topics has a CLAUDE.md past 200 lines. Brand voice rules. Forbidden claims from previous bad outputs. Product naming conventions. Template contracts for different send types. Tone variations per audience segment. Cadence rules. All of it written down. None of it reliably followed.
Anthropic flags this in their Claude Code documentation: CLAUDE.md files over 200 lines degrade adherence. The model deprioritizes rules it encounters deep in a long file. The context window is finite, and in a session working through a product launch campaign alongside newsletter copy and automated send logic, CLAUDE.md is competing with everything else in that session for attention.
The workaround that does not work
The instinctive fix is splitting the file using @import: breaking content into separate files and pulling them in. It does not reduce the problem. Imported files still load in full at the start of every session. The context cost is identical. You have reorganized the problem, not solved it.
The fix that actually works is the one Anthropic documents: .claude/rules/ with paths: frontmatter. Files in that directory load only when Claude touches a matching file path during the session. Not at session start. Not always. Only when relevant.
The decision tree we use to audit a CLAUDE.md
We built a Claude Code skill called /trim-claude-md that walks every section of a CLAUDE.md through this logic. The full skill is free to copy at the bottom of this article. Here is how it categorizes each section:
Does every session need this? Brand voice rules, forbidden vocab, hard invariants. Yes: stays in CLAUDE.md.
Does it only apply when working in a specific area? Template rules, copy rules for a specific campaign type, segment-specific guidelines. No: moves to a
.claude/rules/file scoped to that path.Is it a multi-step procedure? Setup runbooks, credential flows, one-time config. Moves to
docs/setup-*.mdor a standalone skill.Is it state or history? "As of March 2026 the welcome series has 4 emails", shipped features, row counts. Cut entirely. Belongs in commit messages. It is not a rule, it is history, and history rots inside CLAUDE.md.
Is it hard enforcement? "Must validate before commit", "must run linter before push". Moves to a pre-commit hook in
.claude/settings.json. Hooks are enforced. CLAUDE.md instructions are not.
What the split looks like for an email production workflow
What belongs in CLAUDE.md and loads every session: brand voice rules, forbidden claims the client has validated, US versus British English, the hard no-most-customers rule. These apply everywhere. They stay.
What moves to a scoped rule file:
Email template rules: subject line length limits, preheader conventions, CTA copy guidelines, template token contracts. Scoped to
templates/**. Loads only when a session touches a template file.Product announcement rules: product naming conventions, launch tone, pricing language, permitted claims in promotional sends. Scoped to
campaigns/**orlaunches/**. A session writing a welcome series never loads this.Segment-specific copy rules: rules for a specific audience segment or list. Scoped to those output directories. Irrelevant to most sessions and invisible to them once scoped correctly.
ESP and rendering notes: client-specific rendering rules, deliverability constraints, dark mode handling. Scoped to the relevant build or export directories.
What gets cut entirely: dated state notes, shipped features lists, and any paragraph describing the current state of the workflow rather than a rule Claude should follow. These belong in commit messages or a plans folder.
What the frontmatter looks like
A rule file for product announcement copy:
---
paths:
- "campaigns/**/*"
- "launches/**/*"
---
# Product announcement copy rules
[Campaign-specific guidance here]
Claude Code reads the paths: block and loads the file automatically when a session touches a matching path. If the session is writing newsletter copy and never touches a campaign file, this file is invisible to it.
The pattern extends beyond email
We have seen this in every production workflow where clients run Claude over time: CLAUDE.md becomes the catch-all for every correction ever made. Legal adds a clause. Brand adds a voice note. A developer adds a rendering constraint. A marketer adds a segment rule. The file grows.
Email workflows are particularly prone to this because of the volume of writing, the number of variations, and the long-running nature of the pipeline. A client running 500 email topics across multiple send types, with audience segments and product lines and seasonal tone shifts, generates more rules than almost any other Claude use case. The context file needs architecture, not just growth.
If a client workflow has been live for more than three months and output quality has quietly declined from where it started, check the CLAUDE.md line count first. If it is past 200, run the audit.
The skill: free to copy and use
The /trim-claude-md skill automates the full audit. It reads your CLAUDE.md, walks every section through the decision tree above, and produces a proposal file showing exactly what stays, what moves, and where. Nothing is written until you approve. One session to run it.
To install it in your Claude Code project:
Create the directory:
mkdir -p .claude/skills/trim-claude-mdCopy the skill file from the gist below into
.claude/skills/trim-claude-md/SKILL.mdRun it from the project root:
/trim-claude-md
The full skill is here, free to use on any project: gist.github.com/ChristianLundgren/d4be5560eec2c36385d6fe3e5fd3dccd

