Convert Claude Code or Codex chat sessions to Markdown
Project description
cc2md
Convert Claude Code or Codex chat sessions to Markdown.
Install
pip install cc2md
Quick Start
# Most recent Claude Code session
cc2md --agent claude --latest -o log
# Most recent Codex session
cc2md --agent codex --latest -o log
Usage
cc2md --list # list all sessions
cc2md --latest -o log # most recent session → log.md (or log/)
cc2md --agent codex --latest -o log # most recent Codex session
cc2md 1 -o log # by index from --list
cc2md a1b2c3 -o log # by UUID prefix
cc2md "auth middleware" -o log # by title substring
cc2md --all -d ./exports/ # export all sessions
cc2md --latest -p myapp -o log # filter by project
If a session spawned subagents, output is a directory:
log/
index.md # main conversation, links to subagents
reduce-min-host-层实现-a46d2ef.md
reduce-min-device-层实现-a95f57b.md
...
Options
| Flag | Description |
|---|---|
--list, -l |
List available sessions |
--latest |
Most recent session |
--all |
Convert all sessions |
--agent |
Source backend: claude (default) or codex |
--project, -p |
Filter by project path substring |
--dir |
Custom source directory |
--output, -o |
Output path |
--output-dir, -d |
Output directory for --all |
--no-subagents |
Exclude subagent conversations |
--no-tool-results |
Exclude tool call results |
Output Format
- Tool calls are expanded inline; results are collapsed in
<details>blocks - Code edits (
Write,Edit,MultiEdit,apply_patch,Delete, …) render asdiffblocks
**Tool: exec_command**
```bash
git status --short
```
<details><summary>Result: exec_command</summary>
```
M README.md
```
</details>
**Tool: apply_patch**
Applying patch
```diff
*** Begin Patch
*** Update File: README.md
@@
-old line
+new line
*** End Patch
```
**Result: apply_patch**
```
Success. Updated the following files:
M README.md
```
Requirements
Python 3.10+, no external dependencies.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cc2md-1.0.tar.gz
(23.1 kB
view details)
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
cc2md-1.0-py3-none-any.whl
(24.6 kB
view details)
File details
Details for the file cc2md-1.0.tar.gz.
File metadata
- Download URL: cc2md-1.0.tar.gz
- Upload date:
- Size: 23.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e45bd0ee5538ad7840bfeb55412096ac6b15bf92105a874883d03860675bedfb
|
|
| MD5 |
0ca0af8955b00cbce8db1c606c90e5ba
|
|
| BLAKE2b-256 |
ec2a8c05ee4ff5124030c11d3408894f2baa12598eda7d8faff7794f55b9ee08
|
File details
Details for the file cc2md-1.0-py3-none-any.whl.
File metadata
- Download URL: cc2md-1.0-py3-none-any.whl
- Upload date:
- Size: 24.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b955f8d2f4e26e9633aaa59eaf82d28304347e2b84269abb4d14c81a79dd1ea
|
|
| MD5 |
c04b93eaca6d7e592f7235a7facf5195
|
|
| BLAKE2b-256 |
10a6dc4c17069874dd58f2703d3f9596d17c30ba00e9066bd1f604adb8c792d3
|