claude-relay 2.35.1 → 2.36.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +130 -87
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -2,87 +2,103 @@
2
2
  <img src="media/logo/icon-full-banded-256-transparent.png" alt="Clay" />
3
3
  </p>
4
4
 
5
- <h3 align="center">Claude Code for your whole team. No team? Build one with AI.</h3>
5
+ <h2 align="center">Use Claude Code and Codex in a browser, with your whole team.</h2>
6
+ <h4 align="center">Self-hosted on your machine. One toggle between vendors. No lock-in.</h4>
6
7
 
7
- [![npm version](https://img.shields.io/npm/v/clay-server)](https://www.npmjs.com/package/clay-server) [![npm downloads](https://img.shields.io/npm/dw/clay-server)](https://www.npmjs.com/package/clay-server) [![GitHub stars](https://img.shields.io/github/stars/chadbyte/clay)](https://github.com/chadbyte/clay) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/chadbyte/clay/blob/main/LICENSE)
8
+ <p align="center">
9
+ <a href="https://www.npmjs.com/package/clay-server"><img src="https://img.shields.io/npm/v/clay-server" alt="npm version" /></a>
10
+ <a href="https://www.npmjs.com/package/clay-server"><img src="https://img.shields.io/npm/dw/clay-server" alt="npm downloads" /></a>
11
+ <a href="https://github.com/chadbyte/clay"><img src="https://img.shields.io/github/stars/chadbyte/clay" alt="GitHub stars" /></a>
12
+ <a href="https://github.com/chadbyte/clay/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT" /></a>
13
+ </p>
8
14
 
9
15
  <p align="center"><img src="media/hero.png" alt="Clay workspace" /></p>
10
16
 
11
- Everything Claude Code does, in your browser and on your phone. Multi-session, multi-user, self-hosted. No cloud relay, no middleman.
17
+ Clay is a team workspace for Claude Code and Codex, self-hosted on your machine. Onboard your team to one tool, share sessions live, switch vendors with a toggle. Your code, your Mates, your decisions, all on disk.
12
18
 
13
19
  ```bash
14
20
  npx clay-server
15
21
  # Scan the QR code to connect from any device
16
22
  ```
17
23
 
18
- ---
24
+ ## Why Clay
19
25
 
20
- ## What you get
26
+ **One workspace, many people.** Your whole team logs into the same workspace, not a personal editor with billing settings bolted on. Multi-user from day one, with OS-level isolation on Linux.
21
27
 
22
- ### Drop-in replacement for the CLI
28
+ **Many projects at once.** If you bounce between repos all day, keep them all loaded in one place and run agents in parallel across them. Permission requests and completed jobs surface as notifications so nothing goes silent in a tab you forgot to check.
23
29
 
24
- Your CLI sessions, your CLAUDE.md rules, your MCP servers. **All of it works in Clay as-is.** Pick up a CLI session in the browser, or continue a browser session in the CLI.
30
+ **Self-hosted.** Clay is a daemon on your machine. Your code, your sessions, your AI teammates' memory all live on disk in plain JSONL and Markdown. No proprietary database. No cloud relay. No middleman.
25
31
 
26
- <p align="center">
27
- <img src="media/split.gif" alt="split-screen workflow" width="700">
28
- </p>
32
+ **Vendor-agnostic.** Run Claude Code and Codex in the same workspace. Toggle vendors per session. When Anthropic raises prices or OpenAI changes terms, your workflow keeps moving. Same Mates, same projects, same memory, different model.
33
+
34
+ **No lock-in.** Plain files you can grep, version, and back up. Standard cron expressions. MCP servers you already use. CLAUDE.md, AGENTS.md, .cursorrules, all loaded automatically across vendors. Walk away whenever you want, your data walks with you.
35
+
36
+ ## Built for Teams
29
37
 
30
- ### Claude Code on steroids
38
+ Clay is the workspace your team logs into, not a private editor with billing settings bolted on. Provision a server, invite your team, work in one place.
31
39
 
32
- **Multiple agents, multiple projects, at the same time.** Switch between them in the sidebar. Browse project files live while the agent works, with syntax highlighting for 180+ languages. Mermaid diagrams render as diagrams. Tables render as tables.
40
+ - **Multi-user on a single server.** One Clay daemon hosts everyone on your team. No per-seat SaaS, no separate installs. Add users, they log in, they're in.
41
+ - **OS-level isolation on Linux.** Opt in to provision each Clay user as a real Linux account. File ACLs are enforced via `setfacl`. Processes spawn under the right UID/GID. The isolation guarantees come from the OS, not from a promise in our docs.
42
+ - **Each member brings their own login.** Share one org-wide API key, or let each user sign in with their own Claude Code or Codex account. Costs route to whoever ran the model.
43
+ - **Drop into a teammate's session to help.** When someone gets stuck, jump into their project and pair in real time. Shared control, full history, no screen-share theater.
44
+ - **@mention a teammate when you're stuck.** Ping them right inside the session. Their notification center lights up, their phone buzzes. No teammate around? @mention a Mate instead, same gesture, same place.
45
+ - **Non-developers welcome.** PMs, designers, support engineers can log in to ask questions about the codebase, create issues, or read what the team built, without ever opening an editor.
33
46
 
34
- **Schedule agents with cron**, or let them run autonomously with **Ralph Loop**. Close your laptop, sessions keep running.
47
+ ## What it does
35
48
 
36
- **Push notifications on mobile.** Your phone buzzes when Claude needs approval, finishes a task, or hits an error. Install as a PWA on iOS or Android, review and approve from anywhere.
49
+ ### Run Claude Code and Codex in one workspace
50
+
51
+ Open a session, pick a vendor. Switch sessions, pick the other. Clay's adapter layer (YOKE) speaks the Claude Agent SDK and the Codex app-server protocol natively. Cross-vendor instruction loading: Codex reads AGENTS.md, Claude reads CLAUDE.md, Clay merges the rest into the system prompt automatically.
37
52
 
38
53
  <p align="center">
39
- <img src="media/phone.gif" alt="Clay on phone" width="280">
54
+ <img src="media/split.gif" alt="split-screen workflow" width="700">
40
55
  </p>
41
56
 
42
- ### Your machine, your server, your data
43
-
44
- **Fully local.** Clay runs as a daemon on your machine. Your code and conversations never leave your machine except to reach the AI provider's API.
57
+ ### Every project on one dashboard
45
58
 
46
- **Plain files.** Sessions are JSONL. Settings are JSON. Knowledge is Markdown. Everything lives on your machine in formats you can read, move, and back up. No proprietary database, no cloud lock-in.
59
+ All your projects live in the sidebar. Jump between them in one click, see live status across each, run agents in several at once. No more `cd ~/work/foo && tmux attach && ...`. One Clay daemon hosts every repo on your machine and gives you a single pane of glass over all of them.
47
60
 
48
- **Secure by default.** PIN authentication, per-project permissions, and HTTPS are built in.
61
+ ### Mates: AI teammates with persistent memory
49
62
 
50
- ### Bring your whole team
63
+ Mates are AI personas with their own CLAUDE.md, knowledge files, and memory that compounds across sessions. They learn your stack, your conventions, your decision history. @mention them mid-session, DM them directly, or drop them into a debate. **They don't flatter you. They push back.**
51
64
 
52
- **One API key runs the whole workspace.** Invite teammates, set permissions per person, per project, per session. Share one key across the org, or let each member use their own Claude Code login.
65
+ ### Debate: structured multi-Mate decisions
53
66
 
54
- **OS-level isolation.** On Linux, Clay maps each user to an OS-level account. File permissions and process isolation just work.
67
+ Stuck on REST vs GraphQL? Monorepo or split? Surface the question to a debate. Pick panelists, set the format, let your Mates argue both sides with moderated turns. You walk away with a recorded decision, not a vibe check.
55
68
 
56
- **Shared sessions.** Your PM describes a bug in plain language, your senior joins the same session, and the fix ships together. If someone gets stuck, **jump into their session** to help in real time.
69
+ ### Parallel worktrees
57
70
 
58
- ### Build your AI team
71
+ Detect existing git worktrees, spin up new ones from the sidebar, and run agents in each one independently. No more "wait, I have uncommitted changes." Each worktree is an isolated session with its own history.
59
72
 
60
- **Mates.** AI teammates with persistent memory across sessions. They learn your stack, your conventions, and your decision history. @mention them for a quick review, DM them directly, or bring multiple into the same conversation. **They don't flatter you. They push back.**
73
+ ### Ralph Loop: autonomous coding while you sleep
61
74
 
62
- <!-- TODO: mates.gif -->
75
+ Write a `PROMPT.md`, optionally a `JUDGE.md`, hit go. Clay iterates: code, evaluate, retry, until the judge approves or you cap the loop. Run it once, or schedule it on standard Unix cron. Wake up to a finished feature or a clean failure trace.
63
76
 
64
- **Debate.** Your Mates argue both sides before you commit. "REST vs GraphQL?" "Monorepo or separate repos?" "This migration plan won't survive production. Here's why."
77
+ ### Web UI, mobile, push notifications
65
78
 
66
- <!-- TODO: debate.gif -->
79
+ Installable PWA on iOS and Android. Push notifications for approvals, errors, and completed tasks. Service worker keeps the app responsive offline. When Claude needs approval, your phone buzzes, you tap approve, the agent keeps going.
67
80
 
68
- ---
81
+ <p align="center">
82
+ <img src="media/phone.gif" alt="Clay on phone" width="280">
83
+ </p>
69
84
 
70
85
  ## Who is Clay for
71
86
 
72
- - **Solo dev who needs a second opinion.** Architecture review, dependency decisions, refactor tradeoffs. Build reviewers as Mates instead of asking the void.
73
- - **Small team sharing one Claude Code setup.** One API key, everyone in the browser, no terminal knowledge required.
74
- - **Dev lead running agents overnight.** Schedule tasks with cron, get push notifications on your phone, review in the morning.
87
+ - **Teams that want one shared workspace, not one editor each.** Onboard your whole team to a single tool, share sessions, set permissions per person, keep code on your own infrastructure.
88
+ - **Teams hedging vendor risk.** You want Claude today, Codex tomorrow, and the freedom to flip without rewriting your workflow.
89
+ - **Self-hosting developers who won't put their code in someone else's cloud.** You run the server, you own the data, you pick the model.
90
+ - **Codex users tired of CLI-only workflows.** Clay treats Codex as a first-class citizen, not a Claude afterthought.
91
+ - **Solo developers building an AI team.** Mates, Debate, and Ralph Loop give you reviewers, decision-makers, and an autonomous coding partner. Your team grows when you're ready.
75
92
 
76
93
  ## Getting Started
77
94
 
78
- **Requirements:** Node.js 20+, Claude Code CLI (authenticated).
95
+ **Requirements:** Node.js 20+. Authenticated Claude Code CLI, Codex CLI, or both.
79
96
 
80
97
  ```bash
81
98
  npx clay-server
82
99
  ```
83
100
 
84
- On first run, it asks for a port number and whether you're using it solo or with a team.
85
- Open the browser URL or scan the QR code to connect from your phone instantly.
101
+ On first run, Clay asks for a port and whether you're solo or with a team. Open the URL or scan the QR code from your phone.
86
102
 
87
103
  For remote access, use a VPN like Tailscale.
88
104
 
@@ -90,84 +106,111 @@ For remote access, use a VPN like Tailscale.
90
106
  <img src="media/start.gif" alt="Clay starting from CLI" width="600">
91
107
  </p>
92
108
 
109
+ ## CLI Options
110
+
111
+ ```bash
112
+ npx clay-server # Default (port 2633)
113
+ npx clay-server -p 8080 # Specify port
114
+ npx clay-server --yes # Skip interactive prompts (use defaults)
115
+ npx clay-server -y --pin 123456
116
+ # Non-interactive + PIN (for scripts/CI)
117
+ npx clay-server --add . # Add current directory to running daemon
118
+ npx clay-server --remove . # Remove project
119
+ npx clay-server --list # List registered projects
120
+ npx clay-server --shutdown # Stop running daemon
121
+ npx clay-server --dangerously-skip-permissions
122
+ # Bypass all permission prompts (requires PIN at setup)
123
+ ```
124
+
125
+ Run `npx clay-server --help` for all options.
126
+
93
127
  ## FAQ
94
128
 
95
- **"Is this just a Claude Code wrapper?"**
96
- Clay uses the [Claude Agent SDK](https://www.npmjs.com/package/@anthropic-ai/claude-agent-sdk) directly. It doesn't wrap terminal output. It adds multi-session orchestration, persistent AI teammates (Mates), structured debates, scheduled agents, multi-user collaboration, and a full browser UI.
129
+ **"Is this a Claude Code wrapper?"**
130
+ No. Clay drives Claude Code through the [Claude Agent SDK](https://www.npmjs.com/package/@anthropic-ai/claude-agent-sdk) and Codex through the Codex app-server protocol. Both are first-class. Clay adds multi-session orchestration, persistent Mates, structured debates, scheduled agents, multi-user collaboration, built-in MCP servers, and a full browser UI on top.
131
+
132
+ **"Can I run Claude Code and Codex in the same workspace?"**
133
+ Yes. Pick a vendor when you open a session. Switch per session. Same projects, same Mates, same memory.
97
134
 
98
135
  **"Does my code leave my machine?"**
99
- Clay is fully self-hosted. The server runs on your machine, files stay local. Only API calls go out, same as using the CLI directly.
136
+ Only as model API calls (the same as using the CLI directly). Sessions, Mates, knowledge, and settings all stay on disk.
100
137
 
101
- **"Can I continue a CLI session in the browser?"**
102
- Yes. Pick up a CLI session in the browser, or continue a browser session in the CLI.
138
+ **"Does my existing CLAUDE.md / AGENTS.md / .cursorrules work?"**
139
+ Yes. Clay loads native instruction files for each vendor and merges the rest into the system prompt automatically.
103
140
 
104
- **"Does my existing CLAUDE.md work?"**
105
- Yes. If your project has a CLAUDE.md, it works in Clay as-is.
141
+ **"Can I continue a CLI session in the browser?"**
142
+ Yes. CLI sessions show up in the sidebar. Browser sessions can be picked up in the CLI.
106
143
 
107
144
  **"Does each teammate need their own API key?"**
108
- No. Teammates can share one org-wide API key. On Linux with OS-level isolation, each member can also use their own Claude Code login. You can assign different API keys per project for billing isolation.
145
+ No. Share one org-wide key, or let each user bring their own. On Linux with OS-level isolation, each member can also use their own Claude Code or Codex login.
146
+
147
+ **"What does OS-level isolation actually do?"**
148
+ On Linux, opt in and Clay provisions each user as a real Linux account. File ACLs are enforced via `setfacl`, agent processes spawn under the user's UID/GID, and the kernel handles the rest. One teammate can't read another's project files, even by accident. The guarantee comes from the OS, not from a promise in our code.
109
149
 
110
150
  **"Does it work with MCP servers?"**
111
- Yes. MCP configurations from the CLI carry over as-is.
151
+ Yes. User-configured MCPs from `~/.clay/mcp.json` plus built-in browser, email, ask-user, and debate servers. All work in both Claude and Codex sessions.
112
152
 
113
153
  **"Can I use it on my phone?"**
114
- Yes. Clay works as a PWA on iOS and Android. You get push notifications for approvals, errors, and completed tasks. No app store required.
154
+ Yes. Install as a PWA on iOS or Android. Push notifications for approvals, errors, and task completion.
115
155
 
116
156
  **"What is d.clay.studio in my browser URL?"**
117
- It's a DNS-only service that resolves to your local IP for HTTPS certificate validation. No data passes through it. All traffic stays between your browser and your machine. See [clay-dns](clay-dns/) for details.
118
-
119
- ## Why I built Clay
157
+ A DNS-only service that resolves to your local IP for HTTPS certificate validation. No data passes through it. All traffic stays between your browser and your machine. See [clay-dns](clay-dns/) for details.
120
158
 
121
- Claude Code is the best coding agent I've found. I wanted to turn it into a team, not just a single-player tool.
159
+ ## Our Philosophy
122
160
 
123
- That started as a browser interface so I could access it from anywhere. Then I added multi-user so my team could use it too. Then I started building the AI teammates themselves.
161
+ One idea: **user experience sovereignty**.
124
162
 
125
- Most AI agent projects go for full autonomy. Let the AI loose, give it all the permissions, let it run. I wanted the opposite: **AI that works as part of a team.** Visible, controllable, accountable. Your teammates can see what the agent is doing, jump in when it needs help, and set the rules it operates under.
163
+ Not a grand statement. A simple wish: not to have your thinking, your work, and your data locked in the moment a vendor changes a price or rewrites a ToS.
126
164
 
127
- That's Clay now. A workspace where AI teammates have names, persistent memory, and their own perspective. Not "act like an expert" prompting. Actual colleagues who remember last week and sit in your sidebar next to the human ones.
165
+ That shows up in the technical choices we made:
128
166
 
129
- ## CLI Options
130
-
131
- ```bash
132
- npx clay-server # Default (port 2633)
133
- npx clay-server -p 8080 # Specify port
134
- npx clay-server --yes # Skip interactive prompts (use defaults)
135
- npx clay-server -y --pin 123456
136
- # Non-interactive + PIN (for scripts/CI)
137
- npx clay-server --add . # Add current directory to running daemon
138
- npx clay-server --remove . # Remove project
139
- npx clay-server --list # List registered projects
140
- npx clay-server --shutdown # Stop running daemon
141
- npx clay-server --dangerously-skip-permissions
142
- # Bypass all permission prompts (requires PIN at setup)
143
- ```
167
+ - **Your machine is the server.** Browser → your daemon → model API. That's the full chain. No vendor cloud, no relay server, no middle tier syncing your sessions through someone else's infrastructure.
168
+ - **One toggle between vendors.** The adapter layer (YOKE) speaks the Claude Agent SDK and the Codex app-server protocol natively. Switching is a setting, not a migration.
169
+ - **Plain text on disk.** Sessions, Mates, knowledge, and settings live as JSONL and Markdown. No proprietary database. You can `cat`, `grep`, version, and back up everything yourself.
170
+ - **Standard formats only.** CLAUDE.md, AGENTS.md, `.cursorrules`, MCP, Unix cron. If you walk away from Clay, your data walks with you in formats every other tool already understands.
144
171
 
145
- Run `npx clay-server --help` for all options.
172
+ That's the principle. The rest of the README is what it makes possible.
146
173
 
147
174
  ## Architecture
148
175
 
149
- Clay drives agent execution through the [Claude Agent SDK](https://www.npmjs.com/package/@anthropic-ai/claude-agent-sdk) and streams it to the browser over WebSocket.
176
+ Clay is a self-hosted daemon. It drives Claude Code (via the [Claude Agent SDK](https://www.npmjs.com/package/@anthropic-ai/claude-agent-sdk)) and Codex (via the `codex app-server` JSON-RPC protocol) through a vendor-agnostic adapter layer (**YOKE**), and serves a multi-user web workspace over HTTP/WS. Sessions, Mates, and knowledge live as plain JSONL/Markdown on disk.
150
177
 
151
178
  ```mermaid
152
179
  graph LR
153
- Browser["Browser<br/>(Phone / Desktop)"]
154
- WS["WebSocket"]
155
- Server["HTTP Server<br/>lib/server.js"]
156
- Project["Project Context<br/>lib/project.js"]
157
- SDK["Claude Agent SDK"]
158
- Claude["Claude Code<br/>Process"]
159
- Push["Push Service"]
160
-
161
- Browser <-->|Real time stream| WS
162
- WS <--> Server
163
- Server -->|slug routing| Project
164
- Project <-->|async iterable| SDK
165
- SDK <-->|Prompt / Response| Claude
166
- Project -->|Approval request| Push
167
- Push -->|Notification| Browser
180
+ subgraph Clients
181
+ B1["Browser<br/>User A"]
182
+ B2["Browser<br/>User B"]
183
+ Phone["Phone PWA<br/>+ Push"]
184
+ end
185
+
186
+ subgraph Daemon["Clay Daemon (your machine)"]
187
+ Auth["Auth + RBAC"]
188
+ Server["HTTP / WS Server"]
189
+ Project["Project Context"]
190
+ YOKE["YOKE Adapter Layer"]
191
+ MCP["Built-in MCP servers<br/>ask-user / browser /<br/>debate / email"]
192
+ Push["Push (VAPID)"]
193
+ end
194
+
195
+ subgraph Vendors["Agent runtimes"]
196
+ Claude["Claude Agent SDK"]
197
+ Codex["codex app-server<br/>(JSON-RPC stdio)"]
198
+ end
199
+
200
+ B1 <-->|WS| Server
201
+ B2 <-->|WS| Server
202
+ Phone <-->|WS + push| Server
203
+ Server --> Auth
204
+ Server --> Project
205
+ Project --> YOKE
206
+ Project --> MCP
207
+ Project --> Push
208
+ YOKE --> Claude
209
+ YOKE --> Codex
210
+ Push -.-> Phone
168
211
  ```
169
212
 
170
- For detailed sequence diagrams, daemon architecture, and design decisions, see [docs/architecture.md](docs/architecture.md).
213
+ For sequence diagrams, OS-level isolation, daemon IPC, and key design decisions, see [docs/guides/architecture.md](docs/guides/architecture.md).
171
214
 
172
215
  ## Community Projects
173
216
 
@@ -195,7 +238,7 @@ If you're using Clay, let us know how in Discussions:
195
238
 
196
239
  ## Disclaimer
197
240
 
198
- Not affiliated with Anthropic. Claude is a trademark of Anthropic. Provided "as is" without warranty. Users are responsible for complying with their AI provider's terms of service.
241
+ Not affiliated with Anthropic or OpenAI. Claude is a trademark of Anthropic. Codex is a trademark of OpenAI. Provided "as is" without warranty. Users are responsible for complying with their AI provider's terms of service.
199
242
 
200
243
  ## License
201
244
 
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "claude-relay",
3
- "version": "2.35.1",
3
+ "version": "2.36.0-beta.1",
4
4
  "description": "Alias for clay-server — Web UI for Claude Code.",
5
5
  "bin": {
6
6
  "claude-relay": "./bin/cli.js"
7
7
  },
8
8
  "dependencies": {
9
- "clay-server": "2.35.1"
9
+ "clay-server": "2.36.0-beta.1"
10
10
  },
11
11
  "keywords": [
12
12
  "claude",