Kimi Code CLI supports multi-session management and context persistence, allowing you to pause and resume work at any time.
Session resumption
You can resume a previous session in several ways:
Continue the most recent session
Use the --continue (or -c) flag to continue the last conversation.
Specify a session ID
Use the --session flag to restore a specific session.
Browse and switch
Run /sessions (or /resume) to view the session list and select one to restore.
Startup replay
When resuming a session, Kimi Code CLI automatically replays the conversation history, helping you quickly recall the previous context and progress.
State persistence
The following state is automatically saved and restored across sessions:
- Approval decisions: Decisions such as "Allow for Session" are remembered.
- Dynamic sub-agents: Sub-agent configurations created during a session are preserved.
- Additional directories: Extra working directories added via commands are also persisted.
This means you can seamlessly continue your previous work after resuming a session.
Clear & compact
Kimi Code CLI automatically compresses the context when needed to ensure the conversation can continue. You can also manage the context manually with slash commands:
Clear context
Enter /clear (or /reset) to clear all context in the current session and start a fresh conversation:
Compact context
Enter /compact to compress the context — preserving key information while reducing token usage:
You can also include instructions when compacting to tell the AI which information to prioritize:
Context status
The status bar at the bottom of the CLI displays the current context utilization in real time, helping you monitor context consumption. When utilization is high, use /compact to compress the context and avoid losing important information.