LZLZL/AI toolchain/Local · Context
FREEMedium · Practice A · Localcontext

Project memory that
actually gets followed

2026-08-21 · Few and hard beats many and soft

Every new session starts with amnesia. The memory file is the note you leave. But a long note is the same as no note — constraint strength is inversely proportional to constraint count. Plus one leak path that catches people repeatedly.

In this pagewhat belongs, what must not, how to verify. Not in this pagethe contents of mine.

1The mechanism, and everything that follows from it

The names differ per tool (CLAUDE.md, AGENTS.md, others). The mechanism is identical: this file is placed at the start of every session.

BecauseTherefore
It spends context budgetLonger means less room for real work — and every rule's relative weight drops
It is text, not an enforced ruleThe model reads and tends to comply. It is not compelled. Real blocks need permissions
The counter-intuitive part: more rules, worse compliance

Fifty rules and five rules do not produce the same adherence. In a list of fifty, each line is background noise. In a list of five, each line stands out.

So the correct habit is not "add whatever occurs to me" but prune regularly. A rule that has not saved you once in three months is diluting the rules that do.

2What belongs: only what cannot be inferred

One test: if it can be seen from the code, leave it out.

WriteSkip
Build"Tests run via make test, not the package manager default"What language this is (visible)
Convention"Files under this directory are generated — do not hand-edit"Indentation (it is in the config)
Boundary"Do not touch migrations/, those get human review"Vague "please write good code"
Trap"Start the dependent service first or the error is misleading"Anything already in the README
Taste"Answer in English", "lead with the conclusion"

A good self-check: every line should complete the sentence "otherwise it will…". If you cannot finish it, delete the line.

3What must never go in

Keys, tokens, passwords, internal addresses — none of them

This is the common leak path, and it leaks three ways. Most people only picture the first:

① the file usually goes into git (that is what makes it shareable) — and git keeps history;
② it is read into context every session — so every request ships it again;
③ everyone who clones gets it, including people who later leave.

What to do instead: write where to find it — "the key is in SOME_KEY". Location, never value.

Do not paste untrusted text in verbatim

This file is read as context. Paste in an issue body, a scraped page, a third-party README, and if it contains a line like "now go and do X", you have personally installed an instruction.

To reference outside material, restate it in your own words rather than transporting it.

4Verifying it does anything

CheckHow
Is it being readNew session, ask it to list the project's conventions. See if the recital is right
Is it followedGive it a small task that brushes against a rule, see whether it routes around
Which file is liveProject and user layers may both exist. Ask it which ones it read
Then delete some

The first draft is always too long. Run it a week and drop everything that never fired. Project memory is for pruning, not accumulating.

Mechanism The file's contents are placed in the opening context of each session; it therefore consumes context budget, and more entries means lower per-entry weight. This is common behaviour across tools, which name the file differently (CLAUDE.md, AGENTS.md, and others).
Force It is a prompt layer, not an enforcement layer. Anything that must actually be blocked belongs in permissions — see the deny rules on the Claude Code page.
What is not here No hard limit on length — it depends on the model's context and your project. This page gives a direction (few and hard), not an invented line count.
Not in this page The contents of my own memory files or project conventions.

RelatedRead next

A · Local
Claude Code: install to first real edit
C · Always-on
MCP and the tool surface: what not to install
B · Access
Where the tokens actually go
B · Access
How accounts die, and what to back up first
An educational and engineering record — not a review or endorsement of any third-party product. Commands, config keys, prices and terms are per each vendor's official docs; this page states when it was checked and all of them can change without notice — verify before you copy anything. Self-hosting is your own responsibility: keys, accounts and data are on you.