Command reference Β· Claude Code
/compact
Summarizes the conversation so far to free up context.
Summarizes the conversation so far to free up space in the context window. Optionally you pass a focus instruction as an argument, for example /compact focus on open TODOs and next steps β the summary then specifically keeps what you specify, instead of what the automatic pass considers important. Project CLAUDE.md and auto-memory are then automatically reloaded from disk; path-bound rules and nested CLAUDE.md files in subfolders, on the other hand, are lost until the corresponding file is read again. Invoked skill content is also reloaded, but capped at 5,000 tokens per skill and 25,000 tokens in total.
π¬ AS A SHORT VIDEO
Summarizes the conversation so far to free up context.
π THE SAME TASK (βCOMPACT CONTEXTβ) ON OTHER PLATFORMS
- Codex CLI: /compact
- Cursor CLI: /summarize
β WHEN TO USE IT?
Free up context while continuing work on the same topic
/compact
Steer the summary specifically
/compact focus on open TODOs and next steps
β WHEN NOT TO?
Complete change of topic
/compact summarizes the conversation so far and keeps the thread; for a complete change of topic, this drags along unnecessary baggage according to the docs β the docs explicitly name /clear as the way for unrelated new work.
Better: /clear
SOURCES
- Claude Code docs (official) β code.claude.com
MORE COMMANDS Β· Claude Code