I have such hook, and it works well. It increases time, but it’s negligible if agent works for 10+ mins before the final output. The hook is only on stop event, so agent is not interrupted during the session. I didn’t have luck in putting it to skill / md files, as agent just ignores it after a couple of iterations. The solution is not perfect, sometimes it compresses too much, and I have to reread both versions, but at least I don’t have to read load bearing stuff anymore