{"name":"\/compact","slug":"compact","family":"slash","title":"Slash commands","noun":"slash command","description":"Free up context by summarizing the conversation so far. Optionally pass focus instructions for the summary. See [how compaction handles rules, skills, and memory files](\/docs\/en\/context-window#what-survives-compaction)","description_source":"docs","described_by":{"doc":"claude-code\/commands","title":"Commands"},"presence":{"first_seen":null,"removed_in":null,"in_current_build":false,"newest_mined":"2.1.309","builds":0,"mined_builds":150,"first_cited":{"version":"2.1.248","released_at":"2026-08-27 20:35:36","spans":7}},"aliases":[],"entries":[{"version":"2.1.305","anchor":"usage-gains-actionable-savings-suggestions-with-one-click-f","heading":"\/usage can suggest ways to save and queue a fix for you","line":"\/usage can now point out what is costing you most and suggest fixes such as `\/compact` or lower effort, which you can queue as a follow-up","released_at":"2026-10-20 19:29:36","reason":"found in this entry's text"},{"version":"2.1.293","anchor":"compact-command-flags-that-its-display-repeats-the-summary","heading":"\/compact now notes when its message already shows the summary","line":"The result of `\/compact` now records whether its on-screen message repeats the conversation summary","released_at":"2026-10-07 17:18:04","reason":"found in this entry's text, named in this entry"},{"version":"2.1.286","anchor":"agent-view-slash-commands-compact-clear-rewind-now-prom","heading":"\/compact , \/clear and \/rewind ask to confirm inside an agent view","line":"Typing `\/compact`, `\/clear` or `\/rewind` while viewing an agent now asks you to confirm running it on the main conversation","released_at":"2026-09-30 17:14:38","reason":"found in this entry's text, named in this entry"},{"version":"2.1.283","anchor":"spinner-no-longer-shows-a-compaction-progress-bar","heading":"The compaction progress bar under the spinner is gone","line":"The spinner row no longer shows a percentage bar while a conversation is being compacted","released_at":"2026-09-25 18:46:11","reason":"found in this entry's text"},{"version":"2.1.283","anchor":"compaction-now-resets-response-length-and-signals-a-request","heading":"Progress display resets when compaction starts","line":"When compaction begins, Claude Code now resets the response length counter and switches the display to a requesting state","released_at":"2026-09-25 18:46:11","reason":"found in this entry's text, named in this entry"},{"version":"2.1.282","anchor":"new-cold-resume-quota-warning-when-resuming-a-long-idle-con","heading":"Warning before resuming a long, idle conversation that would use much of your usage limit","line":"Resuming a large, long-idle conversation can show an estimate of how much of your 5-hour usage limit it will use, with an option to start fresh","released_at":"2026-09-24 15:56:22","reason":"found in this entry's text"},{"version":"2.1.274","anchor":"many-image-dimension-error-no-longer-suggests-compact-when","heading":"Many-image dimension error no longer suggests \/compact when compaction is disabled","line":"Image-too-large error stops suggesting \/compact when compaction is disabled","released_at":"2026-09-16 22:36:09","reason":"found in this entry's text"},{"version":"2.1.274","anchor":"critical-memory-usage-banner-text-unchanged-but-reformatted","heading":"Critical memory usage banner text unchanged but reformatted with memoized hook","line":"The 'Critical memory usage' banner code was reorganized with memoization, keeping the same wording","released_at":"2026-09-16 22:36:09","reason":"found in this entry's text"},{"version":"2.1.267","anchor":"sdkheadless-sessions-get-an-explicit-rejection-for-compact","heading":"SDK\/headless sessions get an explicit rejection for compact()","line":"Calling compact() in headless SDK sessions now returns a clear rejection instead of silently doing nothing","released_at":"2026-09-09 18:25:42","reason":"found in this entry's text"},{"version":"2.1.267","anchor":"sessioncompact-implementation-gated-by-disable-compact","heading":"session.compact implementation gated by DISABLE_COMPACT","line":"session.compact now blocks itself while DISABLE_COMPACT is set or a turn is still running","released_at":"2026-09-09 18:25:42","reason":"found in this entry's text"}],"entries_total":25,"docs":[{"source":"claude-code","path":"commands","title":"Commands","documented":true},{"source":"api","path":"about-claude\/models\/optimizing-for-cost-and-intelligence","title":"optimizing-for-cost-and-intelligence","documented":false},{"source":"api","path":"agents-and-tools\/tool-use\/memory-tool","title":"memory-tool","documented":false},{"source":"api","path":"agents-and-tools\/tool-use\/tool-runner","title":"Log at info level","documented":false},{"source":"api","path":"api\/migration-2026-10-21","title":"Before","documented":false},{"source":"api","path":"api\/opentelemetry\/spans","title":"spans","documented":false},{"source":"api","path":"build-with-claude\/compaction","title":"sent_count = len(messages sent in the compaction request)","documented":false},{"source":"api","path":"build-with-claude\/compaction-background","title":"compaction-background","documented":false},{"source":"api","path":"build-with-claude\/compaction-keep-recent-turns","title":"compaction-keep-recent-turns","documented":false},{"source":"api","path":"build-with-claude\/compaction-on-demand","title":"compaction-on-demand","documented":false}],"docs_total":13,"gates":[],"related":[],"url":"https:\/\/changelogs.core-directive.com\/reference\/slash\/compact","family_url":"https:\/\/changelogs.core-directive.com\/reference\/slash.json"}