Session Persistence & Chat Logs
Save and restore full conversation histories with configurable retention periods and automatic cleanup.
Overview
CodeMantis can save your complete session conversations locally so you can review past exchanges, search through previous solutions, and restore context from earlier work. Chat logs are stored in a local SQLite database and are never sent to CodeMantis servers.
Enabling Session Persistence
Session saving is enabled by default. To check or change the setting:
- Open Settings (Cmd + ,)
- Go to the Session Logs tab
- Toggle Save session conversations
When enabled, every message — user messages, Claude's responses, tool operations, and approval decisions — is persisted to disk as the conversation progresses. If CodeMantis closes unexpectedly, your conversation is preserved.
Retention Periods
Choose how long saved sessions are kept before automatic cleanup:
| Option | Description |
|---|---|
| 7 days | Aggressive cleanup — only keeps the most recent week |
| 14 days | Two-week rolling window |
| 30 days | Default — balances storage and history |
| 90 days | Extended history for longer projects |
| Forever | Never auto-delete — manage storage manually |
Automatic Cleanup
Cleanup runs automatically when CodeMantis launches. Sessions older than the configured retention period are deleted from the local database. This keeps disk usage under control without requiring manual intervention.
Changing the retention period takes effect on the next app launch. Sessions that fall outside the new window will be cleaned up automatically.
What Gets Saved
When session persistence is enabled, the following data is stored locally:
- User messages — Everything you typed, including attachments
- Claude's responses — Full markdown responses with code blocks
- Tool operations — File reads, writes, edits, bash commands, and their results
- Approval decisions — Whether you approved or denied each tool operation
- Session metadata — Session name, model used, timestamps, token counts, cost
Restoring Sessions
When you reopen a project, previously saved sessions can be restored with their full chat history. Restored sessions show a divider line in the chat to indicate where the original session ended and the restored session begins.
This is separate from Claude's server-side session history (accessible via the History tab). Local persistence preserves the full UI state including tool operations and approval history, while Claude's history only preserves the conversation text.
Storage Location
Chat logs are stored in your macOS application data directory:
~/Library/Application Support/dev.codemantis.app/The SQLite database inside this directory contains all persisted session data. You can back up this directory if needed, but do not modify the database files while CodeMantis is running.
Tips
- Keep the default 30-day retention unless you have a specific reason to change it. It provides good history without excessive storage use.
- Use "Forever" for long-running projects where you might need to reference conversations months later.
- Session persistence is independent of Claude's history. Even if a session expires on Claude's servers, your local copy remains until the retention period expires.
Related Articles
- Sessions & Session Management — Managing active sessions
- Claude History — Server-side session history and resume
- Settings Reference — All settings including Session Logs