A tool turns Claude Code sessions into local model training data

Claude Code stores work sessions on disk as `.jsonl` files under `~/.claude/projects/`. Those files contain real coding conversations, including back-and-forth edits, tool calls, and . `claude_converter` turns those session files into a message format that local tools can use.

The output works with `TRL`, `Axolotl`, and `LLaMA-Factory`. It also includes `clean_messages()` to remove unwanted blocks before training. `inspect_session()` shows token counts and a breakdown of the session content before the data is used.

The tool has zero dependencies.

Key points

  • Claude Code sessions are saved locally as `.jsonl` files.
  • `claude_converter` converts those files into a training-ready message format.
  • The converted data works with `TRL`, `Axolotl`, and `LLaMA-Factory`.
  • `inspect_session()` helps check token counts and content structure before training.
  • Reusing existing sessions may lower the cost of experimenting with .
Read original