MEMORY.md loads into context at the start of every session, so its size is
a recurring cost paid on every turn of every conversation in that scope. Claude
Code's own limit (200 lines / 25KB) is a truncation point, not a budget:
content past it is silently dropped on the next load. This hook enforces a real
budget well below that, so the index stays an index.
Both files below are in production use, not written for this gist.