Capped at 256 KB, trimmed back to the newest 500 lines. Done once per run before anything is written: the no-change path logs nothing, so that is the only point at which the file can have grown since the last run. Failures are swallowed - housekeeping must never be the reason an update does not land. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>