clay-server 2.21.0-beta.3 → 2.21.0

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.
package/README.md CHANGED
@@ -2,13 +2,13 @@
2
2
  <img src="media/logo/icon-full-banded-256-transparent.png" alt="Clay" />
3
3
  </p>
4
4
 
5
- <h3 align="center">Your AI dev team. Not another coding agent.</h3>
5
+ <h3 align="center">Claude Code for your whole team. No team? Build one with AI.</h3>
6
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
8
 
9
9
  <p align="center"><img src="media/hero.png" alt="Clay workspace" /></p>
10
10
 
11
- A team workspace built on Claude Code. AI teammates who remember your decisions, challenge your thinking, and grow with your codebase. Runs on your machine.
11
+ Everything Claude Code does, in your browser and on your phone. Multi-session, multi-user, self-hosted. No cloud relay, no middleman.
12
12
 
13
13
  ```bash
14
14
  npx clay-server
@@ -19,64 +19,59 @@ npx clay-server
19
19
 
20
20
  ## What you get
21
21
 
22
- ### Debate before you decide
22
+ ### Drop-in replacement for the CLI
23
23
 
24
- <!-- TODO: debate.gif -->
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.
25
25
 
26
- Let your Mates challenge each other. Set up a debate. Pick a moderator and panelists, give them a topic, and let them go. You can raise your hand to interject.
26
+ <p align="center">
27
+ <img src="media/split.gif" alt="split-screen workflow" width="700">
28
+ </p>
27
29
 
28
- "REST vs GraphQL for the new API?" "Monorepo or separate repos?" "This architecture won't scale past 10k users. Here's why." Get opposing perspectives before you commit.
30
+ ### Claude Code on steroids
29
31
 
30
- ### Build your team with Mates
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.
31
33
 
32
- <!-- TODO: mates.gif -->
34
+ **Schedule agents with cron**, or let them run autonomously with **Ralph Loop**. Close your laptop, sessions keep running.
33
35
 
34
- Mates are AI teammates shaped through real conversation, built to hold their own perspective. Give them a name, avatar, expertise, and working style. **They don't flatter you. They push back.**
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.
35
37
 
36
- @mention them in any project session, DM them directly, or bring multiple into the same conversation. Each Mate builds persistent knowledge over time, remembering past decisions, project context, and how you work together.
38
+ <p align="center">
39
+ <img src="media/phone.gif" alt="Clay on phone" width="280">
40
+ </p>
37
41
 
38
- ### Drop-in replacement
42
+ ### Your machine, your server, your data
39
43
 
40
- Your existing agent setup works as-is. CLI sessions, CLAUDE.md rules, MCP servers. **No migration needed.** Pick up a CLI session in the browser, or continue a browser session in the CLI.
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.
41
45
 
42
- ### Your machine, your server
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.
43
47
 
44
- Clay runs as a daemon on your machine. **No cloud relay, no intermediary service.** Schedule agents with cron, get push notifications on your phone, close your laptop. Sessions keep running.
48
+ **Secure by default.** PIN authentication, per-project permissions, and HTTPS are built in.
45
49
 
46
50
  ### Bring your whole team
47
51
 
48
- **One API key runs the whole workspace.** Invite teammates, set permissions per person, per project, per session. If someone gets stuck, **jump into their session** to help in real time.
49
-
50
- ### Before vs Clay
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.
51
53
 
52
- | Before | With Clay |
53
- |---|---|
54
- | One CLI session at a time | Multiple agents across projects, persistent |
55
- | No shared context across teammates | Shared workspace with roles and permissions |
56
- | No memory between decisions | AI that remembers past decisions and challenges new ones |
57
- | No teammates, just prompts | Mates with names, knowledge, and opinions |
54
+ **OS-level isolation.** On Linux, Clay maps each user to an OS-level account. File permissions and process isolation just work.
58
55
 
59
- ### Why not just use Claude Code directly?
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.
60
57
 
61
- Claude Code is excellent for solo coding. Clay is for when you need more than a single agent session. A team that debates your architecture decisions. AI colleagues who remember what you decided last month. A workspace where your human teammates and AI teammates sit side by side.
58
+ ### Build your AI team
62
59
 
63
- If Claude Code is a solo instrument, Clay is the band.
64
-
65
- ## Who is Clay for
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.**
66
61
 
67
- - **Solo dev juggling multiple roles.** You need a code reviewer, a marketing lead, a writing partner, but it's just you. Build them as Mates.
68
- - **Small team sharing one AI workflow.** One API key, everyone in the browser, no terminal knowledge required.
69
- - **Founder doing dev + product + ops.** Run agents overnight, get notified on your phone, review in the morning.
62
+ <!-- TODO: mates.gif -->
70
63
 
71
- ## Why I built Clay
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."
72
65
 
73
- I wanted AI teammates, not just a coding agent. The underlying agent is the best foundation for a personal AI I've found. I wanted to turn it into my own AI assistant, one that knows my context, remembers my decisions, and works the way I work.
66
+ <!-- TODO: debate.gif -->
74
67
 
75
- 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.
68
+ ---
76
69
 
77
- 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.
70
+ ## Who is Clay for
78
71
 
79
- That's Clay now. A workspace where AI teammates have names, persistent memory, and their own perspective. Not "act like an expert" prompting. Actual teammates that push back, remember last week, and sit in your sidebar next to your human colleagues.
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.
80
75
 
81
76
  ## Getting Started
82
77
 
@@ -87,43 +82,50 @@ npx clay-server
87
82
  ```
88
83
 
89
84
  On first run, it asks for a port number and whether you're using it solo or with a team.
90
- Scan the QR code to connect from your phone instantly.
85
+ Open the browser URL or scan the QR code to connect from your phone instantly.
91
86
 
92
87
  For remote access, use a VPN like Tailscale.
93
88
 
94
- ## Philosophy
95
-
96
- **AI is a teammate, not a tool.** A tool gets used once and forgotten. A teammate accumulates your history, your decisions, your working style. Give them a specialty, let them build context over time, and bring them into any project as a colleague.
97
-
98
- **AI should understand you first.** When you create a Mate, set up a scheduled task, or start a Ralph Loop, Clay interviews you. Not to save time, but to use AI's capability to understand what you actually want. "Just do it for me" is a trap. The better AI understands you, the better the output.
99
-
100
- **Your data is yours.** Sessions are JSONL files. 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. If you stop using Clay tomorrow, your data doesn't disappear.
101
-
102
- **Friction is a feature.** The goal of AI is not to remove all friction. It's to free you to focus on the friction that matters. Reviewing a critical decision, shaping the direction, catching what the agent missed. Clay keeps those moments in, on purpose.
89
+ <p align="center">
90
+ <img src="media/start.gif" alt="Clay starting from CLI" width="600">
91
+ </p>
103
92
 
104
93
  ## FAQ
105
94
 
106
- **"Is this just a terminal wrapper?"**
107
- No. Clay is a team workspace that happens to use Claude as its engine. It manages AI teammates, persistent knowledge, and structured debates. The agent runtime is an implementation detail.
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.
108
97
 
109
98
  **"Does my code leave my machine?"**
110
- The Clay server runs locally. Files stay local. Only Claude API calls go out, which is the same as using the CLI.
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.
111
100
 
112
- **"Can I continue a CLI session?"**
101
+ **"Can I continue a CLI session in the browser?"**
113
102
  Yes. Pick up a CLI session in the browser, or continue a browser session in the CLI.
114
103
 
115
104
  **"Does my existing CLAUDE.md work?"**
116
105
  Yes. If your project has a CLAUDE.md, it works in Clay as-is.
117
106
 
118
107
  **"Does each teammate need their own API key?"**
119
- No. Teammates share the Claude Code session logged in on the server. You can also assign different API keys per project for billing isolation.
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.
120
109
 
121
110
  **"Does it work with MCP servers?"**
122
111
  Yes. MCP configurations from the CLI carry over as-is.
123
112
 
113
+ **"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.
115
+
124
116
  **"What is d.clay.studio in my browser URL?"**
125
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.
126
118
 
119
+ ## Why I built Clay
120
+
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.
122
+
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.
124
+
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.
126
+
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.
128
+
127
129
  ## CLI Options
128
130
 
129
131
  ```bash
@@ -132,20 +134,16 @@ npx clay-server -p 8080 # Specify port
132
134
  npx clay-server --yes # Skip interactive prompts (use defaults)
133
135
  npx clay-server -y --pin 123456
134
136
  # Non-interactive + PIN (for scripts/CI)
135
- npx clay-server --no-https # Disable HTTPS
136
- npx clay-server --local-cert # Use local certificate (mkcert) instead of builtin
137
- npx clay-server --no-update # Skip update check
138
- npx clay-server --debug # Enable debug panel
139
137
  npx clay-server --add . # Add current directory to running daemon
140
- npx clay-server --add /path # Add project by path
141
138
  npx clay-server --remove . # Remove project
142
139
  npx clay-server --list # List registered projects
143
140
  npx clay-server --shutdown # Stop running daemon
144
141
  npx clay-server --dangerously-skip-permissions
145
142
  # Bypass all permission prompts (requires PIN at setup)
146
- npx clay-server --dev # Dev mode (foreground, auto-restart on lib/ changes, port 2635)
147
143
  ```
148
144
 
145
+ Run `npx clay-server --help` for all options.
146
+
149
147
  ## Architecture
150
148
 
151
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.
@@ -187,9 +185,7 @@ If you're using Clay, let us know how in Discussions:
187
185
 
188
186
  ## Disclaimer
189
187
 
190
- This is an independent project and is not affiliated with Anthropic. Claude is a trademark of Anthropic.
191
-
192
- Clay is provided "as is" without warranty of any kind. Users are responsible for complying with the terms of service of underlying AI providers (e.g., Anthropic, OpenAI) and all applicable terms of any third-party services. Features such as multi-user mode are experimental and may involve sharing access to API-based services. Before enabling such features, review your provider's usage policies regarding account sharing, acceptable use, and any applicable rate limits or restrictions. The authors assume no liability for misuse or violations arising from the use of this software.
188
+ 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.
193
189
 
194
190
  ## License
195
191
 
package/lib/sdk-bridge.js CHANGED
@@ -1234,9 +1234,9 @@ function createSDKBridge(opts) {
1234
1234
  // Auto-approve safe Bash commands (read-only, non-destructive)
1235
1235
  if (toolName === "Bash" && input && input.command) {
1236
1236
  var cmd = input.command.trim();
1237
- var firstWord = cmd.split(/[\s;|&]/)[0];
1238
1237
  var safeBashCommands = {
1239
- ls: true, cat: true, head: true, tail: true, wc: true, file: true,
1238
+ // Navigation (harmless on its own, checked in compound commands below)
1239
+ cd: true, pushd: true, popd: true,
1240
1240
  // File/dir inspection
1241
1241
  ls: true, cat: true, head: true, tail: true, wc: true, file: true,
1242
1242
  stat: true, find: true, tree: true, du: true, df: true,
@@ -1273,7 +1273,16 @@ function createSDKBridge(opts) {
1273
1273
  nslookup: true, host: true, ping: true, traceroute: true,
1274
1274
  curl: true, wget: true, http: true,
1275
1275
  };
1276
- if (safeBashCommands[firstWord]) {
1276
+ // Split compound commands (&&, ||, ;, |) and check ALL segments
1277
+ var segments = cmd.split(/\s*(?:&&|\|\||[;|])\s*/);
1278
+ var allSafe = true;
1279
+ for (var si = 0; si < segments.length; si++) {
1280
+ var seg = segments[si].trim();
1281
+ if (!seg) continue;
1282
+ var firstWord = seg.split(/\s/)[0];
1283
+ if (!safeBashCommands[firstWord]) { allSafe = false; break; }
1284
+ }
1285
+ if (allSafe) {
1277
1286
  return Promise.resolve({ behavior: "allow", updatedInput: input });
1278
1287
  }
1279
1288
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "clay-server",
3
- "version": "2.21.0-beta.3",
4
- "description": "Web UI for Claude Code. Any device. Push notifications.",
3
+ "version": "2.21.0",
4
+ "description": "Self-hosted Claude Code in your browser. Multi-session, multi-user, push notifications.",
5
5
  "bin": {
6
6
  "clay-server": "./bin/cli.js",
7
7
  "claude-relay": "./bin/claude-relay.js"