Stop rebuilding debug views
Convert a session once and get the full trajectory: threads, turns, tool calls, compactions. No per-agent visualizer to maintain.
Open source · Apache-2.0 · Early development (M0)
ModelCtx defines CCM, an open data model for agent context, converts sessions from agent clients into it, and shows the context window of every model call — including how subagents and the main agent hand work to each other.
Convert a session once and get the full trajectory: threads, turns, tool calls, compactions. No per-agent visualizer to maintain.
Upload with one command, then send a link. Other developers open the real session in ModelCtx Studio instead of a screenshot.
Local-first. Redacted on your machine. End-to-end encrypted in the cloud, so the server only ever stores ciphertext.
ModelCtx Studio, personal spaces and share links are planned for milestones M1–M3; today the project ships the data model and the converters.
Tracing tools show which calls happened. CCM shows what was inside the window at each call, where it came from, how many tokens it took, and why it was compacted or dropped. The primitives follow Codex app-server and Claude Code transcripts.
ThreadOne context window: a main agent, a subagent, or a fork.
TurnOne unit of work started by an input.
ItemAn atomic record with a lifecycle: user message, agent message, reasoning, tool call, compaction, injection.
MemoryA record in a store shared across threads, like AGENTS.md.
The context window is derived from the records, not stored: the model-visible items of a thread since its last compaction, plus the thread instructions.
Convert a Claude Code or Codex session into a .mctx file and inspect it.
git clone https://github.com/modelctx-ai/modelctx
cd modelctx && bash scripts/setup.sh
# Claude Code → CCM
node apps/cli/dist/cli.js convert ~/.claude/projects/<project>/<session>.jsonl -o session.mctx
node apps/cli/dist/cli.js inspect session.mctx
# Codex CLI: all of ~/.codex/sessions
node apps/cli/dist/cli.js convert --from codex -o codex.mctx| Claude Code | Converter (synthetic fixtures) |
|---|---|
| Codex CLI | Converter (synthetic fixtures) |
| Gemini CLI, Cursor, OpenCode, … | Planned |
| OpenTelemetry GenAI, Langfuse, LangSmith | Planned |
ModelCtx is not an agent runtime and not a production observability backend. It interoperates with Langfuse, LangSmith and OpenTelemetry GenAI instead of replacing them.