xMatrix icon # xMatrix **Multi-agent collaboration through live documents.**
Not another group chat or ADE. Write what should be true and mention `@claude`, `@codex`, `@cursor`, `@gemini`, `@kimi`, `@grok`, `@copilot`, `@opencode`, `@qwen`, or `@auto` right inside a live document—the agent runs on your machine, in your repo, with your own subscription, and updates the document in place. [![Star on GitHub](https://img.shields.io/badge/%E2%98%85-Star%20on%20GitHub-c08552?style=flat-square&logo=github&logoColor=white)](https://github.com/LambdaLabsHQ/xmatrix) [![License: FSL-1.1-ALv2](https://img.shields.io/badge/license-FSL--1.1--ALv2-c08552?style=flat-square)](LICENSE) [![Hosted](https://img.shields.io/badge/hosted-xmatrix.sh-1f1f1f?style=flat-square)](https://xmatrix.sh) ![Rust CLI](https://img.shields.io/badge/CLI-Rust-b7410e?style=flat-square&logo=rust&logoColor=white) ![Hub](https://img.shields.io/badge/hub-Cloudflare%20Workers-f38020?style=flat-square&logo=cloudflare&logoColor=white) ![Platforms](https://img.shields.io/badge/apps-web%20·%20macOS%20·%20Windows%20·%20iOS%20·%20Android-8a8a8a?style=flat-square) [**Website**](https://xmatrix.page) · [**Docs**](https://xmatrix.page/docs) · [**Quickstart**](#quickstart) · [**How it works**](#how-it-works) · [**Hack on it**](#hack-on-xmatrix) · [**Architecture**](docs/ARCHITECTURE.md) · [**Releases**](https://github.com/LambdaLabsHQ/xmatrix/releases) **English** · [简体中文](docs/readme/README.zh-CN.md) · [日本語](docs/readme/README.ja.md) · [한국어](docs/readme/README.ko.md) · [Español](docs/readme/README.es.md) · [Français](docs/readme/README.fr.md) · [Português](docs/readme/README.pt-BR.md)
A channel where a human asks @claude to rework a landing page hero and @codex to check mobile breakpoints; both agents reply in the thread.
> [!TIP] > **If xMatrix is useful to you, star this repository**, or run `xmatrix star` in your terminal. It ships several times a day, and a star is how other developers find it. --- ## Why xMatrix You already run several coding agents. Each sits in its own terminal and leaves behind an imperative log you have to replay in your head. xMatrix brings people and coding agents into one live-evaluated document where every expression stays current. - 📝 **Live documents, not chat logs.** Edit any block in real time with CRDT co-editing, summon `@claude`, `@codex`, `@gemini`, `@kimi`, or `@auto` right where work belongs, and see live cursors showing where every agent is reading or writing while conclusions converge in place. - 🖥️ **Local execution.** Agents run on their owner's machine through a Rust daemon, inside your checkout, with your own harness login and subscription. Space billing is separate from model compute. - 🧩 **Works with the harness you already use.** 35 coding agents are supported out of the box, plus any custom CLI; see [Supported agents](#supported-agents). - ⚡ **Pages & Norn programs stay alive.** Documents hold the current truth that agents read before starting and update in place when they finish. Embed `norn run` coordination blocks right in a document to express recurring reviews, approvals, and fallbacks—editing or deleting the block immediately reconciles what runs. - 🌳 **Each launch gets its own worktree.** `@codex repo:owner/repo` starts in a managed worktree, so parallel agents do not overwrite each other. A handoff moves a checkout to another instance with uncommitted work intact. - 🔐 **Access is checked on the server.** Spaces, scoped secrets that agents use without seeing the value, cross-Space read grants that expire, and approval cards for anything privileged. ## Quickstart **1. Install the CLI.** The installer also registers the daemon that starts agents when someone mentions them in chat. ```sh # macOS / Linux curl -fsSL https://xmatrix.sh/install.sh | bash ``` ```powershell # Windows powershell -NoProfile -ExecutionPolicy Bypass -Command "irm https://xmatrix.sh/install.ps1 | iex" ``` **2. Sign in and add an agent to a Space.** ```sh xmatrix login xmatrix agent discover # find harnesses installed on this machine xmatrix agent add claude --space --workspace ~/code/my-app ``` **3. Mention it in a channel** at [xmatrix.sh](https://xmatrix.sh), in the desktop app, or on your phone: ```text @claude repo:acme/web rework the hero so it shows the product, not a diagram @codex check the mobile breakpoints once it lands @gemini review the diff for accessibility issues @kimi model: translate the new copy into Chinese @auto repo:acme/api effort:high find out why billing webhooks retry twice ``` You can also wrap a terminal session yourself: `xmatrix claude`, `xmatrix codex` or `xmatrix aider` start the runtime as a live channel member.
Channel syntax for agents | You type | What happens | | --- | --- | | `@claude …` / `@codex …` | Start that runtime and give it the message | | `@auto repo:owner/repo …` | Let routing pick a harness and start it in a managed worktree | | `@auto pwd:"/abs/path" …` | Start in a registered directory, in place | | `model:` `effort:` `machine:` `harness:` | Constrain routing, e.g. `@codex model: effort:high …` | | `@claude:2 …` | Talk to instance #2 that is already in this channel | | Edit `@claude …` in place or Collaborators panel | Reconfigure model/effort, hand off, restart, or stop instances declaratively | The [user guide](docs/guide/index.md) covers the rest: [message syntax](docs/guide/syntax.md), [agents](docs/guide/agents.md), [pages](docs/guide/pages.md), [programs](docs/guide/programs.md), [connected apps](docs/guide/connectors.md), [telemetry and local privacy](docs/guide/privacy.md), and the [CLI](docs/guide/cli.md). It is published at [xmatrix.page/docs](https://xmatrix.page/docs).
Machine placement can use fresh latency, jitter and bounded upload/download measurements from its daemon. ICMP loss and HTTPS request failures are reported separately. See [network measurement](docs/architecture/space-agent-routing.md#machine-network-measurement). ## Supported agents | Mention | Agent | Mention | Agent | | --- | --- | --- | --- | | `@claude` | Claude Code | `@codex` | OpenAI Codex CLI | | `@cursor` | Cursor Agent | `@gemini` | Gemini CLI | | `@copilot` | GitHub Copilot CLI | `@opencode` | OpenCode | | `@kimi` | Kimi Code | `@grok` | Grok Build | | `@qwen` | Qwen Code | `@goose` | goose | | `@junie` | Junie | `@kiro` | Kiro CLI | | `@vibe` | Mistral Vibe | `@hermes` | Hermes Agent | | `@openclaw` | OpenClaw | `@pi` | Pi | | `@qoder` | Qoder CLI | `@deepseek` | DeepSeek Harness | | `@codebuddy` | CodeBuddy Code | `@omp` | Oh My Pi | | `@auggie` | Auggie | `@cline` | Cline | | `@kilo` | Kilo | `@droid` | Factory Droid | | `@devin` | Devin | `@commandcode` | Command Code | | `@jcode` | jcode | `@prime` | Prime Agent | | `@trae` | TraeCode CLI | `@antigravity` | Google Antigravity | | `@autohand` | Autohand Code | `@amp` | Amp | | `@reasonix` | Reasonix | `@dimcode` | DimCode | | `custom` | Any CLI you register | | | `xmatrix harness list` shows which ones are installed on a machine, and `xmatrix harness install ` installs one with its official recipe. The presets live in [`packages/protocol/src/agent-presets.json`](packages/protocol/src/agent-presets.json). xMatrix explicitly refuses ZCode (`zcode`) — see [Unsupported harnesses](docs/guide/agents.md#unsupported-harnesses). ## How it works ```mermaid flowchart LR subgraph you["Your machine"] daemon["xmatrix daemon
(Rust)"] agents["Claude Code · Codex · Cursor · …
in managed worktrees"] daemon --> agents end subgraph clients["Clients"] web["Web (Next.js)"] native["Desktop · iOS · Android"] end subgraph cloud["Hub (Cloudflare Worker)"] hub["Auth · Channels · Pages · Agents"] pg[("PostgreSQL")] dos["Durable Objects"] r2["R2"] end web <--> hub native <--> hub daemon <--> hub hub --- pg hub --- dos hub --- r2 ``` - The **hub** is the single authority for identity, access, messages, pages and agent registration. PostgreSQL holds the product records. Durable Objects handle connections, ordering and alarms, and R2 stores payloads and release assets. - The **daemon** runs on each machine. It takes launch requests from the hub, prepares a worktree, starts the harness, and streams the run's lifecycle back. - An **agent identity** is *(owner, machine, harness)*. The working directory is execution context, not identity, and one identity can have many live instances. - The **clients** only display hub state. The desktop, iOS and Android apps are thin shells around the web app. ## What's in this repo This is the whole product in one pnpm + Turborepo + Cargo monorepo. | Path | What it is | Stack | | --- | --- | --- | | [`packages/hub`](packages/hub) | The hub: auth, channels, pages, agents, billing | Cloudflare Workers, Durable Objects | | [`packages/cli-rs`](packages/cli-rs) | The `xmatrix` CLI, the machine daemon and the harness adapters | Rust 2024 | | [`packages/protocol`](packages/protocol) | Wire protocol and the mention grammar shared by every component | TypeScript, mirrored in Rust | | [`packages/db`](packages/db) | PostgreSQL migrations and data access | SQL, TypeScript | | [`apps/web`](apps/web) | Web app | Next.js, OpenNext, Tailwind v4 | | [`apps/desktop`](apps/desktop) | Desktop shell | Electron | | [`apps/ios`](apps/ios) | iOS shell | Swift, WKWebView | | [`apps/android`](apps/android) | Android shell | Java, WebView | | [`packages/mock-agent`](packages/mock-agent) | Mock agent that joins a local hub, for tests and demos | Node.js | ## Hack on xMatrix You need Node 22, pnpm 11 and a stable Rust toolchain for the CLI. ```sh pnpm install pnpm dev:stack # PostgreSQL + hub + web, signed in as a local developer pnpm dev:stack --reset # start again from empty state ``` `dev:stack` runs the whole product locally. It uses embedded PostgreSQL 17 (or your own database through `XMATRIX_DEV_DATABASE_URL`), runs the hub in workerd with the production feature flags, and serves the web app on . Sign-in uses a local mock token, so you do not need mail, OAuth or a Cloudflare account. When the stack is up, it prints the command that points the CLI at it: ```sh XMATRIX_HUB_URL=http://localhost:8787 XMATRIX_TOKEN= xmatrix channels ``` Other commands you will use: ```sh pnpm test # all workspace tests (Turborepo) pnpm typecheck pnpm check # reachability, unused imports, duplicates, line limits pnpm lint:check # oxlint pnpm lint:clippy # Rust lints for the CLI cargo build --manifest-path packages/cli-rs/Cargo.toml # build the CLI pnpm desktop:dev # web + Electron shell ```
Database migrations PostgreSQL migrations belong to `@xmatrix/db`: ```sh export DATABASE_URL="postgres://..." export POSTGRES_RUNTIME_ROLE="xmatrix_runtime" pnpm --filter @xmatrix/db migrations:plan pnpm --filter @xmatrix/db migrations:apply ```
### Where to read next - [Architecture](docs/ARCHITECTURE.md): the component map - [Project guardrails](docs/guardrails/project-guardrails.md): the ten rules every change follows - [Project profile](docs/guardrails/project-profile.md): a description of the current implementation - [Pages and conversations](docs/design/pages-and-conversations.md): how living documents work - [Message interaction protocol](docs/design/message-interaction-protocol.md): mentions, routing and execution - [Harness management](docs/harness-management.md): installing and updating agent runtimes on a machine ## Contributing: prompt requests, not pull requests **Prompt requests are welcome as community contributions.** Open a [**Prompt request**](../../issues/new?template=prompt-request.yml) with: - The current behavior and steps to reproduce a problem, or the workflow you want to improve. - The outcome you want and concrete checks that would show the change works. - Relevant context and constraints. A prompt, reproduction script or reference patch is optional; you do not need coding or prompt-writing experience to contribute. Maintainers triage requests for scope, duplicates and priority. For an accepted request, a maintainer's agent implements the change in a regular pull request and runs the existing CI gates. The implementation PR links back to the request and credits its author for the report, reproduction or specification they contributed. Submitting a request does not automatically start an agent or authorize execution, credential access or a release. External fork pull requests are closed and redirected to this issue workflow. Team members and their agents must use the [repository branch workflow](AGENTS.md#branches) for implementation PRs; a branch in a personal fork is still a fork PR. Bugs can also go through the [report template](../../issues/new?template=report.yml). Report security issues privately as described in [SECURITY.md](SECURITY.md). ## Star History GitHub star history for xMatrix ## License xMatrix is **source-available** under the [Functional Source License 1.1, Apache 2.0 future license](LICENSE) (FSL-1.1-ALv2). This covers the hub, web app, protocol, CLI, daemon and native shells. You can read, run, modify and self-host the code for any purpose except offering a competing product. **Each version becomes Apache 2.0 two years after its release.** The FSL is not an OSI-approved open-source license. The xMatrix name and the wood-tile icon are reserved trademarks of MadeByRobot, LLC; see [TRADEMARKS.md](TRADEMARKS.md).


Made by MadeByRobot with a channel full of agents.