Skip to main content

SimulTeX

SimulTeX

A rich browser companion for Codex and Claude Code CLI.

https://github.com/user-attachments/assets/afec92f0-c074-44c8-b4f1-846d523018f0

Demo (Codex)

SimulTeX preserves the native terminal UI while turning the conversation into a readable, scrollable browser transcript. Prompts and responses render as rich Markdown.

The browser is read-only. You continue working in the real Codex or Claude terminal session while SimulTeX mirrors it on a private localhost URL.

Quick start

SimulTeX requires Python 3.10 or newer. Install it with pipx (recommended for a CLI application):

pipx install simultex

Or install it into your current Python environment:

python3 -m pip install simultex

Both methods reject unsupported Python versions. If pipx selects an older interpreter, choose one explicitly:

pipx install --python python3.11 simultex

Launch Codex or Claude Code through SimulTeX:

simultex -- codex
simultex -- claude

Copy or open the token-bearing URL printed by SimulTeX, then press Enter to launch the child session. Keyboard input stays in the terminal; the browser follows the session live.

Resume an existing Codex or Claude conversation with its exact saved Markdown:

simultex -- codex resume SESSION_ID
simultex -- claude --resume SESSION_ID

SimulTeX reads the matching local Codex rollout when an explicit UUID or --last selects the session. If that saved history is unavailable or uses an unknown format, startup continues with the PTY-derived transcript.

What you get

  • The original Codex or Claude TUI, unchanged in your terminal
  • Exact user Markdown and assistant output for direct Codex and Claude sessions
  • Terminal composers, startup UI, tool/status output, and permission prompts
  • KaTeX math, including inline and display equations
  • Mermaid diagrams from fenced mermaid blocks
  • Syntax highlighting for explicitly labeled code fences
  • Markdown tables, lists, blockquotes, links, and images
  • Click-to-copy regions for inline code, fenced code, latex/tex fences, and Mermaid source
  • Static, self-contained HTML transcript downloads
  • PTY-only fallback for other interactive terminal programs

Why SimulTeX?

  • Works with Codex and Claude. Use the same browser experience with Codex CLI or Claude Code while continuing to work in their native TUIs.
  • Rich rendering for user/assistant messages. Both user messages and assistant responses support Markdown, LaTeX, images, Mermaid diagrams, highlighted code, tables, and more.
  • Search like a web page. Search the entire conversation with Ctrl/Cmd+F, scroll freely, and select or copy content without fighting terminal history.
  • Share a live view. Let students or collaborators follow the conversation as it happens through screen sharing or a secure localhost tunnel.
  • Let the agent focus on the answer. The agent answers in Markdown; SimulTeX handles consistent rendering without asking it to author and style an HTML artifact.
  • Customize the presentation. Because the companion is built with HTML and CSS, you can adapt its layout and styling without changing how the agent responds.
  • Export as HTML. Download the current conversation as a self-contained HTML file directly from the companion page.
  • Keep control in the terminal. The companion is read-only, so input, permissions, and interactive controls stay in the real terminal.

How it works

flowchart LR
    TUI[Codex or Claude TUI] -->|PTY output| SimulTeX
    SimulTeX -->|unchanged terminal stream| Terminal
    SimulTeX -->|VT reconstruction| Browser[Browser companion]
    TUI -->|model API traffic| Proxy[Local reverse proxy]
    Proxy -->|normalized transcript events| Browser
    Proxy <-->|streaming request and response| Provider[Model provider]

SimulTeX launches the child in a genuine controlling pseudo-terminal and forwards keystrokes, output, signals, exit status, and window size normally. The same PTY output is mirrored into an in-memory VT screen so the browser can reconstruct terminal UI without replacing or modifying the original TUI.

For direct codex and claude commands, SimulTeX also starts a temporary loopback reverse proxy. Only the child receives the per-run API routing override. The proxy forwards model traffic as it arrives and normalizes provider responses into turn, call, user-message, and assistant-text events.

Those API events are authoritative for conversation content, preserving exact Markdown and TeX without the loss caused by terminal wrapping. PTY reconstruction supplies everything the API does not contain: startup chrome, composers, status UI, tool activity, permission panels, and fallback messages.

If API content is unavailable or a call fails before producing text, the PTY-derived block remains visible instead of disappearing.

Options

Use a fixed port when helpful for browser automation:

simultex --browser-port 8765 -- codex

Disable authoritative API capture to test PTY reconstruction by itself:

simultex --no-api-proxy -- codex

Useful development and diagnostic options:

simultex --api-upstream URL -- codex
simultex --capture-raw codex.raw -- codex
simultex --no-dollar -- codex

Raw captures can contain the complete terminal conversation and metadata. SimulTeX refuses to overwrite an existing capture file.

Exporting and sharing

Use Download HTML to save a self-contained transcript with its styles, fonts, rendered diagrams, and loaded local images. The export removes the live connection and access token.

Copyable code, LaTeX, and Mermaid regions preserve their original source in both the live companion and downloaded HTML. Remote images are embedded when possible; otherwise their original URLs remain in the file.

Privacy and security

  • Local and private by default. SimulTeX listens only on 127.0.0.1, and the live transcript requires the random token in the printed URL. Share it only with people you trust and only through a secure tunnel.
  • Read-only companion. The browser cannot control the child process, and API routing changes apply only to the launched command—not your global Codex or Claude configuration.
  • Local history access. When resuming Codex, SimulTeX may read its saved local history to restore exact Markdown; that data remains on the local companion.
  • Review before sharing. Remote images contact their original servers, and downloaded transcripts may include conversation text, metadata, and local images.

Limitations

  • SimulTeX is a readable transcript, not a pixel-perfect copy of the terminal. Messages render as Markdown, while terminal UI stays fixed-width; the composer may briefly flicker during redraws.
  • Direct Codex and Claude sessions provide the most accurate Markdown. Other commands rely on terminal reconstruction, so content erased before it appears cannot always be recovered.

Development

python3 -m pip install -e .
PYTHONPATH=src python3 -m unittest discover -s tests -v
cd browser-ui && npm install && npm test && npm run build
PYTHONPATH=src python3 scripts/replay_capture.py /path/to/codex.raw

The Python suite covers the PTY proxy, browser server, API normalization, provider routing, terminal reconstruction, image security, and optional terminal rendering. The browser suite covers message reconciliation, composer state, Markdown features, copy behavior, exports, Mermaid, syntax highlighting, and image source handling.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simultex-0.1.0.tar.gz (2.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simultex-0.1.0-py3-none-any.whl (2.1 MB view details)

Uploaded Python 3

File details

Details for the file simultex-0.1.0.tar.gz.

File metadata

  • Download URL: simultex-0.1.0.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for simultex-0.1.0.tar.gz
Algorithm Hash digest
SHA256 15d6c77a4322fc57c8c7d6ff7443dd94eba6017295f70745d9853ff59c55e97d
MD5 958f49285d7e0826cdfeb9278cda4377
BLAKE2b-256 bf564b570de8c38604ff5881a1f8107a62da164a95e78d4c6c4ba0ecfc6ac03f

See more details on using hashes here.

File details

Details for the file simultex-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: simultex-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for simultex-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 25d3378c35d081caa902906a9e9e1fb37e6419bfe3b721047c8bacbace7430b1
MD5 dc12dcd9730b678634585a5e8f6a5281
BLAKE2b-256 5b57701390f9ef2164e8679b3aa9266635f703e8fcac1769ec09707f7835eadf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page