# /compact

Source: https://www.storeframe.io/docs/get-started/claude-code/generic-commands/compact

Summarize conversation history to free context tokens without starting over.

`/compact` compresses the conversation into a summary so you can keep working in the same thread with more free context. Rules, skills, and memory files survive compaction.

## Optional instructions

`/compact [instructions]` steers what the summary keeps. Example: `/compact keep the Magento plugin files we touched and the failing test output`.

Without instructions, Claude summarizes the whole conversation.

## vs /clear and /resume

* `/compact` shrinks history and **continues** this conversation.
* [/clear](/docs/get-started/claude-code/generic-commands/clear) discards history and **starts over**.
* [/resume](/docs/get-started/claude-code/generic-commands/resume) restores a **different** conversation from disk.

Use `/compact` when you still need the thread, but the context window is filling up.
