Skip to content

petro-byte/claude-code-markdown-exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Claude Code Markdown Exporter

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.

Why

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

Install

Requires Python 3.10+ and no third-party packages.

chmod +x claude_md_exporter.py

Usage

Copy the example config:

cp config.example.json config.json

Edit config.json if needed, then run:

python3 claude_md_exporter.py --config config.json

Or use CLI overrides:

python3 claude_md_exporter.py \
  --source ~/.claude/projects \
  --target ~/Documents/claude-exports

Include tool outputs when you want complete transcripts:

python3 claude_md_exporter.py --config config.json --include-tool-outputs

Configuration

{
  "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"
}

Template variables

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.

Output example

~/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.

Notes

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.

About

Simple standalone exporter for Claude Code conversations. Recursively scans your .claude folder and converts .jsonl chat logs into clean, portable Markdown while preserving your project folder structure.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages