Convert Claude Code chat sessions to Markdown
Project description
claude-chat-to-md
Convert Claude Code chat sessions to clean, readable Markdown — including subagent conversations.
Claude Code persists full chat history as JSONL files under ~/.claude/projects/. This tool reads those files and produces well-formatted Markdown with proper headings, code blocks, and collapsible sections for tool results and subagent conversations.
Install
pipx install claude-chat-to-md
Or with pip:
pip install claude-chat-to-md
Or run directly from source:
git clone https://github.com/luckynick/claude-chat-to-md.git
cd claude-chat-to-md
pip install -e .
Usage
List sessions
claude-chat-to-md --list
# Date ID Title Project
------------------------------------------------------------------------------------------------------------------------
1 2025-10-15 14:30 a1b2c3d4.. Refactor auth middleware dev/myapp
2 2025-10-14 09:15 e5f6a7b8.. Add user settings page dev/myapp
3 2025-10-13 16:45 c9d0e1f2.. Debug CI pipeline dev/infra
Convert a session
# By index (from --list)
claude-chat-to-md 1 -o chat.md
# By UUID prefix
claude-chat-to-md a1b2c3 -o chat.md
# By title substring
claude-chat-to-md "auth middleware" -o chat.md
# Most recent session
claude-chat-to-md --latest -o chat.md
Filter by project
claude-chat-to-md --list --project myapp
claude-chat-to-md --latest --project myapp -o chat.md
Export all sessions
claude-chat-to-md --all --output-dir ./exports/
Options
| Flag | Description |
|---|---|
--list, -l |
List all available sessions |
--latest |
Convert the most recent session |
--all |
Convert all sessions |
--project, -p |
Filter sessions by project path substring |
--output, -o |
Output file (default: stdout) |
--output-dir, -d |
Output directory for --all mode |
--no-subagents |
Exclude subagent conversations |
--no-tool-results |
Exclude tool call results |
Output format
- User messages →
## Usersections - Assistant messages →
## Assistantsections with text and tool calls - Tool results → collapsible
<details>blocks - Subagent conversations → collapsible
<details>blocks with full prompt/response - Code → fenced code blocks with language hints
- Diffs → displayed as unified diff format
- System tags (
<ide_opened_file>,<system-reminder>) are stripped
How it works
Claude Code stores sessions at:
~/.claude/projects/<encoded-project-path>/<session-uuid>.jsonl
Each line is a JSON object: user messages, assistant messages (with tool_use blocks), tool_result responses, and metadata. Subagent conversations live in a subagents/ subdirectory alongside the main session.
Requirements
Python 3.10+ — no external dependencies.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file claude_chat_to_md-0.1.0.tar.gz.
File metadata
- Download URL: claude_chat_to_md-0.1.0.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac5f25e4ea6730d5b386df9ccb8fee3ab950bee2f4316f36ffd98fddca1fdcc8
|
|
| MD5 |
b6950194c9d50b0eca253b330de9dfaa
|
|
| BLAKE2b-256 |
185c04e3b713ea25a8d0c5da16cae412a27c53991fe878bd7309644f7bebb60a
|
Provenance
The following attestation bundles were made for claude_chat_to_md-0.1.0.tar.gz:
Publisher:
publish.yml on luckynick/claude-chat-to-md
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_chat_to_md-0.1.0.tar.gz -
Subject digest:
ac5f25e4ea6730d5b386df9ccb8fee3ab950bee2f4316f36ffd98fddca1fdcc8 - Sigstore transparency entry: 1188840634
- Sigstore integration time:
-
Permalink:
luckynick/claude-chat-to-md@3c0b969d14ff680bd56883fac8e247c413d89b26 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/luckynick
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3c0b969d14ff680bd56883fac8e247c413d89b26 -
Trigger Event:
release
-
Statement type:
File details
Details for the file claude_chat_to_md-0.1.0-py3-none-any.whl.
File metadata
- Download URL: claude_chat_to_md-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1d9b46a967743b239f2e54edeb58994db4b19958e6a85c248039461499c629b
|
|
| MD5 |
dc247d97ecf9a18aecddef9ecc7d8701
|
|
| BLAKE2b-256 |
cb868e4614477495429ab2b64124730577d6759f8dbc7c4abc94582409dcd617
|
Provenance
The following attestation bundles were made for claude_chat_to_md-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on luckynick/claude-chat-to-md
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_chat_to_md-0.1.0-py3-none-any.whl -
Subject digest:
a1d9b46a967743b239f2e54edeb58994db4b19958e6a85c248039461499c629b - Sigstore transparency entry: 1188840691
- Sigstore integration time:
-
Permalink:
luckynick/claude-chat-to-md@3c0b969d14ff680bd56883fac8e247c413d89b26 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/luckynick
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3c0b969d14ff680bd56883fac8e247c413d89b26 -
Trigger Event:
release
-
Statement type: