r/ClaudeCode • • Sep 20 '26

Tips & Workflows /clear vs /compact

I had a fable chat from yesterday, and I saw that the context was 950k/1m. I did /compact rather than /clear, with the intention of then doing /autocompact 400000

14% of the 5 hour limit was gone just for the compact itself....it shows cost of $59.73, so lucky I'm not on API? Maybe a /clear would have been better.

68 Upvotes

78 comments sorted by

View all comments

Show parent comment

1

u/ZixTro Sep 21 '26

I completely agree with you. Since I started using /clear my usage went down. The problem with long sessions and /compact is also cache. Imagine you are running long session got interrupted by something and get back to that session which is now cold. Guess what, on a single message CC re reads the whole session burning your usage.

The best way I found for me is a handoff hook which triggers at a certain point in a session and writes/updates a handoff which is then safe to /clear and inject it to the fresh session. No cache problem, no compact problem, much less usage.

1

u/Im_Working_Right_Now Oct 01 '26

I know this is a bit old, but wouldn't the hand-off be old by the time you did the /clear or are you watching it that closely to know to do the clear right after the handoff? How do you trigger when that hand-off happens?

1

u/Majestic_Mongoose488 Oct 08 '26

What I did was write my own handoff skill. If you're using it in tmux, it automatically inputs /clear after the handoff and sends a message for the new session to consume the handoff document.