Wait what, didn't know claude code can do that:
Compacted while idle, before the prompt cache expired · turn off with "idleCompaction": false in settings.json