4 hacks
Ask Claude to log architecture decisions and TODOs into a repo file that can be re-read after /compact.
When Claude repeats a project gotcha, end your prompt with an instruction to write a CLAUDE.md rule so it never happens again.
Keep the root CLAUDE.md short and drop domain-specific CLAUDE.md files under paths like src/db/ so Claude loads them only when it works in that area.
Enable /memory auto-memory so Claude writes durable notes about build commands, corrections, and patterns that reload on every new session.