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 +56 -60
- package/lib/sdk-bridge.js +12 -3
- package/package.json +2 -2
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">
|
|
5
|
+
<h3 align="center">Claude Code for your whole team. No team? Build one with AI.</h3>
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/clay-server) [](https://www.npmjs.com/package/clay-server) [](https://github.com/chadbyte/clay) [](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
|
-
|
|
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
|
-
###
|
|
22
|
+
### Drop-in replacement for the CLI
|
|
23
23
|
|
|
24
|
-
|
|
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
|
-
|
|
26
|
+
<p align="center">
|
|
27
|
+
<img src="media/split.gif" alt="split-screen workflow" width="700">
|
|
28
|
+
</p>
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
### Claude Code on steroids
|
|
29
31
|
|
|
30
|
-
|
|
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
|
-
|
|
34
|
+
**Schedule agents with cron**, or let them run autonomously with **Ralph Loop**. Close your laptop, sessions keep running.
|
|
33
35
|
|
|
34
|
-
|
|
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
|
-
|
|
38
|
+
<p align="center">
|
|
39
|
+
<img src="media/phone.gif" alt="Clay on phone" width="280">
|
|
40
|
+
</p>
|
|
37
41
|
|
|
38
|
-
###
|
|
42
|
+
### Your machine, your server, your data
|
|
39
43
|
|
|
40
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
58
|
+
### Build your AI team
|
|
62
59
|
|
|
63
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
66
|
+
<!-- TODO: debate.gif -->
|
|
74
67
|
|
|
75
|
-
|
|
68
|
+
---
|
|
76
69
|
|
|
77
|
-
|
|
70
|
+
## Who is Clay for
|
|
78
71
|
|
|
79
|
-
|
|
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
|
-
|
|
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
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
|
107
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
4
|
-
"description": "
|
|
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"
|