OpenCodecontext-managementbuilt-in
/compact
Summarize the current session to save tokens. Alias: /summarize.
When to use
- ▸Long sessions approaching context limits
- ▸Before switching focus to a different part of a task
More OpenCode commands
configuration
/connect
Add a provider and API key to connect a new AI model provider.
configuration
/details
Toggle tool execution details in the conversation output.
context-management
/editor
Open the external $EDITOR for composing messages — useful for long or structured prompts. Keybind: Ctrl+x e.
session-management
/exit
Exit OpenCode. Aliases: /quit, /q. Keybind: Ctrl+x q.