An interactive orchestration mesh for Claude Code sessions.
Project description
xmesh
An interactive orchestration mesh for Claude Code sessions.
xmesh drives multiple Claude Code sessions through the Claude Agent SDK and lets you run them three ways — all from one advanced, live terminal UI:
| Mode | What it does |
|---|---|
| chat (interactive) | A persistent, streaming, multi-turn conversation — like a Claude Code chat. Watch the thinking stream live, send follow-up messages, background it and re-attach later. |
| parallel (fan-out) | Many one-shot sessions at once, bounded by a concurrency cap. |
| pipeline | Sequential steps; each can inject the previous step's output via {prev}. |
| resume | Continue any finished session by its SDK session_id. |
Chat sessions use the SDK's interactive ClaudeSDKClient (retained context across turns); the one-shot modes use query().
The SDK bundles the claude CLI and runs each session as a subprocess — so you don't install Claude Code separately, but a real claude process is what does the work under the hood.
Install
xmesh is a pure-Python CLI published to PyPI (as xmesh-ai) — a universal
py3-none-any wheel that installs the same way on Windows, macOS, and Linux
(Python 3.10+). The package is xmesh-ai; the command it installs is xmesh.
Install it as an isolated global tool (recommended):
# with uv (any OS)
uv tool install xmesh-ai
# or with pipx (any OS)
pipx install xmesh-ai
That puts an xmesh command on your PATH. Then:
xmesh --mock # explore the UI in mock mode — no API key needed
Other ways to install
pip install xmesh-ai # into the active environment/venv
pip install "xmesh-ai[live]" # + claude-agent-sdk for live runs
On Windows, py -m pip install xmesh-ai also works from PowerShell or cmd.
Live runs against real Claude Code sessions
uv tool install "xmesh-ai[live]" # pulls in claude-agent-sdk (+ bundled CLI)
# set ANTHROPIC_API_KEY in your shell or a local .env file, then:
xmesh # LIVE engine auto-detects the key
xmesh reads a .env from the current working directory, so you can drop one
next to whatever project you're orchestrating.
No API key and no
--mock? xmesh falls back to the simulated engine automatically so the UI is always explorable.
From source (development)
git clone https://github.com/glxymesh/xmesh && cd xmesh
uv sync # or: uv sync --extra live --extra dev
uv run xmesh --mock
The interactive CLI
A prompt_toolkit REPL with completion, history, and a live status toolbar. Long-running work renders in a Rich live dashboard you can watch and cancel.
xmesh ❯ help
| Command | Description |
|---|---|
chat [prompt] |
Open a live streaming chat session (multi-turn, retains context). |
fg <id> |
Re-attach a backgrounded chat session. |
new [prompt] |
Run a one-shot session (guided wizard if no prompt given). |
batch |
Fan out several prompts in parallel (one per line). |
pipeline |
Chain steps sequentially; use {prev} to feed the prior step. |
resume |
Pick a finished session and continue it. |
ls |
List all sessions. |
show s1 |
Show a session's transcript + metadata. |
watch |
Re-open the live dashboard. |
kill s1 / kill all |
Cancel running sessions. |
set model claude-sonnet-4-6 |
Change a setting at runtime. |
config |
Show current configuration. |
update |
Upgrade xmesh to the latest PyPI release (auto-detects uv/pipx/pip). |
mock |
Toggle the simulated engine. |
clear / quit |
Clear screen / exit. |
Example: an interactive chat (streaming + multi-turn)
xmesh ❯ chat help me design a rate limiter
chat s1 ● LIVE · uses your subscription ──────────────────────
❯ help me design a rate limiter
▏ 💭 ⠹ Considering token-bucket vs sliding-window… ← thinking streams live (transient)
▏ → Read(file=src/limit.py) ✓ 80 lines
▏ Here's a token-bucket approach… ← answer streams in
s1 ❯ now add Redis persistence ← keep chatting, same context
The conversation flows as plain text — only the active turn streams in a transient region; finished turns commit as clean, borderless scrollback with thinking collapsed to a summary.
Inside a chat:
- Enter sends your message; the turn streams its thinking + tools + answer live.
- Ctrl-C backgrounds the session — it keeps running;
fg s1re-attaches. /stopinterrupts the current turn ·/exitleaves it alive in the background ·/closeends it.
A chat stays in the foreground until you background it. Backgrounded sessions keep making progress, and ls shows them all.
Example: fan out three tasks
xmesh ❯ batch
? Enter one prompt per line (these run in parallel):
Add input validation to the signup form
Write unit tests for the auth module
Update the README with the new API
? Name prefix: task
…then watch all three stream live, with per-session turns, tool calls, cost, and elapsed time, plus a roll-up footer.
Configuration
Settings resolve in this order: defaults → env / .env → CLI flags → live set commands.
| Setting | Env | Flag | Default |
|---|---|---|---|
| model | XMESH_MODEL |
--model |
claude-opus-4-8 |
| permission mode | XMESH_PERMISSION_MODE |
--permission-mode |
acceptEdits |
| working dir | XMESH_WORKDIR |
--workdir |
cwd |
| max concurrency | XMESH_MAX_CONCURRENCY |
--max-concurrency |
4 |
| max turns | XMESH_MAX_TURNS |
— | 0 (∞) |
| mock engine | XMESH_MOCK |
--mock |
off |
Architecture
xmesh/
models.py normalized SessionState / SessionEvent (no SDK types leak out)
config.py layered settings
engine.py Orchestrator + Runners (SDKRunner | MockRunner)
ui.py pure Rich renderables (banner, dashboard, transcript)
cli.py prompt_toolkit REPL + questionary wizards + live loop
The SDKRunner flattens the Agent SDK's typed message stream
(AssistantMessage, ResultMessage, TextBlock, ToolUseBlock, …) into a
small, stable event vocabulary the UI renders. Swapping in MockRunner makes
the entire app runnable with zero credentials.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xmesh_ai-0.1.1.tar.gz.
File metadata
- Download URL: xmesh_ai-0.1.1.tar.gz
- Upload date:
- Size: 92.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f21c6caac4e43d71d34d5f66eab610916a8ae2548f6152615ed19c40b5d6b5a1
|
|
| MD5 |
1a16ad612b910fdae4b8aa34625caeb2
|
|
| BLAKE2b-256 |
193a4037600fead30252f96abf63ac6434d26e588b14eb6c0bce3c0d3d6812df
|
Provenance
The following attestation bundles were made for xmesh_ai-0.1.1.tar.gz:
Publisher:
publish.yml on glxymesh/xmesh
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xmesh_ai-0.1.1.tar.gz -
Subject digest:
f21c6caac4e43d71d34d5f66eab610916a8ae2548f6152615ed19c40b5d6b5a1 - Sigstore transparency entry: 1847213883
- Sigstore integration time:
-
Permalink:
glxymesh/xmesh@f19d0bea263b96641f9b8087d407bd2b743a0d7b -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/glxymesh
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f19d0bea263b96641f9b8087d407bd2b743a0d7b -
Trigger Event:
push
-
Statement type:
File details
Details for the file xmesh_ai-0.1.1-py3-none-any.whl.
File metadata
- Download URL: xmesh_ai-0.1.1-py3-none-any.whl
- Upload date:
- Size: 29.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cdd1eb553c41b24de6e63d206da548b7ba05be0bb8688bb3ae207e8c5233eea7
|
|
| MD5 |
93f358a93d8371df3331c3f10c844663
|
|
| BLAKE2b-256 |
ed8571dd0c83b39dfe336038de98a1f503f10f17386fda81c6bef8c6a1b0ccb0
|
Provenance
The following attestation bundles were made for xmesh_ai-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on glxymesh/xmesh
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xmesh_ai-0.1.1-py3-none-any.whl -
Subject digest:
cdd1eb553c41b24de6e63d206da548b7ba05be0bb8688bb3ae207e8c5233eea7 - Sigstore transparency entry: 1847214161
- Sigstore integration time:
-
Permalink:
glxymesh/xmesh@f19d0bea263b96641f9b8087d407bd2b743a0d7b -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/glxymesh
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f19d0bea263b96641f9b8087d407bd2b743a0d7b -
Trigger Event:
push
-
Statement type: