Hacker News new | ask | show | jobs
by illusive4080 323 days ago
Not for me. It gets worse when context is nearly full. I like to compact or clear context more often than it does automatically.
2 comments

I’ve thought about that but always forget, good to know it helps.

I wish there were a way to persist in-memory context in a file automatically, say on each compact or git commit. Yesterday CC crashed and restarting it and feeding it all the context was a pain since my updated Claude.md file was a couple of days old. It literally went from a Sr Engineer to a Jr post crash.

You can do that with hooks! Make a small script that triggers on a commit tool use or a compact hook and reads the conversation file (should be available via inputs to the hook) and back it up somewhere
Do you do this via settings or just keep track of it and manually ask it to do it more often?
(Not the person you're responding to, but) It says how close it is to compacting in bottom right, once it's getting close at least (30% left or something?)

Whenever I see that I think about whether I can find a good point to compact or clear. I also just try to clear whenever it makes sense to avoid getting there and try to give smaller tasks that can be cleared after they're done when possible.

Oh, I guess one thing I do is sometimes have it write a file with what was done, if I'm not actually sure if I want to clear or might want to come back to it. I also sometimes do this rather than compact during a large task - document status and clear.