Claude Code Warned Me at 161.5k Characters of Instructions. The 150k Limit Is Not in the Docs, and Half of It Was Gone Before My Project Loaded.

On 2026-11-01, Claude Code opened a session in one of my projects with this line:
16 instruction files add up to 161.5k chars, over the 150.0k-char total limit · largest: CLAUDE.md (85.2k), ~/.claude/CLAUDE.md (24.1k)
The project's CLAUDE.md was the obvious offender at 85.2k.
The part I had not expected is the remainder: 161.5k minus 85.2k leaves 76.3k characters spread over fifteen other files.
When I measured later that day, the files that load in every one of my projects came to about 80,000 characters.
That is more than the 76.3k remainder: the global file had grown during the day, and I cannot show which sixteen files the warning counted.
Every repository I open pays for them before its own first line loads.
Two things surprised me when I went looking. The documentation describes this limit without ever printing 150,000, and by its own account nothing of mine was cut. The limits that do cut text are different ones.
This post is the arithmetic: what is counted, what the documentation confirms, which limits actually cut text, and how to measure your own files.
What is loaded at launch
The Claude Code memory docs, as I read them on 2026-11-13, load these at session start:
~/.claude/CLAUDE.md, and everyCLAUDE.mdandCLAUDE.local.mdin the working directory and the directories above it.- Rules files without
pathsfrontmatter, both in~/.claude/rules/and in the project. - Everything those files pull in with
@pathimports, up to four hops deep.
The same page is explicit that an import is not a discount: imported files "load together with the CLAUDE.md that imports them."
A CLAUDE.md in a subdirectory and a rule with paths: are different.
They load on demand, when Claude touches a matching file.
The 150k figure is a warning, and the docs do not print it
I had written this limit into my own config as a cap. The docs do not call it that.
What the page says is that "you also see a warning when files that are each within that length add up past a combined limit at session start," and that each CLAUDE.md, rules file and @path import counts as a separate file.
No number is attached.
The 150.0k comes from the warning itself, and the 2.1.323 binary on my machine describes the event as instruction files that "add up to more than the recommended limit."
The page also says Claude "gets the whole of each CLAUDE.md file that loads at launch, as long as the file is 4 MiB or smaller." So at 161.5k nothing of mine was documented as dropped. I got a warning and, if the docs describe the behavior fully, a session that started with all 161.5k characters in context.
The limits that do cut text are elsewhere:
- An on-demand file (a subdirectory
CLAUDE.md, a path-scoped rule) is truncated past 40,000 characters on a 200K context window. On a 1M window the docs give 200,000 characters for Claude Opus 4.6 and Sonnet 4.6 and 150,000 for later models. Claude receives the start plus a note to read the rest, and "until Claude chooses to, the later instructions aren't in its context." The docs date this limit to v2.1.309. - The auto-memory index
MEMORY.mdloads only its first 200 lines or 25KB, whichever comes first. - A launch file over 4 MiB is skipped whole.
- Codex has a combined limit that stops loading. Its AGENTS.md guide says it "stops adding files once the combined size reaches the limit defined by
project_doc_max_bytes(32 KiB by default)."
The only number in this post that I have watched fire is the session-start warning.
The four cuts above are the documentation's, not something I saw happen; the AGENTS.md in that project, for one, is 233 bytes.
Characters on one side, bytes on the other
Claude Code's limits are in characters, and the docs tell you to check a file with wc -m.
Codex's limit is in bytes.
For ASCII the two are the same number.
For anything else they are not, and wc -m only counts characters when the locale lets it:
printf '가나다abc' | LC_ALL=en_US.UTF-8 wc -m
printf '가나다abc' | LC_ALL=C wc -m
printf '가나다abc' | wc -c
6
12
12
Six characters, twelve bytes, and under LC_ALL=C the "character" count is the byte count.
(That is macOS's wc; I did not test GNU coreutils.)
A script that runs in a bare environment, such as a cron job or a CI step, can report bytes while you believe you are reading characters.
How much this matters depends on what you write.
My project CLAUDE.md is English with a few Korean phrases: 11,762 characters, 11,828 bytes.
My memory index for the same project is mostly Korean: 1,846 characters and 2,498 bytes, 35% heavier against a byte limit than against a character one.
Measure your own
This is the smallest version that works without my tooling. Run it from a project root:
export LC_ALL=en_US.UTF-8
echo "global CLAUDE.md: $(wc -m < ~/.claude/CLAUDE.md)"
echo "global rules: $(cat ~/.claude/rules/*.md | wc -m)"
echo "project CLAUDE.md: $(wc -m < CLAUDE.md)"
echo "same file, bytes: $(wc -c < CLAUDE.md)"
In this blog's repository on 2026-11-13 it printed:
global CLAUDE.md: 26988
global rules: 51529
project CLAUDE.md: 11762
same file, bytes: 11828
It undercounts in ways you should check by hand.
It follows no @path imports, it ignores project rules and any CLAUDE.md in a parent directory, and it counts every global rule even if one has paths: and would load on demand.
For the authoritative list, the docs point to /context all and its Memory files section.
My own script walks those cases, and for the same repository it reports 98,960 of 150,000.
The 8,681 on top of the three lines above is a CLAUDE.md in my home directory, which sits above every repository I own (6,835), and the memory index (1,846).
The memory index is my assumption: the docs sentence about the combined limit names CLAUDE.md files, rules and imports, and does not mention it.
The global share
Later on 2026-11-01 I measured the files that load in every project: 26,019 characters in the global CLAUDE.md, 50,265 in the rules, 4,136 in the home-directory file.
That is 80,420, which left 69,580 for any one project.
The warning said 24.1k for the global file and my note says 26,019. The file changed during the day. It was 24,167 characters at the 15:56 commit and 26,019 at the 19:13 one, and 1,362 characters of that growth are the paragraph I added to record the limit, which spent some of the budget it describes. No committed state matches 24.1k exactly (24,167 rounds to 24.2k), and I did not record what time the warning appeared, so I cannot reconcile the two readings.
Twelve days later the same three groups read 26,988, 51,529 and 6,835. That is 85,352, or 57% of the total, with 64,648 left. I learned the number and still spent another 4,932.
What I changed, and the choice I am still making
The project fix was one commit the same evening.
A long section of per-feature invariants moved out of CLAUDE.md into a file under docs/, and the file went from 85,247 characters to 22,042.
Today that project starts at 112,754.
The global side is the real decision, and I can see informed people going the other way.
One option is thin always-loaded files, with everything else in skills and path-scoped rules that load when relevant.
The docs lean this way: they set a target of under 200 lines per CLAUDE.md and say longer files "consume more context and reduce adherence."
My global CLAUDE.md is 261 lines.
The other option is what I do: keep the global rules rich and always loaded, and make each project file pay for it by staying thin. My reason is the kind of rule that lives there. A rule against bypassing a failing pre-commit hook is useless if it loads after the hook was bypassed, and an on-demand file can be cut short, as the truncation note above admits. An always-loaded rule cannot fail to arrive.
The strongest argument against me is that I am not measuring the thing that matters.
A character count says what was loaded, not what was followed.
I have no evidence that adherence dropped at 161.5k or improved at 112.7k, and the docs' claim about length applies to my 85,352 global characters as much as to any project file.
The test I apply before adding a global rule is how many sessions it fires in; if the answer is "only when doing one kind of work," it belongs in the skill for that work.
Of the 4,932 characters added since, 2,233 went into the global CLAUDE.md and rules and 2,699 into the home-directory file.
Limits
Every count here was taken on one Mac, on macOS 26.7.3 with Claude Code 2.1.323, on 2026-11-13, except the 2026-11-01 figures, which come from my notes and from git history.
The 150k total rests on one observed warning and on strings in the CLI binary; the documentation confirms that a combined limit exists and that crossing it warns, and gives no number.
I do not know whether the figure depends on the session's context window.
The 40,000, 200,000 and 150,000-character on-demand limits, the MEMORY.md limits, the 4 MiB skip and Codex's 32 KiB default are from the two docs pages as read on 2026-11-13.
The Codex guide does not say whether the global file in ~/.codex counts toward its limit, and I did not test it.
I have not seen the CLI's own counting rule, so my script's total is a model of the warning, not a reproduction of it.
Get the next post.
Follow new posts in your RSS reader.