Codex Session Export
Codex session conversation chat export markdown interactive terminal tool.
Install
git clone https://github.com/MeXenon/codex-session-exportInstall command taken from the project's README or registry entry. Always review code before running it.
README excerpt
Read full README on GitHub →Codex (ChatGPT) Session Export ⚡️
The ultimate, terminal-native export pipeline for Codex.
If you find this tool useful, please consider leaving a ⭐️ on this repository! It helps others find the project.
🛑 The Problem
When working with advanced agentic AI models (like Codex, ChatGPT, or Claude), they sometimes hallucinate, make mistakes, or lose track of their context. When things go wrong—or when you pull off an incredibly complex workflow—you need to analyze exactly what happened.
You might need to:
- Feed the session into another AI model for debugging or code review.
- Extract just the terminal commands to create an automated script.
- Read through the agent's hidden internal reasoning.
- Strip away thousands of lines of verbose tool outputs to see the actual conversation.
Currently, there’s no official feature built for this granular level of control. If you just export raw logs, you get a massive, unreadable wall of text.
💡 The Solution
Codex Session Manager (codex-md.py) is designed for maximum flexibility. It parses your local .jsonl session logs and provides a beautiful, interactive, fullscreen terminal UI (TUI) to dynamically filter exactly what you want to export into clean Markdown.
Because it’s a pure Python CLI tool, it's completely portable. You can use it locally on your laptop, or run it headlessly on a remote VPS. It is 100% compatible with the Codex CLI extension and app.
✨ Features
- **Current Codex Tool Compatibility (Updated in v2.6.5):** Terminal, patch, MCP, and other tool activity is normalized across legacy calls, mixed Code Mode
execwrappers, current canonicalCommandExecution/FileChange/McpToolCallrecords, and newer Responses tool-item families. Mixed wrappers no longer hide patches or MCP calls, canonical records replace successful fallbacks without duplicates, and failed patch attempts remain visible. - **Project View & Pagination (New in v2.6):** Just like Codex Desktop, your sessions are now grouped by project (their working directory). Toggle between a flat All Sessions list and a Projects view with a single key, drill into any project to see only its threads, and page through large histories cleanly with
n/p— no more giant unreadable walls of sessions. - Find by Session ID: Paste a full session ID, rollout filename, or long ID prefix to jump straight to the matching session and see its title, workspace, date, size, and source file before exporting.
- 20 Filterable Sections: Toggle everything from User/Agent messages to hidden agent reasoning, terminal commands, MCP tool calls, git snapshots, and more.
- Parallel Exports: Select and process multiple sessions at the same time. The filter will show you the combined line counts and will export them simultaneously in one batch.
- Dynamic Output Capping: Terminal payloads can be hundreds of thousands of lines long. Instantly cap output blocks to exactly 1, 5, 8, 10, or up to 500 lines to keep your context windows lean.
- Granular Message Filtering: Independently control how many of the last N blocks you want from each message type — 👤 User, 🤖 Agent, 🧠 Agent Reasoning, and 🔒 Internal Reasoning — all separately adjustable with
◀/▶. Each defaults to showing all, so you only cut what you need. - **Last N Turns (New in v2.4):** Don't need the full session? Select only the most recent N turns to export. A "turn" is one user message plus all the
Similar plugs
CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies
Bash is all you need - A nano claude code–like 「agent harness」, built from 0 to 1
Documented system prompts from Anthropic - Claude Fable 5.1, Opus 5.5, Claude Design, Claude Code. OpenAI - ChatGPT GPT-6-Astra, Codex. Google - Gemini 3.8 Flash, 3.1 Pro,…
Wrap Antigravity, ChatGPT Codex, Claude Code, Grok Build, Muse Code, Devin as an OpenAI/Gemini/Claude/Codex compatible API service, allowing you to enjoy the free Gemini…