UniSessions MCP server
Commit Oct 27, 2026Converts AI coding CLI sessions between multiple providers and exports traces for model fine-tuning.
Also known as vibheksoni/session-export
- Stars
- 22
- Tools
- 5
- Downloads, 30 days
- —
- Latest version
- —
- Last commit
- Oct 27, 2026
- License
- MIT
What is UniSessions MCP?
UniSessions converts AI coding CLI sessions between multiple providers and exports traces for model fine-tuning. It exposes 5 tools, such as list_chats, index_status, refresh_chats_index.
Summary generated from the project's README
About UniSessions MCP server
UniSessions is an SDK-first tool designed for developers who use multiple AI coding command-line interfaces. It enables the movement of conversation histories between various providers, including Claude Code, Codex, Devin, Factory, Grok Build, Pi, and Windsurf Cascade. By supporting 132 different conversion directions, it ensures that useful context is not lost when switching between different coding agents.
Beyond simple conversion, the tool allows users to export sessions as traces in formats like HuggingFace STS, OpenAI fine-tuning, or ShareGPT. This makes it possible to use tool calls and reasoning data for model training. It also includes an MCP server that provides chat recall capabilities, allowing an agent to search through old project histories to learn from previous bug fixes or solutions.
What you can do with it
- 1Migrate coding sessionsMove a specific conversation history from Claude Code to Pi without losing context.
- 2Prepare data for fine-tuningExport your AI coding traces to HuggingFace format to train new models.
- 3Recall past project knowledgeAsk an AI agent to search through your previous chat history to find how a specific bug was solved.
Written from the project's README. Every use case is checked against a quote from it.
UniSessions MCP tools 5
Detected from the READMElist_chatsindex_statusrefresh_chats_indexsearch_chatssearch_sessions
| list_chats | — | |
| index_status | — | |
| refresh_chats_index | — | |
| search_chats | — | |
| search_sessions | — |
Configuration
UNISESSIONS_NO_TOOL_CALLSUNISESSIONS_SEARCH_INDEX
| Name | Description | |
|---|---|---|
| UNISESSIONS_NO_TOOL_CALLS | — | |
| UNISESSIONS_SEARCH_INDEX | — |
Automated checks
Ran Nov 13, 2026Full report →Not verified yet. A server needs a score of 80, no serious finding, and enough data for us to check. How checks work · What to fix for more points
- Source repository linked and reachablevibheksoni/session-export is public and reachablegithub.com/vibheksoni/session-export ↗Pass
- Package names this repository as its sourceNot checked
- Build provenance (Sigstore attestation)Not checked
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit or release 2026-10-27github.com/vibheksoni/session-export ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNot checked
- No critical advisory in the package or its dependenciesNot checked
- No hidden instructions to the model5 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNo tool named like delete, drop or execPass
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubUniSessions
UniSessions is an SDK-first AI CLI session converter for moving sessions between Codex, Claude Code, Pi, OpenCode, Devin, Factory, Windsurf Cascade, Grok Build, Freebuff Desktop, OMP (oh-my-pi), and Command Code, reading T3 Code threads too, with trace export for HuggingFace and fine-tuning (tool calls and reasoning included), plus an MCP chat recall server built on top.
▄▄▄ ▄▄ ▄▄▄▄▄
█▀██ ██ ██▀▀▀▀█▄
██ ██ ▄ ▀▀ ▀██▄ ▄▀ ▀▀ ▄
██ ██ ████▄ ██ ▀██▄▄ ▄█▀█▄ ▄██▀█ ▄██▀█ ██ ▄███▄ ████▄ ▄██▀█
██ ██ ██ ██ ██ ▄ ▀██▄ ██▄█▀ ▀███▄ ▀███▄ ██ ██ ██ ██ ██ ▀███▄
▀█████▄▄██ ▀█▄██ ▀██████▀▄▀█▄▄▄█▄▄██▀█▄▄██▀▄██▄▀███▀▄██ ▀██▄▄██▀
Convert one AI CLI session format into another across Codex, Pi, OpenCode, Claude Code, Devin, Factory, Windsurf Cascade, Grok Build, Freebuff Desktop, OMP, and Command Code.
I use a lot of AI coding CLIs Codex Claude Code Pi OpenCode Devin Factory Windsurf Grok and wanted to move a session from one tool into another without losing the useful conversation history
Table of Contents
- Why I built this
- Quick Start
- Supported AI coding agents
- Conversion directions (132 in total)
- How to list sessions
- How to convert sessions
- How to export traces
- Options: tool calls and thinking
- How to handle conflicts
- How to bulk export
- How to use custom paths
- MCP server for agent chat recall
- SDK usage
- Architecture
- Default session paths
- Data fidelity
- Performance
- FAQ
- Contributing
- Development
- License
Why I built this
I looked for a tool that could convert one AI CLI session into another AI CLI session format and found nothing so I built one
I also wanted my agent to remember things from my other sessions like if I solved a bug in one project I wanted to tell it hey in that other session I fixed this by doing X and it would go check and learn from it instead of me explaining the same thing again
So this does two things
- Moves your sessions between Codex Pi OpenCode Claude Code Devin Factory Windsurf Cascade Grok Build Freebuff Desktop, OMP, and Command Code in any direction: 132 combinations, counting T3 Code
- Exports sessions as traces in HuggingFace STS OpenAI fine-tuning or ShareGPT format for Hub upload or model training
- Lets your agent search through all your old chat history across all projects and providers so it can recall what you did before and learn from it
Then I wanted the project to not be locked into a CLI or MCP its an SDK first so you can use it for other projects to do cool stuff like build a GUI for it or whatever you want the CLI and MCP server are just built on top of the SDK
Quick Start
Install from PyPI:
pip install unisessions
python -m unisessions list codex
python -m unisessions list pi
python -m unisessions list opencode
python -m unisessions list claude
python -m unisessions list devin
python -m unisessions list factory
python -m unisessions list windsurf
python -m unisessions list grok
python -m unisessions list freebuff
python -m unisessions list omp
python -m unisessions list commandcode
python -m unisessions list t3
Or clone the repo:
git clone https://github.com/vibheksoni/session-export.git
cd session-export
pip install -e .
python -m unisessions list codex
Convert a single session (dry-run first, then write):
python -m unisessions codex-to-pi <session-id>
python -m unisessions codex-to-pi <session-id> --write
python -m unisessions claude-to-pi <session-id> --write
python -m unisessions devin-to-pi <session-id> --write
python -m unisessions factory-to-pi <session-id> --write
python -m unisessions windsurf-to-pi <session-id> --write
python -m unisessions freebuff-to-pi <session-id> --write
python -m unisessions omp-to-pi <session-id> --write
python -m unisessions commandcode-to-pi <session-id> --write
python -m unisessions t3-to-pi <session-id> --write
python -m unisessions t3-to-codex <session-id> --write
Export a session as a HuggingFace trace:
python -m unisessions to-trace codex <session-id> --format sts --write -o trace.jsonl
Bulk export all Codex sessions to Pi:
python -m unisessions codex-to-pi-all --write --workers 8
Search across all sessions via MCP:
python -m unisessions.mcp_server
Supported AI coding agents
| Agent | Store | Session Format | Session IDs |
|---|---|---|---|
| OpenAI Codex | codex |
JSONL rollout files under date tree | UUID v7 |
| Pi | pi |
JSONL append-only tree entries in cwd-encoded dirs | UUID v7 |
| OpenCode | opencode |
Official export/import JSON | ses_ prefixed |
| Claude Code | claude |
JSONL transcript files in cwd-sanitized dirs | UUID v4 |
| Devin (Windsurf CLI) | devin |
ATIF transcript JSON + SQLite metadata | slug names |
| Factory (Droid) | factory |
JSONL transcript files with session headers | UUID v4 |
| Windsurf (Cascade) | windsurf |
AES-256-GCM encrypted protobuf trajectory files | UUID v4 |
| Grok (Grok Build and grok-cli) | grok |
ACP updates.jsonl + summary.json per session dir (Grok Build), SQLite grok.db (grok-cli) |
session directory name, or session id |
| Freebuff (Freebuff Desktop) | freebuff |
Per-project SQLite desktop-v2.db (threads + messages) + project.json |
thread id |
| OMP (oh-my-pi) | omp |
JSONL tree entries in cwd-encoded dirs, with a fixed-width title line | UUID v7 |
| Command Code | commandcode |
JSONL under projects/<cwd slug>/. Reads all three file versions (v1 Anthropic lines, v2 flat, v3 tree). Writes v3. |
UUID |
| T3 Code | t3 (source) and experimental target |
SQLite userdata/statev2.sqlite (legacy state.sqlite). Reads are read-only. |
thread id |
Conversion directions (132 in total)
T3 Code adds 22 directions, 132 in total. Reading T3 is stable: eleven t3-to-<provider> commands. Writing into T3 is experimental: eleven <provider>-to-t3 commands write a thread into a new, empty T3 home, which T3 imports the first time it starts there. The live T3 data directory is never written. See docs/stores.md.
| From \ To | Pi | Codex | OpenCode | Claude | Devin | Factory | Windsurf | Grok | Freebuff | OMP | Command Code |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Codex | codex-to-pi |
-- | codex-to-opencode |
codex-to-claude |
codex-to-devin |
codex-to-factory |
codex-to-windsurf |
codex-to-grok |
codex-to-freebuff |
codex-to-omp |
codex-to-commandcode |
| Pi | -- | pi-to-codex |
pi-to-opencode |
pi-to-claude |
pi-to-devin |
pi-to-factory |
pi-to-windsurf |
pi-to-grok |
pi-to-freebuff |
pi-to-omp |
pi-to-commandcode |
| OpenCode | opencode-to-pi |
opencode-to-codex |
-- | opencode-to-claude |
opencode-to-devin |
opencode-to-factory |
opencode-to-windsurf |
opencode-to-grok |
opencode-to-freebuff |
opencode-to-omp |
opencode-to-commandcode |
| Claude | claude-to-pi |
claude-to-codex |
claude-to-opencode |
-- | claude-to-devin |
claude-to-factory |
claude-to-windsurf |
claude-to-grok |
claude-to-freebuff |
claude-to-omp |
claude-to-commandcode |
| Devin | devin-to-pi |
devin-to-codex |
devin-to-opencode |
devin-to-claude |
-- | devin-to-factory |
devin-to-windsurf |
devin-to-grok |
devin-to-freebuff |
devin-to-omp |
devin-to-commandcode |
| Factory | factory-to-pi |
factory-to-codex |
factory-to-opencode |
factory-to-claude |
factory-to-devin |
-- | factory-to-windsurf |
factory-to-grok |
factory-to-freebuff |
factory-to-omp |
factory-to-commandcode |
| Windsurf | windsurf-to-pi |
windsurf-to-codex |
windsurf-to-opencode |
windsurf-to-claude |
windsurf-to-devin |
windsurf-to-factory |
-- | windsurf-to-grok |
windsurf-to-freebuff |
windsurf-to-omp |
windsurf-to-commandcode |
| Grok | grok-to-pi |
grok-to-codex |
grok-to-opencode |
grok-to-claude |
grok-to-devin |
grok-to-factory |
grok-to-windsurf |
-- | grok-to-freebuff |
grok-to-omp |
grok-to-commandcode |
| Freebuff | freebuff-to-pi |
freebuff-to-codex |
freebuff-to-opencode |
freebuff-to-claude |
freebuff-to-devin |
freebuff-to-factory |
freebuff-to-windsurf |
freebuff-to-grok |
-- | freebuff-to-omp |
freebuff-to-commandcode |
| OMP | omp-to-pi |
omp-to-codex |
omp-to-opencode |
omp-to-claude |
omp-to-devin |
omp-to-factory |
omp-to-windsurf |
omp-to-grok |
omp-to-freebuff |
-- | omp-to-commandcode |
| Command Code | commandcode-to-pi |
commandcode-to-codex |
commandcode-to-opencode |
commandcode-to-claude |
commandcode-to-devin |
commandcode-to-factory |
commandcode-to-windsurf |
commandcode-to-grok |
commandcode-to-freebuff |
commandcode-to-omp |
-- |
How to list sessions
python -m unisessions list codex
python -m unisessions list pi
python -m unisessions list opencode
python -m unisessions list claude
python -m unisessions list devin
python -m unisessions list factory
python -m unisessions list windsurf
python -m unisessions list grok
python -m unisessions list freebuff
python -m unisessions list omp
python -m unisessions list commandcode
How to convert sessions
All commands default to dry-run. Add --write to produce output.
python -m unisessions codex-to-pi <session-id> --write
python -m unisessions pi-to-codex <session-id> --write
python -m unisessions codex-to-opencode <session-id> --write
python -m unisessions pi-to-opencode <session-id> --write
python -m unisessions opencode-to-codex <session-id> --write
python -m unisessions opencode-to-pi <session-id> --write
python -m unisessions claude-to-pi <session-id> --write
python -m unisessions pi-to-claude <session-id> --write
python -m unisessions claude-to-codex <session-id> --write
python -m unisessions codex-to-claude <session-id> --write
python -m unisessions claude-to-opencode <session-id> --write
python -m unisessions opencode-to-claude <session-id> --write
python -m unisessions devin-to-pi <session-id> --write
python -m unisessions pi-to-devin <session-id> --write
python -m unisessions devin-to-codex <session-id> --write
python -m unisessions codex-to-devin <session-id> --write
python -m unisessions devin-to-opencode <session-id> --write
python -m unisessions opencode-to-devin <session-id> --write
python -m unisessions devin-to-claude <session-id> --write
python -m unisessions claude-to-devin <session-id> --write
python -m unisessions factory-to-pi <session-id> --write
python -m unisessions pi-to-factory <session-id> --write
python -m unisessions factory-to-codex <session-id> --write
python -m unisessions codex-to-factory <session-id> --write
python -m unisessions factory-to-opencode <session-id> --write
python -m unisessions opencode-to-factory <session-id> --write
python -m unisessions factory-to-claude <session-id> --write
python -m unisessions claude-to-factory <session-id> --write
python -m unisessions factory-to-devin <session-id> --write
python -m unisessions devin-to-factory <session-id> --write
python -m unisessions windsurf-to-pi <session-id> --write
python -m unisessions pi-to-windsurf <session-id> --write
python -m unisessions windsurf-to-codex <session-id> --write
python -m unisessions codex-to-windsurf <session-id> --write
python -m unisessions windsurf-to-opencode <session-id> --write
python -m unisessions opencode-to-windsurf <session-id> --write
python -m unisessions windsurf-to-claude <session-id> --write
python -m unisessions claude-to-windsurf <session-id> --write
python -m unisessions windsurf-to-devin <session-id> --write
python -m unisessions devin-to-windsurf <session-id> --write
python -m unisessions windsurf-to-factory <session-id> --write
python -m unisessions factory-to-windsurf <session-id> --write
python -m unisessions grok-to-pi <session-id> --write
python -m unisessions pi-to-grok <session-id> --write
python -m unisessions grok-to-codex <session-id> --write
python -m unisessions codex-to-grok <session-id> --write
python -m unisessions grok-to-opencode <session-id> --write
python -m unisessions opencode-to-grok <session-id> --write
python -m unisessions grok-to-claude <session-id> --write
python -m unisessions claude-to-grok <session-id> --write
python -m unisessions grok-to-devin <session-id> --write
python -m unisessions devin-to-grok <session-id> --write
python -m unisessions grok-to-factory <session-id> --write
python -m unisessions factory-to-grok <session-id> --write
python -m unisessions grok-to-windsurf <session-id> --write
python -m unisessions windsurf-to-grok <session-id> --write
python -m unisessions freebuff-to-pi <session-id> --write
python -m unisessions pi-to-freebuff <session-id> --write
python -m unisessions freebuff-to-codex <session-id> --write
python -m unisessions codex-to-freebuff <session-id> --write
python -m unisessions freebuff-to-opencode <session-id> --write
python -m unisessions opencode-to-freebuff <session-id> --write
python -m unisessions freebuff-to-claude <session-id> --write
python -m unisessions claude-to-freebuff <session-id> --write
python -m unisessions freebuff-to-devin <session-id> --write
python -m unisessions devin-to-freebuff <session-id> --write
python -m unisessions freebuff-to-factory <session-id> --write
python -m unisessions factory-to-freebuff <session-id> --write
python -m unisessions freebuff-to-windsurf <session-id> --write
python -m unisessions windsurf-to-freebuff <session-id> --write
python -m unisessions freebuff-to-grok <session-id> --write
python -m unisessions grok-to-freebuff <session-id> --write
python -m unisessions omp-to-pi <session-id> --write
python -m unisessions commandcode-to-pi <session-id> --write
python -m unisessions pi-to-omp <session-id> --write
python -m unisessions omp-to-codex <session-id> --write
python -m unisessions codex-to-omp <session-id> --write
python -m unisessions omp-to-opencode <session-id> --write
python -m unisessions opencode-to-omp <session-id> --write
python -m unisessions omp-to-claude <session-id> --write
python -m unisessions claude-to-omp <session-id> --write
python -m unisessions omp-to-devin <session-id> --write
python -m unisessions devin-to-omp <session-id> --write
python -m unisessions omp-to-factory <session-id> --write
python -m unisessions factory-to-omp <session-id> --write
python -m unisessions omp-to-windsurf <session-id> --write
python -m unisessions windsurf-to-omp <session-id> --write
python -m unisessions omp-to-grok <session-id> --write
python -m unisessions grok-to-omp <session-id> --write
python -m unisessions omp-to-freebuff <session-id> --write
python -m unisessions freebuff-to-omp <session-id> --write
python -m unisessions commandcode-to-pi <session-id> --write
python -m unisessions pi-to-commandcode <session-id> --write
python -m unisessions commandcode-to-codex <session-id> --write
python -m unisessions codex-to-commandcode <session-id> --write
python -m unisessions commandcode-to-opencode <session-id> --write
python -m unisessions opencode-to-commandcode <session-id> --write
python -m unisessions commandcode-to-claude <session-id> --write
python -m unisessions claude-to-commandcode <session-id> --write
python -m unisessions commandcode-to-devin <session-id> --write
python -m unisessions devin-to-commandcode <session-id> --write
python -m unisessions commandcode-to-factory <session-id> --write
python -m unisessions factory-to-commandcode <session-id> --write
python -m unisessions commandcode-to-windsurf <session-id> --write
python -m unisessions windsurf-to-commandcode <session-id> --write
python -m unisessions commandcode-to-grok <session-id> --write
python -m unisessions grok-to-commandcode <session-id> --write
python -m unisessions commandcode-to-freebuff <session-id> --write
python -m unisessions freebuff-to-commandcode <session-id> --write
python -m unisessions commandcode-to-omp <session-id> --write
python -m unisessions omp-to-commandcode <session-id> --write
python -m unisessions commandcode-to-t3 <session-id> --write
python -m unisessions t3-to-commandcode <session-id> --write
OMP resumes a session on the model its last reply names. If that model is not available, interactive omp falls back to your configured model with a warning, but omp -p and RPC mode refuse to resume unless you pass --model:
omp --resume <session-id> --model <provider/model> -p "continue"
How to export traces
Export any session as a trace file for HuggingFace Hub upload, model fine-tuning, or training data preparation. Three formats are supported:
| Format | Use case | Tool calls and reasoning |
|---|---|---|
sts |
HuggingFace Hub trace viewer (Session Trace Simple Format) | text only (the format has no tool events) |
openai |
OpenAI / Azure fine-tuning JSONL: assistant tool_calls, then role: tool results |
included |
sharegpt |
ShareGPT for LLaMA-Factory, Axolotl: gpt, function_call, and observation turns |
included |
Reasoning is written as a <think>...</think> block at the start of the assistant text. Leave either part out with --no-thinking or --no-tool-calls (see Options).
# HuggingFace STS format (default) -- print to stdout
python -m unisessions to-trace codex <session-id> --format sts
# OpenAI fine-tuning format -- write to file
python -m unisessions to-trace pi <session-id> --format openai --write -o train.jsonl
# ShareGPT format from Devin session
python -m unisessions to-trace devin <session-id> --format sharegpt --write -o traces.jsonl
Upload to HuggingFace Hub:
pip install huggingface-cli
hf upload your-username/your-dataset trace.jsonl
The Hub auto-detects the trace format and renders it in the trace viewer. See the trace export docs for SDK usage and format details.
Options: tool calls and thinking
Every conversion carries reasoning and tool calls (with their outputs and error flags) by default. Turn either part off per command, or for a whole environment:
python -m unisessions pi-to-claude <id> --write --no-tool-calls
python -m unisessions to-trace codex <id> --format openai --no-thinking --write -o train.jsonl
export UNISESSIONS_NO_TOOL_CALLS=1 # the default for every command in this shell
The same switches exist in the SDK:
from session_sdk import ConversionOptions, conversion_options
with conversion_options(ConversionOptions(include_tool_calls=False)):
plan = converter.plan(session_id) # the plan carries text and reasoning only
How to handle conflicts
When a destination file already exists use --on-conflict to control behavior:
| Mode | Behavior |
|---|---|
skip (default) |
Skip if destination exists |
overwrite |
Replace existing destination with new content |
fork |
Generate a new UUID session ID, preserve old file untouched |
update |
Overwrite only when the source file was modified after the destination was written |
python -m unisessions codex-to-pi <id> --write --on-conflict fork
python -m unisessions codex-to-pi <id> --write --on-conflict update
How to bulk export
Export all Codex sessions to one or more targets in parallel. Every target listed below is supported:
python -m unisessions codex-to-pi-all --write --workers 8
python -m unisessions export-all --write --targets pi opencode claude devin factory windsurf grok freebuff omp commandcode --workers 8
How to use custom paths
Use system defaults by omitting path flags. For backups or staging:
python -m unisessions --codex-session-dir C:\path\to\sessions list codex
python -m unisessions --pi-session-dir C:\path\to\pi\sessions list pi
python -m unisessions --opencode-session-dir C:\path\to\opencode\exports list opencode
python -m unisessions --claude-session-dir C:\path\to\claude\projects list claude
python -m unisessions --devin-session-dir C:\path\to\devin\transcripts list devin
python -m unisessions --factory-session-dir C:\path\to\factory\sessions list factory
python -m unisessions --windsurf-session-dir C:\path\to\windsurf\cascade list windsurf
python -m unisessions --grok-home C:\path\to\grok --grok-session-dir C:\path\to\grok\sessions list grok
python -m unisessions --freebuff-home C:\path\to\freebuff --freebuff-session-dir C:\path\to\freebuff\projects list freebuff
python -m unisessions --omp-agent-home C:\path\to\omp\agent --omp-session-dir C:\path\to\omp\sessions list omp
python -m unisessions --commandcode-home C:\path\to\commandcode --commandcode-session-dir C:\path\to\commandcode\projects list commandcode
OpenCode output files use the official import/export JSON shape. Load them with
opencode import <path-to-json>.
MCP server for agent chat recall
UniSessions ships a FastMCP server that exposes a SQLite FTS5 full-text search index over parsed session chat history. AI agents can use it to recall past conversations, find what was discussed, and search across all providers.
Setup
python -m unisessions.mcp_server
MCP client configuration
{
"mcpServers": {
"unisessions": {
"command": "unisessions-mcp",
"args": [],
"env": {
"UNISESSIONS_SEARCH_INDEX": "%LOCALAPPDATA%\\unisessions\\search.sqlite"
}
}
}
}
UniSessions MCP questions
What tools does UniSessions MCP provide?
It exposes 5 tools, including list_chats, index_status, refresh_chats_index, search_chats, search_sessions.
What can UniSessions convert?
It can move sessions between Codex, Pi, OpenCode, Claude Code, Devin, Factory, Windsurf Cascade, Grok Build, Freebuff Desktop, OMP, and Command Code.
Can I use the converted sessions for model training?
Yes, you can export sessions as traces in HuggingFace STS, OpenAI fine-tuning, or ShareGPT formats for model training.
Does it support searching through old chat history?
Yes, an MCP server is included that allows an agent to search through all your old chat history across all projects and providers.