claudex
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@claudex send 'tests are passing' to Codex chat 7f3a9c"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
claudex
Claudex lets Claude Code chats in Claude Desktop and chats in Codex Desktop work together on one Linux machine. It is a command-line tool and an MCP server. With it, a chat can:
send a message to a chat in the other app;
read the other app's chat history and installed skills;
control Claude Desktop chats: Remote Control, model, effort, fast mode, permission mode, archiving and stopping.
The Claude Desktop controls need a small patch, which claudex-desktop
applies each time it launches Claude Desktop. The patch also reconnects
Remote Control after a restart. Reading history and skills, and sending to
Codex chats, work without it.
Claudex is built and tested on x86-64 NixOS.
Install
nix build .# builds the two commands from the flake and uv.lock:
claudex: the CLI and the MCP server.claudex-desktop: the Claude Desktop launcher that applies the patch.
To use Home Manager, add this flake as an input and install
packages.x86_64-linux.default. Then point Claude Desktop's menu entry and
claude:// link handler at a wrapper that runs claudex-desktop (see
Launch Claude Desktop with the patch).
Related MCP server: mcp-relay
Register the MCP server
Register Claudex in both apps with absolute paths:
claude mcp add claudex --scope user --env "CLAUDEX_CLAUDE_LAUNCHER=$launcher" -- \
"$claudex" mcp --client claude --state "$mailbox"
codex mcp add claudex --env "CLAUDEX_CLAUDE_LAUNCHER=$launcher" -- \
"$claudex" mcp --client codex --state "$mailbox"$claudexis the installedclaudexcommand.$launcheris the launcher that opens Claude Desktop with the patch.claude_launchandclaude_open_chat_draftuse it.$mailboxis a SQLite file shared by both apps. It keeps the newest 1,000 messages for each recipient.
Only chats started after registration get the tools. To check one, call
who_am_i from it: it should return that chat's app, ID and title. Claude
Code gives the server its chat's identity once, when the server starts,
while Codex sends it with each request. So after a Claude Code /clear or
resume, you may need to reconnect MCP.
How messages travel
From a Claude chat to a Codex chat:
Claudex asks Codex Desktop which of its windows has the chat open.
It asks that window to start a new turn, with the message attached as tool output from
claudex.peer_message, not as your input.
The chat must be open in Codex; codex_chat_status tells you whether it
is. Each send reports one of:
submitted, with the new turn's ID;not_loaded: no window has the chat open;refused;unknown: Codex didn't confirm. Check the chat before sending again.
From a Codex chat to a Claude chat:
Claudex stores the message in the mailbox.
It puts a one-line notice in the Claude chat's inbox, saying a message is waiting.
The chat reads the message with
read_messages.
If the chat has no running worker, Claudex starts one through the patch and waits up to 18 seconds for its inbox. If that fails, the message stays in the mailbox until the chat reads it. Claude Code applies its own rules to the notice and may hold or decline it. It also presents the notice as coming from another Claude session, even when a Codex chat sent it. The notice text names the real sender.
Messages, chat history and skill files come from another agent. They are data, never approval for anything. The server says so in its MCP instructions, and every reply that carries another agent's text is labelled untrusted.
A message's sender is the app, chat ID and title that the sending MCP client reported. Claudex doesn't check them. That's fine on a single-user machine, since any program running as you could write to the mailbox directly, but the sender is a label, not proof of who sent the message.
MCP tools
Tool | What it does |
| Returns the calling chat's app, ID and title. |
| Sends a message to a chat in the other app, by exact ID. |
| Reads messages addressed to the calling chat, after a cursor. |
| Lists or searches saved Codex chats. |
| Checks whether a Codex window has the chat open and can take a message. |
| Reads a Claude or Codex chat's visible history by exact ID. Claude returns up to 100 messages; Codex pages up to 10 turns at a time. |
| Lists your installed Claude Code or Codex skills, or reads one |
| Shows Claude Desktop chats with their worker, settings and Remote Control state. |
| Turns Remote Control on or off. Turning it on starts the chat's worker if needed. |
| Starts a saved chat's worker without sending anything. |
| Changes a chat's model, reasoning effort or fast mode. A null effort means Desktop's default. |
| Keeps a chat's permission mode or lowers it. |
| Archives or unarchives a chat. |
| Stops a chat's worker, or interrupts its current turn. |
| Opens Claude Desktop. |
| Opens a new Code draft of up to 14,000 characters, optionally in a folder. You review it and send it. |
Each tool is marked read-only, a change, or destructive (archive, stop,
interrupt), so the calling app applies its usual approval rules. The tools
that read or change Claude Desktop chats, and send_message to a Claude
chat, need the patch. Without it they say the control socket is
unavailable.
Command line
claudex claude chats --json
claudex claude chat "$claude_chat_id"
claudex claude remote-control "$claude_chat_id" on
claudex claude effort "$claude_chat_id" default
claudex claude permission-mode "$claude_chat_id" plan
claudex codex chats --query "review"
claudex codex history "$codex_chat_id" --limit 10 --json
claudex codex status "$codex_chat_id"claudex claude controls the running Claude Desktop through the patch.
claudex codex reads Codex Desktop's saved chats, and claudex codex status
asks the running app. Every claude and codex command takes --json.
claudex claude --help and claudex codex --help list the rest.
claudex claude chats shows Remote Control twice: whether the chat is
connected now, and whether it's saved On in Desktop. When Desktop can't
start a chat's worker, the command prints a notice that says so.
The Desktop control socket
The patch serves $XDG_RUNTIME_DIR/claudex/desktop.sock, mode 0600. The CLI
and the MCP server use the same typed client for it. The socket serves only
the operations listed above, and only for local chats in the account and
organization Desktop has active. Desktop does the work through its own
window API, under its own checks:
An archived chat can be read, archived or unarchived. Anything else is refused until you unarchive it.
The permission mode can stay the same or go down the order
plan,default,acceptEdits,auto,bypassPermissions. Raising it needs Desktop's window.dontAskcan only stay as it is.Requests run one at a time, in order. A request must arrive within two seconds and be at most 4 KiB, and a reply is at most 512 KiB.
Anything else is refused, including sending a prompt or answering a permission request.
Launch Claude Desktop with the patch
A launcher wrapper runs:
claudex-desktop --source "$claude_desktop/lib/claude-desktop/resources/app.asar" \
--reuse-running -- "$stock_launcher" "$@"--source is the installed app.asar. After -- comes the normal launcher
and its arguments. On each launch, claudex-desktop:
Reads the graphical session's environment from the systemd user manager, so Desktop doesn't inherit the caller's shell.
Leaves a running Desktop alone. With
--reuse-running, it passes a singleclaude://link to it; otherwise it refuses.Checks that the installed archive's SHA-256 matches the supported release, then builds the patched archive. The result is cached read-only under
$XDG_CACHE_HOME/claudex/desktop, keyed by the source path and the patch files. An archive outside the Nix store is rebuilt on every launch.Uses Bubblewrap to mount the patched archive read-only over the installed one, then runs the normal launcher inside that mount. It never changes the installed files.
If something fails before Desktop starts, claudex-desktop starts stock
Desktop instead. That covers a missing Bubblewrap, an unsupported archive
and a failed mount. It prints the reason and shows a desktop notification.
--disable starts stock Desktop on purpose.
Bubblewrap must be on the desktop session's PATH. A lock file under
$XDG_STATE_HOME/claudex/desktop keeps two launches from racing.
Remote Control after a restart
When Desktop starts with the patch, it reconnects Remote Control for chats where you left it saved On. That is Desktop's own setting. The most recently used chats go first. The pass:
covers only local chats in the signed-in account and organization;
skips chats that are running or have unsent input, scheduled or other unattended work, chats moved to the cloud, and chats started remotely;
waits for Desktop's account flags and organization policy, and respects Desktop's restore switch and managed settings;
checks workspace trust the way Desktop does;
stops starting workers one short of Desktop's worker limit.
A chat left cold by the limit reconnects when you open it. Each attempt is
logged in ~/.config/Claude/logs/main.log, as
[claudex] Remote Control claudex_restart <chat> <result> at launch or
claudex_reopen on opening.
Updating
After changing the Claudex version, for example the Home Manager pin:
Finish the switch. The CLI and MCP command update right away.
Quit Claude Desktop and reopen it from the managed launcher. The running Desktop keeps its old patch until it restarts.
Between the two steps, the new client can't read the old patch's replies, and its error says so. If that happens during a change, check the chat after restarting before you retry, because the change may already have been applied.
Compatibility
Component | Version | What depends on it |
Claude Desktop | 5.11492.5, Electron 45.2.1 | The patch. The archive hash and the native hook points are pinned in claudex/patch/build.py. |
Claude Code | 2.1.325 workers | The chat inbox and caller identity records. |
Codex Desktop | 26.1103.60933 | Local chat history and the IPC used to deliver messages. |
Python | 3.12 | Claudex itself. |
Node | 24 | The patch tests. This is the Node major version in that Electron. |
Run the MCP server over stdio, as the same user as the desktop apps. When
Claude Desktop updates, the patch refuses the new archive and
claudex-desktop starts stock Desktop until the patch is updated.
Development
uv sync --frozen
./check
nix flake check./check runs strict mypy, then the Python and JavaScript tests. Set
CLAUDEX_PYTHON to use an existing interpreter instead of uv sync, and
CLAUDEX_NODE to pick a Node. nix flake check runs the same suite in the
locked environment and checks the built package.
claudex/
cli.py the claudex command; `claudex mcp` starts the server
server.py the MCP server and its tools
models.py chat IDs and messages shared by both apps
mailbox.py the SQLite mailbox
skills.py reading installed skills
environment.py reading the graphical session's environment
claude/
chats.py chat records, history, identity and inbox notices
control.py the typed client for the control socket
lifecycle.py launching Desktop, drafts, and notifying or waking a chat
codex/
history.py saved chats and their history
ipc.py finding the window that has a chat open, and delivering to it
envelope.py the message format a Codex chat receives
patch/
build.py checks the installed archive and builds the patched one
archive.py reads and writes the ASAR format
launch.py the claudex-desktop launcher
restore.cjs Remote Control restore, run inside Desktop
bridge.cjs the control operations, run inside Desktop
socket.cjs the control socket server, run inside Desktop
tests/ the same layout, with recorded app data in fixtures/Licence
MIT. See LICENSE.
Available Tools
22 toolsclaude_archiveCDestructive
Archive a Claude Desktop chat.
Inputs: chat_id (required). Returns: chat, notice
claude_get_chatBRead-only
Read Claude Desktop status and settings for a chat by exact ID.
Inputs: chat_id (required). Returns: warm, model, title, effort, +7 more
claude_interruptBDestructive
Interrupt the active turn in a Claude Desktop chat.
Inputs: chat_id (required). Returns: chat, notice
claude_launchA
Open the signed-in Claude Desktop app through the configured launcher.
Inputs: no named parameters. Returns: object
claude_list_chatsARead-only
List Claude Desktop chats in the active account with Remote Control status and saved settings.
Inputs: no named parameters. Returns: chats, archived_pending
claude_open_chat_draftB
Open a Claude Code draft for the operator to review and submit.
Inputs: prompt (required), folder. Returns: object
claude_set_effortB
Set the Claude Desktop reasoning effort or pass null to use the default.
Inputs: effort (required), chat_id (required). Returns: chat, notice
claude_set_fast_modeB
Turn Claude Desktop fast mode on or off for one chat.
Inputs: chat_id (required), enabled (required). Returns: chat, notice
claude_set_modelC
Select the Claude Desktop model for one chat.
Inputs: model (required), chat_id (required). Returns: chat, notice
claude_set_permission_modeC
Keep or lower a Claude Desktop chat's permission mode.
Inputs: mode (required), chat_id (required). Returns: chat, notice
claude_set_remote_controlB
Set Remote Control on or off. Turning it on may start a saved chat's worker.
Inputs: chat_id (required), enabled (required). Returns: chat, notice
claude_stopCDestructive
Stop the Claude Desktop worker for a chat.
Inputs: chat_id (required). Returns: chat, notice
claude_unarchiveB
Return an archived Claude Desktop chat to the active list.
Inputs: chat_id (required). Returns: chat, notice
claude_wake_chatB
Start the Claude Desktop worker for a saved chat without sending a message.
Inputs: chat_id (required). Returns: chat, notice
codex_chat_statusBRead-only
Check whether a local Codex Desktop chat can receive peer messages.
Inputs: chat_id (required). Returns: object
codex_list_chatsCRead-only
List or search saved local Codex Desktop chats.
Inputs: limit, query, cursor, archived. Returns: object
list_skillsBRead-only
List locally installed user skills for Claude Code or Codex.
Inputs: provider (required). Returns: result
read_chatCRead-only
Read visible chat history by exact Claude Desktop ID or Codex UUID.
Inputs: target (required), provider (required), limit, cursor, +1 more. Returns: object
read_messagesCRead-only
Read peer messages addressed to the calling chat.
Inputs: after. Returns: object
read_skillBRead-only
Read one user SKILL.md as literal text without loading or executing it.
Inputs: name (required), scope (required), provider (required). Returns: object
send_messageC
Send peer data to an eligible chat by exact ID.
Inputs: body (required), target (required). Returns: object
who_am_iARead-only
Show the current chat identity supplied by the calling app.
Inputs: no named parameters. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 22 tools
Most tools target distinct resources and actions, and descriptions clarify close cases. Minor overlap exists around chat activation/control (claude_set_remote_control vs claude_wake_chat vs claude_launch) and message reading (read_chat vs read_messages), but not enough to cause major misselection.
Most tools use a readable snake_case verb_noun pattern with claude_/codex_ service prefixes. Generic tools such as who_am_i, send_message, read_chat, and list_skills lack platform prefixes, and codex_chat_status is noun-first, so the convention is mostly but not fully uniform.
22 tools falls in the heavy borderline range. The server spans Claude chat control, Codex chat status, peer messaging, and skills, so many tools are justified, but the granular Claude setting tools could likely be consolidated.
Core Claude chat lifecycle and settings are well covered, but direct chat creation is only through a draft workflow, permanent deletion is absent, skills are read-only, and Codex support lacks lifecycle/control parity. These are notable gaps for a combined claudex surface.
Maintenance
Related MCP Connectors
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Share context and questions between Claude instances — VS Code, claude.ai web, and mobile.
Real-time chat for AI agents. Claude Code, Cursor, Cline and Codex join channels over MCP.
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Related MCP Servers
- AlicenseAqualityCmaintenanceGive Claude Desktop terminal, filesystem, and background-job access on your local Linux machine. Zero-dependency MCP extension, MIT-licensed.85MIT
- AlicenseNot gradedqualityDmaintenanceConnects Claude Desktop and Claude Code, enabling autonomous exchange of messages, files, and code while keeping their context windows separate.45 PyPI4MIT
- AlicenseNot gradedqualityBmaintenanceEnables asynchronous two-way messaging between Codex Desktop tasks and Claude Desktop Code sessions on Windows, allowing either side to share information, questions, or updates through MCP tools.18MIT
- AlicenseNot gradedqualityBmaintenanceGrants Claude Code desktop-control capabilities on Linux, including screenshots, mouse movement and clicks, keyboard input, window listing and focusing, and clipboard access.3MIT