A tiny, dependency-free Python script that exports Claude Code JSONL transcripts to Markdown.
It recursively scans your Claude Code projects directory, preserves the project-oriented folder structure, and writes clean Markdown files that you can open in VS Code, Obsidian, GitHub, ripgrep, or feed back into Claude/ChatGPT later.
No browser UI. No database. No server. Just Markdown.
Claude Code already stores useful local transcripts as .jsonl files. This script turns them into a durable, portable engineering notebook.
Good for:
- archiving Claude Code sessions
- searching old explanations with
rg - building project notes
- saving debugging sessions
- reusing previous context in future AI chats
- committing selected exports to a private notes repository
Requires Python 3.10+ and no third-party packages.
chmod +x claude_md_exporter.pyCopy the example config:
cp config.example.json config.jsonEdit config.json if needed, then run:
python3 claude_md_exporter.py --config config.jsonOr use CLI overrides:
python3 claude_md_exporter.py \
--source ~/.claude/projects \
--target ~/Documents/claude-exportsInclude tool outputs when you want complete transcripts:
python3 claude_md_exporter.py --config config.json --include-tool-outputs{
"source_dir": "~/.claude/projects",
"target_dir": "~/Documents/claude-exports",
"overwrite": true,
"include_tool_calls": true,
"include_tool_outputs": false,
"include_system_messages": false,
"include_attachments": false,
"include_metadata": true,
"skip_sidechains": false,
"filename_template": "{project}/{date}_{title_or_session}.md"
}filename_template supports:
{project}- first folder under the source directory{date}- session start date{title}- Claude-generated or inferred title{session}- session UUID / file stem{title_or_session}- title fallback{source_stem}- original JSONL filename without extension
Nested JSONL files, such as subagent transcripts, keep their nested location below the project folder.
~/Documents/claude-exports/
└── -home-lukap-repos-artemis/
├── 2026-05-02-why-is-docker-compose-f-docker-mysql-yml-up-giving-me-the-error.md
├── 2026-05-06-could-you-find-out-for-me-maybe-using-database-migration-files.md
└── 2026-05-08-so-im-currently-working-here-on-artemis-in-this-repository.md
Each Markdown file contains metadata plus readable User, Assistant, and optional tool sections.
By default, tool calls are included but tool outputs are excluded. This keeps files readable while preserving the commands Claude ran. Use --include-tool-outputs for full forensic transcripts.
The exporter skips obvious non-chat artifacts such as tool-results directories.