claude-code·Published 2026.06.01
AI Getting Dumber as the Chat Gets Long? Tidy Its Mind with /compact
/compact summarizes a long conversation to free up memory. Learn how to compress just the essentials while keeping context, and the crucial difference from
Have you ever seen Claude, which answered smartly at first, start forgetting what it said early on and saying odd things as the conversation got longer? This is called "Context Rot." Like people, AI gets dumber when its mind is full. /compact is a command that tidies up this mind. It compresses the conversation so far into a summary, keeping the essentials and emptying the clutter.
Definition
/compact is a command that summarizes a lengthened conversation to free up memory. Here, "memory" means the size of the context (the conversation content the AI remembers at once).
The key point is that it compresses while keeping the context. Rather than throwing away the whole conversation, it shortens it into a "summary," keeping the core intent and direction while making just the volume lighter. In practice, a 70,000-token (token — the AI unit for counting characters) conversation can shrink to 4,000 tokens. So it is good for continuing long work without interruption.
How to Use (by difficulty)
Basics — Summary Compression
Type just this into the chat box.
/compact
Once you enter it, Claude summarizes and compresses the conversation so far. A message like "Compressed the conversation" appears on screen, and after that it continues lighter and faster while keeping the core context.
Advanced — Specifying What to Keep
/compact 코드 변경 위주로 남겨줘
You can decide what to center on when summarizing. Saying "focus on code changes" reduces the chit-chat and preserves code-related context first. It is useful for pinpointing and keeping the core of the work.
Deeper — Only When Needed, After Checking Capacity
/context 로 용량 확인 → /compact
Check the current usage first with /context (context — a command that shows how full the memory capacity is now), and run /compact only when it is heavily filled. It is an approach of judging by the state rather than compressing blindly.
Common Pitfall — Never Confuse It with clear
What beginners confuse most is /clear and /compact. The two are completely different.
/clear= amnesia: Empties the whole conversation and starts fresh. The context disappears./compact= summary tidying: Reduces just the volume while keeping the context intact.
So the rule is simple. If you will continue the same work, /compact; if the topic changes completely, /clear. Be careful: using /clear on work you are in the middle of blows away all the context up to then.
Real-World Example
In a long refactor that ran all day, responses gradually slowed, and Claude started forgetting rules set earlier. I had to finish the work, so I could not empty the conversation. So I used this.
/compact
With only the capacity freed while the context stayed intact, the response speed revived and Claude continued the work clearly again. It was like "tidying just the mind" without throwing away the conversation.
Using It Further
- Empty early at 60%: Do not wait until it is packed to 95%. By then the quality has already dropped. Compressing early around 60% keeps the session clear.
- Specify focus: You can decide what to preserve, like "keep code changes mainly."
- Compress after checking: Look at capacity with
/contextand run/compactonly when needed. - Distinguish from clear: If continuing work, compact; if the topic changes, clear. Just remember this.
Tip: During long work, check capacity with
/context, and if you exceed 60%, run/compactand feel for yourself whether response speed and accuracy revive. The habit of emptying early protects the quality of long work.
How Others Use It
- A 70,000-token conversation was compressed to about 4,000 tokens (intent and direction kept). — Preventing Context Rot with /compact (MindStudio)
- Compacting at 60% capacity rather than 95% keeps the session clear. — The article above (MindStudio)
- A flow of watching usage with /context and compressing with /compact when it exceeds 80%. — Claude Code Context Optimization (InfoGrab)
Summary
The core fits in one sentence. When it gets long, empty it. But if you will continue, compact, not clear. AI getting dumber as the conversation lengthens is not a bug but the nature of it (Context Rot), and /compact delays that limit by reducing only capacity while protecting context. Do not wait until 95%; empty early at 60%.
Based on: Claude Code v2.1.154 (2026.05)
Comments
Comments 0
Checking sign-in status…
Loading comments…