Summary
Currently there is no way to delete or manage sessions from within the kimi-code TUI. The only way to remove a session is to manually delete its directory under ~/.kimi-code/sessions/<workspace>/ and edit session_index.jsonl to remove the corresponding JSON line. This is error-prone and tedious, especially when orphaned index entries accumulate over time.
Proposed change
Add a slash command (or extend an existing one) that allows users to list, select, and delete sessions directly from the interactive TUI.
Desired behavior
- List all sessions for the current workspace (similar to
/sessions for resuming, but with management options)
- Allow selecting one or more sessions and deleting them
- Clean up both the session directory on disk and the corresponding entry in
session_index.jsonl
- Optionally warn when a session has no matching directory (orphaned index entry)
Example interaction
> /sessions-delete
session_c391db2e 2026-07-19 15:30 C:\Users\Administrator\Documents\opencode project\test3
session_b895b8d6 [orphaned - no data]
↑/↓ to select, Space to mark, Enter to delete marked, Esc to cancel
Benefits
- Safer than manual file editing (no risk of corrupting
session_index.jsonl JSON)
- Prevents orphaned entries from accumulating
- Gives users control over disk space used by old sessions
- Consistent with the existing
/sessions / /resume workflow
Workaround (current)
Users currently have to:
rm -rf ~/.kimi-code/sessions/<workspace>/<session_id>
- Manually edit
~/.kimi-code/session_index.jsonl to remove the matching line
This is fragile — a malformed JSON line breaks the session index.
Environment
- kimi-code version: 0.27.0
- Platform: Windows / win32-x64
Summary
Currently there is no way to delete or manage sessions from within the kimi-code TUI. The only way to remove a session is to manually delete its directory under
~/.kimi-code/sessions/<workspace>/and editsession_index.jsonlto remove the corresponding JSON line. This is error-prone and tedious, especially when orphaned index entries accumulate over time.Proposed change
Add a slash command (or extend an existing one) that allows users to list, select, and delete sessions directly from the interactive TUI.
Desired behavior
/sessionsfor resuming, but with management options)session_index.jsonlExample interaction
Benefits
session_index.jsonlJSON)/sessions//resumeworkflowWorkaround (current)
Users currently have to:
rm -rf ~/.kimi-code/sessions/<workspace>/<session_id>~/.kimi-code/session_index.jsonlto remove the matching lineThis is fragile — a malformed JSON line breaks the session index.
Environment