Claude Code compacts your session on its own at 100 percent of the context window, which is about the worst moment for it to happen. Run /compact yourself at around 60 percent, at a clean stop, and you get the same summary at a moment you picked.
/compact summarizes the session and keeps only the important parts. One run took my context from 60 percent of the window to 13. Left alone, the automatic one fires mid thought and breaks the prompt cache on the way past, and by then the quality has usually started slipping.
📎 The free file is attached to this post
➡️ claude-code-token-diet.zip
💡 What is in the zip
✅ CLAUDE.md with all eleven token fixes. Rule 4 has Claude remind you to compact once the window passes about 60 percent
✅ handoff.md, for when compacting is not enough and you would rather start a fresh session
⚙️ Setting it up
Put CLAUDE.md in the root folder of your project. /compact is already built into Claude Code, so there is nothing to install, and /context shows you how full the window is.
Do you compact by hand, or do you let it fire on its own? Tell me in the comments.