Cmd. /compact
Summarize a long conversation to free context.
Key takeaways
- Summarize a long conversation to free context.
- Check the input surface and availability before using the examples below.
Purpose
Summarize a long conversation to free context.
/compactAvailability
| Field | Value |
|---|---|
| Input surface | Running CLI prompt |
| Kind | Built-in |
| Status | Current reference |
| Aliases | — |
| Documented minimum | Not specified |
| Reviewed against | 2026-09-22 · Codex CLI 0.155.1 |
The installed command menu and account or organization settings determine availability.
Examples
/compactWhen to use it
- Compact after a long investigation before moving into implementation.
- Compact before handing a session to another teammate, then run
/status.
Choosing related commands
| Command | Difference | Choose It When |
|---|---|---|
/compact | Summarizes long transcript context | The session is long but still useful |
/clear | Clears and starts a fresh chat | You want a true reset |
/new | Starts a new conversation | You want a new task in the same CLI |
Effects and persistence
Replaces older conversation context with a summary. Identify decisions and constraints that must survive before compacting.
/compact summarizes the visible conversation so Codex can keep the critical points without
overloading the context window.
Cautions
- Review the summary if the task contains subtle requirements.
- Do not compact away unresolved blockers, IDs, test results, or acceptance criteria.
Official sources
Complete command list · Verification scope · History for this command