/compact
Compacts the current chat’s context.
Compacts the current chat’s context to free space in the context window. Codex replaces the prior history with a compact summary so the session can continue without dropping older messages.
🔄 THE SAME TASK (“COMPACT CONTEXT”) ON OTHER PLATFORMS
- Claude Code: /compact
- Cursor CLI: /summarize
✅ WHEN TO USE IT?
Make room in a long chat without starting over
/compact
⛔ WHEN NOT TO?
The chat is still short
compacting costs detail; while there is enough free context it gains nothing.
Better: just keep working
SOURCES
- Codex CLI docs: Slash Commands ↗ developers.openai.com