Automatic conversation export / persistent session logging

Resolved 💬 1 comment Opened Apr 19, 2026 by Mustafa-AbdulRazek Closed May 26, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

Add support for automatic conversation export that persists session history to a file without requiring manual /export invocations.

Long technical sessions — iterative debugging, model tuning, architecture brainstorming — produce valuable decision trails: why a design was chosen, what was ruled out, what the reasoning was. Today, capturing that requires the user to remember to run /export before closing the session. If the window closes unexpectedly, that context is lost permanently.

This is particularly relevant for research and engineering workflows where conversation logs serve as informal lab notebooks and audit trails.

Proposed Solution

Two complementary modes would cover the main use cases:

  1. Session file — on session start, Claude Code creates (or appends to) a

dated log file at a configurable path, e.g.:
~/.claude/sessions/YYYY-MM-DD-HH-MM.md
The file updates incrementally after each turn, so a crashed session still
has a complete log up to the last message.

  1. Named persistent file — a config option to always export to a fixed path

(e.g. docs/current-session.md), overwriting on each update, useful for
teams that version-control their session logs.

## Configuration Sketch

```json
// settings.json
{
"sessionExport": {
"enabled": true,
"mode": "dated", // "dated" | "fixed"
"path": "docs/sessions", // directory for dated, or file path for fixed
"format": "markdown" // markdown only for now
}
}

Why Not a Hook?

The Stop hook runs shell commands but has no access to conversation content,
so it cannot replicate this behaviour today. This needs first-class support
from the runtime.

Alternative Solutions

  • Manual /export — works but is easy to forget; provides no incremental

safety net for long sessions.

  • Stop hook workaround — blocked by lack of conversation content access

in hook context (see above).

Priority

Medium - Would be very helpful

Feature Category

Documentation

Use Case Example

_No response_

Additional Context

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗