claude-relay 1.5.0 → 2.0.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
@@ -4,126 +4,220 @@
4
4
  <img src="media/phone.gif" alt="claude-relay on phone" width="300">
5
5
  </p>
6
6
 
7
- <h3 align="center">Claude Code on your phone. Push notifications. Zero install.</h3>
7
+ <h3 align="center">Web UI for Claude Code. Any device. Push notifications.</h3>
8
8
 
9
- [![npm](https://img.shields.io/npm/v/claude-relay)](https://www.npmjs.com/package/claude-relay) [![downloads](https://img.shields.io/npm/dw/claude-relay)](https://www.npmjs.com/package/claude-relay)
9
+ Claude Code. Anywhere.
10
+ Same session. Same files. Same machine.
11
+ Your files stay on your computer. Nothing leaves for the cloud.
10
12
 
11
- You step away. Claude Code stops.
13
+ Pick up the same Claude Code session on your phone.
14
+ Start in the terminal, continue on your phone, switch back anytime.
15
+ Same session, same files, now in your pocket.
12
16
 
13
- > "A 10-second approval can block it for hours if you're not at your desk."
14
- > [#25115](https://github.com/anthropics/claude-code/issues/25115)
17
+ Claude Code is automating more of your editing and execution workflow.
18
+ But when it needs approval or asks a question, it halts in the terminal. If you walk away, it just sits there waiting.
15
19
 
16
- > "I don't need to write code on my phone. I need to approve, reject, continue, stop. That's it."
17
- > [#18189](https://github.com/anthropics/claude-code/issues/18189)
20
+ claude-relay eliminates this bottleneck.
21
+ It is not a thin wrapper that intercepts input/output. It drives Claude Code via the Claude Agent SDK and relays the stream from your local machine to your browser.
18
22
 
19
- **claude-relay fixes this.** Your phone buzzes when Claude needs you. Tap approve. Claude keeps working. You keep doing whatever you were doing.
23
+ Get approval notifications while grabbing a coffee.
24
+ Continue working from the sofa on your iPad.
25
+ Split your browser: claude-relay on one side, your app preview on the other, and watch the code change in real time.
20
26
 
21
- No app. No cloud. No account. Your code never touches a third-party server.
22
-
23
- Runs a Claude Code session on your machine via the [Claude Agent SDK](https://www.npmjs.com/package/@anthropic-ai/claude-agent-sdk) and streams it to your browser over WebSocket. Nothing is proxied through external servers.
27
+ ```bash
28
+ cd ~/your-project
29
+ npx claude-relay
30
+ # First run: Set Port/PIN -> Scan QR -> Connect
31
+ ```
24
32
 
25
33
  ---
26
34
 
27
- ## Push notifications for Claude Code
28
-
29
- Permission request. Task done. Error. Question. Your phone buzzes. Browser can be closed.
35
+ ## Never Miss an Approval
30
36
 
31
- Add to home screen PWA push notifications work like a native app. Setup wizard handles everything.
37
+ When Claude Code requests permission before executing a tool, you get a notification on your phone.
38
+ One tap, and Claude Code gets back to work.
32
39
 
33
40
  <p align="center">
34
41
  <img src="media/push-notification.jpg" alt="push notification" width="300">
35
42
  </p>
36
43
 
37
- ## Use Claude Code from any device
44
+ It works in browser tabs too. When input is awaited, the favicon blinks and the tab title changes to alert you.
45
+
46
+ ## Side by Side Workflow
38
47
 
39
- Open claude-relay on your phone, tablet, or any browser. Type a prompt, watch Claude work, review code — all in real time. Every connected device sees the same session live.
48
+ Keep claude-relay on one side and your localhost on the other.
49
+ Watch the results update live while Claude Code fixes your source files.
40
50
 
41
- Permission prompt? Approve from whichever device is closest. The session updates everywhere instantly.
51
+ Mermaid diagrams render as diagrams, and tables appear as actual tables.
52
+ You can explore files in the sidebar and use the built-in terminal to run shell commands.
42
53
 
43
- ## Quick start
54
+ ## All in One Place
55
+
56
+ Run `npx claude-relay` in each project to register them to the same server.
57
+ Manage all your active sessions from a single dashboard.
44
58
 
45
59
  ```bash
46
- # Run in your project directory
47
- npx claude-relay
60
+ cd ~/projects/backend && npx claude-relay # Register project
61
+ cd ~/projects/frontend && npx claude-relay # Adds to the same server
62
+ ```
48
63
 
49
- # Scan the QR code with your phone opens Claude Code in your browser
64
+ The server runs in the background. Even if you close the terminal window, your sessions and the server remain active.
65
+
66
+ ---
50
67
 
51
- # Press 's' → setup wizard → push + remote access in 3 steps
68
+ ## Getting Started
69
+
70
+ ```bash
71
+ npx claude-relay
52
72
  ```
53
73
 
54
74
  <p align="center">
55
75
  <img src="media/start.gif" alt="npx claude-relay" width="600">
56
76
  </p>
57
77
 
58
- ## All features
78
+ On the first run, you'll set a port and PIN to launch the server.
79
+ Scan the QR code with your phone to connect instantly, or open the URL displayed in your terminal.
80
+
81
+ ## Key Features
82
+
83
+ * **Push Approvals** - Approve or reject from your phone while away, so Claude Code does not get stuck waiting.
84
+ * **Multi Project Daemon** - Manage all projects via a single port.
85
+ * **Auto Session Logs (JSONL)** - Conversations and execution history are always saved locally. No data loss on crashes or restarts. Location: `./.claude-relay/sessions/`
86
+ * **File Browser and Terminal** - Inspect files and execute commands directly from the browser.
87
+
88
+ > Note: Session logs may contain prompts, outputs, and commands. Do not share this folder.
89
+
90
+ <details>
91
+ <summary>View Full Feature List</summary>
92
+
93
+ **Notifications**
94
+
95
+ * **Push Notifications** - Approvals, completions, errors, and questions. Add to Home Screen (PWA) to receive notifications without opening the app. Behavior depends on OS and browser. Tested on iPhone (Home Screen PWA) and desktop Chrome.
96
+ * **Favicon and Title Blinking** - Visual cues when input is awaited.
97
+ * **Sound Alerts** - Supports browser notifications, desktop notifications, and audio alerts.
98
+
99
+ **Projects and Sessions**
59
100
 
60
- - **Push notifications** permission requests, completions, errors, questions. Works with browser closed.
61
- - **Real-time sync** every device sees the same session live via WebSocket. Type on desktop, see it on phone.
62
- - **Session persistence** server restarts, browser crashes, network drops. Session survives. Conversation is never lost.
63
- - **Session handoff** start in the terminal, pick it up on your phone, hand it back. Seamless.
64
- - **Conversation rewind** click any previous message to roll back conversation and files together, with full diffs
65
- - **Mobile-first UI** — big approve/deny buttons, one-handed use
66
- - **iPad and tablet support** — full Claude Code from any browser. Your actual machine, your tools, your MCP servers, your files.
67
- - **Setup wizard** — Tailscale, HTTPS, push. Step by step.
68
- - **Multi-session** — multiple projects, automatic port selection
69
- - **PIN protection** — access control beyond network security
70
- - **HTTPS** — automatic certs via mkcert
71
- - **Slash commands** — with autocomplete
72
- - **Zero config** — works with your existing Claude Code setup
101
+ * **Multi Project** - Single port management for all projects.
102
+ * **Project Names** - Custom names make it easy to distinguish tabs.
103
+ * **Session Persistence** - Sessions survive server restarts, browser crashes, and network drops.
104
+ * **Session Handoff** - Start in the terminal, continue on your phone, pass back to desktop.
105
+ * **Rewind (Native Claude Code)** - Accessible directly from the browser UI.
73
106
 
74
- ## Network access
107
+ **Rendering and Tools**
75
108
 
76
- On the same Wi-Fi? It just works. Open the URL shown in the terminal from any device on your network.
109
+ * **Mermaid and Markdown** - Proper rendering for diagrams, tables, and code blocks.
110
+ * **Syntax Highlighting** - Support for over 180 languages with copy buttons on every block.
111
+ * **File Browser** - Sidebar navigation with file previews and markdown rendering.
112
+ * **Built in Terminal** - Full shell access within the browser.
113
+ * **Slash Commands** - Execute standard Claude Code commands from the browser, with autocomplete.
77
114
 
78
- Outside your network? [Tailscale](https://tailscale.com) creates an encrypted tunnel between your devices. No port forwarding. No cloud relay. Your code never leaves your control.
115
+ **UI**
79
116
 
80
- Install on both devices. Same account. Done. claude-relay detects it automatically. Free for personal use.
117
+ * **Mobile Optimized** - Large approve and reject buttons. Behaves like a native app via PWA.
118
+ * **Real time Sync** - All devices view the exact same session state.
119
+ * **QR Code** - Scan to connect instantly.
120
+ * **Image Paste** - Paste images directly from your clipboard into the input.
81
121
 
82
- ## HTTPS for push notifications
122
+ **Server and Security**
83
123
 
84
- Push needs HTTPS. [mkcert](https://github.com/FiloSottile/mkcert) makes it painless:
124
+ * **Background Daemon** - Server persists even if the CLI is closed.
125
+ * **Keep Awake** - Prevents macOS sleep to keep sessions alive. Configurable toggle.
126
+ * **PIN Protection** - Restrict access with a 6 digit PIN.
127
+ * **HTTPS** - Automatic certificate generation via mkcert.
128
+ * **Zero Config** - Inherits your existing Claude Code configuration.
129
+
130
+ </details>
131
+
132
+ ## Network
133
+
134
+ On the same Wi Fi, it just works. Open the URL shown in the terminal on any device.
135
+
136
+ For remote access, [Tailscale](https://tailscale.com) is recommended. Install it on both devices and log in with the same account to connect via an encrypted tunnel without port forwarding. Free for personal use.
137
+
138
+ ## Security
139
+
140
+ claude-relay opens on your local network to allow access from other devices such as phones and tablets on the same Wi Fi.
141
+ Setting a PIN is highly recommended.
142
+
143
+ Anyone on your network with the URL and PIN can access the session. PIN protection can be enabled during the initial setup.
144
+
145
+ Do not expose this directly to the public internet. Usage on public or shared networks is not recommended.
146
+ For remote access, use [Tailscale](https://tailscale.com) or a VPN.
147
+
148
+ Users are responsible for their network configuration and exposure scope.
149
+
150
+ ## HTTPS for Push
151
+
152
+ Basic features work out of the box. Only push notifications require HTTPS.
153
+
154
+ Set it up once using [mkcert](https://github.com/FiloSottile/mkcert):
85
155
 
86
156
  ```bash
87
157
  brew install mkcert
88
158
  mkcert -install
89
159
  ```
90
160
 
91
- Certificates generate automatically. Setup wizard handles the rest.
161
+ Certificates are generated automatically. The setup wizard handles the rest.
162
+
163
+ If push registration fails: check whether your browser trusts HTTPS and whether your phone can access the address.
92
164
 
93
- ## CLI options
165
+ ## CLI Options
94
166
 
95
167
  ```bash
96
- npx claude-relay # defaults
97
- npx claude-relay -p 8080 # custom port (default: 2633)
98
- npx claude-relay --no-https # disable HTTPS
99
- npx claude-relay --no-update # skip update check
100
- npx claude-relay --debug # debug panel
168
+ npx claude-relay # Default (port 2633)
169
+ npx claude-relay -p 8080 # Specify port
170
+ npx claude-relay --no-https # Disable HTTPS
171
+ npx claude-relay --no-update # Skip update check
172
+ npx claude-relay --debug # Enable debug panel
101
173
  ```
102
174
 
103
175
  ## Requirements
104
176
 
105
- - [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) installed and authenticated
106
- - Node.js 18+
107
- - [mkcert](https://github.com/FiloSottile/mkcert) for HTTPS and push
108
- - [Tailscale](https://tailscale.com) for remote access
109
-
110
- ## Security
111
-
112
- **Anyone with the URL gets full Claude Code access to your machine.** Read, write, execute — your user permissions.
113
-
114
- PIN protection is enabled during setup — every new device must enter the PIN shown in your terminal before accessing any session. This prevents casual shoulder-surfing of the QR code, but is not a substitute for network-level security.
177
+ * [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) installed and authenticated
178
+ * Node.js 18+
179
+ * [mkcert](https://github.com/FiloSottile/mkcert) - For push notifications (optional)
180
+ * [Tailscale](https://tailscale.com) - For remote access (optional)
181
+
182
+ ## Architecture
183
+
184
+ claude-relay is not a wrapper that intercepts standard input/output.
185
+ It is a local relay server that drives Claude Code execution via the [Claude Agent SDK](https://www.npmjs.com/package/@anthropic-ai/claude-agent-sdk) and streams data to the browser via WebSocket.
186
+
187
+ ```mermaid
188
+ graph LR
189
+ Browser["Browser<br/>(Phone / Desktop)"]
190
+ WS["WebSocket"]
191
+ Server["HTTP Server<br/>lib/server.js"]
192
+ Project["Project Context<br/>lib/project.js"]
193
+ SDK["Claude Agent SDK"]
194
+ Claude["Claude Code<br/>Process"]
195
+ Push["Push Service"]
196
+
197
+ Browser <-->|Real time stream| WS
198
+ WS <--> Server
199
+ Server -->|slug routing| Project
200
+ Project <-->|async iterable| SDK
201
+ SDK <-->|Prompt / Response| Claude
202
+ Project -->|Approval request| Push
203
+ Push -->|Notification| Browser
204
+ ```
115
205
 
116
- Private network only. [Tailscale](https://tailscale.com), WireGuard, or a VPN. Never expose to the public internet.
206
+ For a detailed sequence diagram, daemon structure, and design decisions, refer to [docs/architecture.md](docs/architecture.md).
117
207
 
118
- **Entirely at your own risk.**
208
+ ---
119
209
 
120
210
  ## Contributing
121
211
 
122
- Bug fixes and typos PR welcome. Feature ideas [open an issue](https://github.com/chadbyte/claude-relay/issues) first. See [CONTRIBUTING.md](CONTRIBUTING.md).
212
+ Bug fixes and typos are welcome. For feature suggestions, please open an issue first:
213
+ [https://github.com/chadbyte/claude-relay/issues](https://github.com/chadbyte/claude-relay/issues)
214
+
215
+ If you are using claude-relay, let us know how you are using it in Discussions:
216
+ [https://github.com/chadbyte/claude-relay/discussions](https://github.com/chadbyte/claude-relay/discussions)
123
217
 
124
218
  ## Disclaimer
125
219
 
126
- Independent project. Not affiliated with Anthropic. "Claude" is a trademark of Anthropic.
220
+ This is an independent project and is not affiliated with Anthropic. Claude is a trademark of Anthropic.
127
221
 
128
222
  ## License
129
223