Rules That Run is a ten-part series on the rules that keep an AI agent setup honest. This is part 4.
The global instruction file is the one thing every Claude Code session on my machine reads. Every interactive session, every subagent that loads it, every turn of every one of them carries it in context. By the start of October mine had grown to about 16.7K tokens. It had started as a page of preferences and turned into a manual: long sections on deploy steps, scheduled-task settings, email routing and design rules, each one added after something went wrong.
Every section was there for a reason. That was the problem. Nothing was obviously safe to delete, so nothing was deleted, and the file kept growing while the agent's attention to any single line kept shrinking.
On October 4, 2026, as part of the context diet in part 2, I cut it to about 3.5K tokens. I did not delete a single rule to get there.
The rule stays, the detail moves
Each section in the new file has the same shape. The rule itself, in one or two lines, stays in the file. Everything else, the background, the edge cases, the commands, the history of how we got there, moves to a reference file. The section ends by naming that file and telling the agent to read it before working in that area.
## Scheduled tasks
Every task runs hidden, without a stored password, and with the battery
conditions turned off. After registering, start it, poll it and check the
real side effect. Full: `reference/scheduled-tasks.md`.
The agent always sees the rule. It only pays for the detail when it is about to do the work the detail is for. A session spent writing a blog post never loads the scheduled-task reference. A session registering a scheduled task reads it first.
This is the same move the Claude Code docs recommend under moving instructions from the main file to skills: detailed workflow instructions sit in context during unrelated work, while "Skills load on-demand only when invoked." I used plain reference files rather than skills for most sections, because a reference file can be named directly from the rule that needs it and read with an ordinary file read. Either works. What matters is that the always-loaded file holds the rule and the on-demand file holds the manual.
Move it verbatim
The most important decision in the cut was to move the long sections word for word. I did not summarise them, tighten them or merge them on the way out.
Every one of those sections had at least one sentence that existed because of a specific failure. A summary keeps the gist and drops exactly that sentence, because the sentence looks like an edge case. Later the edge case happens again and the rule that would have caught it is gone. Moving verbatim means nothing is rewritten and nothing is lost. The reference file is the old section, exactly as it was, and git history holds the full pre-cut file as well.
The cut itself was mechanical: for each long section, create the reference file, paste the section in unchanged, replace the section in the main file with its one-line rule and a pointer, and check that every reference path in the main file resolves to a file that exists.
# every reference the main file names must exist
grep -o '`reference/[^`]*`' ~/.claude/INSTRUCTIONS.md | tr -d '`' \
| while read -r f; do [ -f ~/.claude/"$f" ] || echo "missing: $f"; done
Memory, one fact per file
The same pressure applies to the agent's memory: the notes it keeps across sessions about decisions, preferences, platform quirks and past mistakes. A single growing memory file has the same problem as a growing instruction file, so memory follows the same pattern.
Each memory is one fact in its own file. The file starts with a one-line description, and that line is what recall matches against.
---
description: Scheduled task stuck in Queued on a laptop means the battery condition, not a hang
---
The default task settings refuse to start on battery. The task sits in
Queued and the last result still shows the previous success...
One fact per file makes each memory cheap to load, easy to find, and easy to delete when it stops being true. A memory that is wrong can be removed without editing around anything else.
Indexes that load when relevant
A pile of single-fact files needs an index, and the index has the same budget problem. So there are two levels.
The top index loads in every session and holds only the items that are always needed: the handful of rules and facts that apply to almost any task. It stays small on purpose. Adding to it is a decision, and the default answer is no.
Below it are section indexes, one each for feedback and working style, platform gotchas, references, and projects. Each section index lists its memories with their one-line descriptions. A section index loads when the work touches its area. A session about a deploy pulls the platform index. A session about writing pulls the feedback index. Most sessions never load most of the memory.
What belongs in memory at all
The rule of thumb that keeps memory small is simple: memory is for what a future session cannot work out from the environment. If the repo, its README, the decision log or git history already records something, it does not go in memory. The agent can read the repo.
What does go in memory is the kind of thing that is invisible from the files: a preference stated once in conversation, the reason a strange-looking setting must not be changed, the failure that a check exists to catch. Those are the facts a fresh session would otherwise rediscover the expensive way.
The monthly audit
A short file drifts back toward a long one. Each new incident adds a line, each line looks necessary, and the reference files grow their own duplicates. So once a month an instruction audit re-reads the files with three questions: has anything drifted from what the setup actually does, is any rule stated in two places, and is any rule stale because the thing it governs no longer exists.
The audit is the piece that keeps the structure honest. Without it, the main file would be back at a manual within a few months, and the indexes would point at memories that describe a setup that has since changed.
What the cut did and did not do
The measurable result was in part 2: a fresh session's starting context went from 63,141 tokens to 47,192 on October 4, 2026, with the instruction file cut as one of three changes. That saving is paid back on every turn of every session and every subagent.
The cut did not make the agent follow the rules better by itself. A one-line rule is easier to notice than a paragraph buried in a manual, and that helps. The rules that hold every time are still the ones wired into hooks, as in part 3. The short file does a different job: it makes sure the rules the agent does read are the ones that matter, and that the rest is one file read away when the work calls for it.
Build it yourself
- Measure your global instruction file in tokens and list its sections by size.
- For each long section, write the rule in one or two lines.
- Move the rest of the section, word for word, into a reference file, and end the rule with the file's path.
- Check that every path named in the main file exists.
- Store memory as one fact per file, each with a one-line description used for recall.
- Keep one small always-loaded index and put everything else in section indexes that load by topic.
- Before saving a memory, ask whether the repo or git history already records it. If it does, skip it.
- Put a monthly audit on the calendar for drift, duplicates and stale rules.