Claude Code session
Claude Converter
A zero-dependency Python module for inspecting and converting coding-agent session files (.jsonl) — Claude Code, Codex, and Pi — into the messages format expected by Hugging Face Transformers.
Install
git clone https://github.com/FredyRivera-dev/claude_converter.gitFrom the README
A zero-dependency Python module for inspecting and converting coding-agent session files (.jsonl) — Claude Code, Codex, and Pi — into the messages format expected by Hugging Face Transformers.
Each of these tools stores its session history as a JSONL file on disk, one JSON record per line: user prompts, assistant responses, tool calls, tool results, and extended thinking/reasoning blocks. This module parses each tool's format and flattens it into the same simple [{"role": ..., "content": ...}] list that tokenizer.apply_chat_template() consumes directly — so downstream code doesn't need to know or care which tool produced the session.
Why this exists
The conversion pipeline has two stages that are often conflated:
apply_chat_template() handles stage 2 (turning a messages list into model-specific token sequences), but it knows nothing about any of these tools' JSONL formats. This module handles stage 1, for all three.
Installation
Quick start
The unified Converter class is the recommended entry point. Pick the tool with the converter argument ("claude-code" is the default) and every method behaves the same regardless of which tool produced the file.
Claude Code
Codex
Pi
huggingface_hub is only needed to pull the example files above — it is not a dependency of claude_converter itself.
To go straight to a messages list ready for apply_chat_template():
Legacy API (still supported)
If you only ever work with Claude Code sessions and don't need the multi-tool
dispatch, the original module-level functions are still available and
unchanged — nothing here was touched or deprecated:
This is exactly the API that existed before Converter was introduced. Use
it if you want a direct import with no dispatch layer in between; use
Converter if you want one interface…Details
- Repository
- FredyRivera-dev/claude_converter
- Language
- Python
- License
- Apache-2.0
- Last updated
- 10 July 2026
- Topics
- anthropicclaudeclaude-codecodexcodex-cliconverterdatasetfine-tuninghuggingfacejsonlllmmessages
FAQ
What is Claude Converter?
A zero-dependency Python module for inspecting and converting coding-agent session files (.jsonl) — Claude Code, Codex, and Pi — into the messages format expected by Hugging Face Transformers. It is a session for Claude Code, from FredyRivera-dev/claude_converter on GitHub.
How do I install Claude Converter?
Clone FredyRivera-dev/claude_converter from GitHub and follow the setup steps in its README.
Is Claude Converter popular?
FredyRivera-dev/claude_converter has 48 GitHub stars and 5 forks. It was last updated on 10 July 2026.
More sessions & history
Argot
52get-tmonier/argot
A statistical code analyzer built from your repository's history.
Jev Belay
45valentynkit/jev-belay
Claude Code Stop hook that blocks an unverified done: reads the transcript for evidence, asks Jev once, fails open on everything else
Claude Session Tracker
48ej31/claude-session-tracker
Auto-save every Claude Code session to GitHub Projects. Never lose Prompt & Context again.
AI Memory Reader
50nvwalj/ai-memory-reader
The native macOS & iOS app for browsing AI agent memory files — Claude Code, OpenClaw, Codex, Cursor, Gemini
Claude Code Cleaner
49GarrickZ2/claude-code-cleaner
Interactive TUI tool to clean up disk space accumulated by Claude Code (~/.claude/) — reclaim GBs from orphaned project caches, old session data, debug logs, telemetry, and stale config entries.
Claude Skillify
470xMH/claude-skillify
Open-source Claude Code plugin porting the internal /skillify skill: turn a finished session's repeatable workflow into a reusable SKILL.md you can rerun with a slash command.
Browse the most popular Claude Code mods, all sessions & history, or the skills and MCP server directories.