In talking to the Uk developers, about keeping a record of Claude Code conversations, it was mentioned that CC transcripts are kept for 30 days.
Google search AI gave this response about exporting these :
Keeping logs of Claude Code transcripts is crucial for maintaining context over long-term projects and reviewing AI-generated code. Claude Code locally stores your conversation history, which can be accessed, searched, and exported using various tools.
1. Default Local Logging
Claude Code automatically records sessions in your local environment, typically stored in JSONL format.
Location:
~/.claude/(on Mac/Linux).Project-Specific: Logs for specific projects are in
~/.claude/projects/, with folders named based on the project path.Retention: By default, logs are retained for 30 days, though this is configurable.
2. Tools for Exporting and Viewing Logs
Several community tools help convert these raw logs into readable formats (Markdown/HTML):
claude-code-transcripts: A Python CLI tool (uvx claude-code-transcripts) that allows you to select local Claude Code sessions and convert them into detailed HTML pages.
claude-code-log: A Python tool to generate clean, chronological HTML pages of user prompts and assistant responses.
conversation-logger: A tool to save JSONL transcripts, parse them into markdown, and enable full-text search.SpecStory: A wrapper that launches Claude Code and automatically saves conversations to
.specstory/history/in your project directory in Markdown.3. Best Practices for Logging and Context
Search History: You can ask Claude Code directly to search through your past conversations: “What did we talk about regarding X today?”.
Use
/clear: For long sessions, use the/clearcommand to reset the context while still saving the previous transcript, keeping the prompt history clean.Commit Logs: Consider adding your log directory (e.g.,
.specstory/history/) to version control to document why changes were made.Alternative Storage: For, very long sessions, consider having Claude create a summary or a “Decision State” (Plan/Stack/Constraints) to carry over to a new session.
4. Privacy and Security
Zero Data Retention: You can configure API keys to not retain chat transcripts on servers.
Local Storage: Be aware that
~/.claude/may store detailed data, including inputs and outputs.
