A Python script to export Claude Code conversation history from JSONL format to human-readable text files.
- Multi-language Support - 10 languages supported (zh, en, es, fr, de, ja, ko, ru, pt, it)
- Smart Message Merging - Automatically merges consecutive messages from the same role
- Code Cleanup - Removes line numbers and arrow markers from code blocks
- Chat-style Format - Uses emojis for clean, readable output
- Code-friendly - No indentation in tool results, easy to copy code
- Zero Dependencies - Uses only Python standard library
# Basic usage (exports to ./output directory by default)
python3 main.py
# View exported files
ls output/# Chinese (default)
python3 main.py
# English
python3 main.py --lang en
# Japanese
python3 main.py --lang ja
# Korean
python3 main.py --lang ko
# Other languages: es, fr, de, ru, pt, itoutput/
├── home-user--doter/
│ ├── xxx_first_content.txt
│ └── ...
├── home-user-cchistory/
│ └── ...
└── home-user-work-Code-Plus/
└── ...
────────────────────────────────────────────────────────────────────────────────
👤 User | 2025-12-30T02:53:40.140
────────────────────────────────────────────────────────────────────────────────
Check if implementation matches design docs.
────────────────────────────────────────────────────────────────────────────────
🤖 Assistant | 2025-12-30T02:53:49.910
────────────────────────────────────────────────────────────────────────────────
I'll help you check the implementation.
🔧 Read
参数: {file_path: /home/user/.../design.md}
🔧 Read
参数: {file_path: /home/user/.../proto}
────────────────────────────────────────────────────────────────────────────────
👤 User | 2025-12-30T02:53:54.246
────────────────────────────────────────────────────────────────────────────────
✅ 结果:
syntax = "proto3";
package delivery.v1;
...
# Specify output directory
python3 main.py /path/to/output
# Specify both source and output directories
python3 main.py /output /path/to/.claude/projects
# Export in English to specific directory
python3 main.py --lang en /path/to/english/output
# View help
python3 main.py --help- Consecutive messages from the same role are automatically merged
- Reduces repetitive header information
- Improves readability
- Automatically removes line numbers and arrows (e.g.,
1→,100 →) - Preserves original indentation
- Code ready to use directly
- Extracts key information from first few lines of conversation
- Uses underscores, no spaces
- Length limited to ~20 Chinese characters
- Python Version: 3.6 or higher (tested on Python 3.6+)
- Dependencies: Standard library only (zero third-party dependencies)
- Cross-platform: Linux, macOS, Windows
- Default Output:
./output/ - File Encoding: UTF-8
- Batch Export: Run the script directly to export all projects automatically
- Backup: Copy the entire
output/directory for backup - Search: Exported text files can be easily searched
- Version Comparison: Compare conversation records from different time periods
main.py- Main scriptREADME.md- This fileLICENSE- MIT License
| Code | Language | Example |
|---|---|---|
zh |
中文 | 👤 用户 / 🤖 助手 |
en |
English | 👤 User / 🤖 Assistant |
es |
Español | 👤 Usuario / 🤖 Asistente |
fr |
Français | 👤 Utilisateur / 🤖 Assistant |
de |
Deutsch | 👤 Benutzer / 🤖 Assistent |
ja |
日本語 | 👤 ユーザー / 🤖 アシスタント |
ko |
한국어 | 👤 사용자 / 🤖 어시스턴트 |
ru |
Русский | 👤 Пользователь / 🤖 Ассистент |
pt |
Português | 👤 Usuário / 🤖 Assistente |
it |
Italiano | 👤 Utente / 🤖 Assistente |
This project is licensed under the MIT License - see the LICENSE file for details.