claude4arc 0.5.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/LICENSE +21 -0
- package/README.md +275 -0
- package/bin/claude4arc.js +405 -0
- package/extension/background.js +153 -0
- package/extension/guard.js +66 -0
- package/extension/icons/icon-128.png +0 -0
- package/extension/icons/icon-16.png +0 -0
- package/extension/icons/icon-32.png +0 -0
- package/extension/icons/icon-48.png +0 -0
- package/extension/manifest.json +41 -0
- package/host/host.js +368 -0
- package/lib/blocklist.js +52 -0
- package/lib/browsers.js +56 -0
- package/lib/client.js +89 -0
- package/lib/commands.js +353 -0
- package/lib/config.js +22 -0
- package/lib/dnd.js +60 -0
- package/lib/editors.js +373 -0
- package/lib/frames.js +39 -0
- package/lib/housekeeping.js +46 -0
- package/lib/inpage.js +1381 -0
- package/lib/input.js +242 -0
- package/lib/keys.js +109 -0
- package/lib/page.js +1530 -0
- package/lib/paths.js +10 -0
- package/lib/shim.js +186 -0
- package/lib/task.js +350 -0
- package/lib/util.js +64 -0
- package/package.json +43 -0
- package/skill/SKILL.md +138 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 nesetkab
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
# claude4arc
|
|
2
|
+
|
|
3
|
+
Let [Claude Code](https://docs.claude.com/en/docs/claude-code) use your real
|
|
4
|
+
[Arc](https://arc.net) browser: your tabs, your logged-in sessions, your
|
|
5
|
+
cookies. It also works in other Chromium browsers: Dia, Google Chrome, Brave,
|
|
6
|
+
Microsoft Edge, and Chromium. Claude works in background tabs, so it does not take over your
|
|
7
|
+
screen, steal focus, or show dialogs.
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
On 14 held-out browser tasks that claude4arc was not tuned on, with the same
|
|
12
|
+
model and three runs per tool, a Claude Code agent finished in 117 s with
|
|
13
|
+
claude4arc, 200 s with ego-lite, and 241 s with Claude for Chrome. It made 8,
|
|
14
|
+
36, and 70 tool calls, and read 0.48M, 2.19M, and 3.83M tokens. Every run
|
|
15
|
+
completed all 14 tasks. On the original tasks, which claude4arc was tuned on,
|
|
16
|
+
it takes about 50 s. See [bench/](bench/README.md) for the method and its
|
|
17
|
+
limits.
|
|
18
|
+
|
|
19
|
+
## Requirements
|
|
20
|
+
|
|
21
|
+
- macOS
|
|
22
|
+
- [Arc](https://arc.net), or another Chromium browser: Dia, Google Chrome,
|
|
23
|
+
Brave, Microsoft Edge, or Chromium
|
|
24
|
+
- [Node.js](https://nodejs.org) 22 or later
|
|
25
|
+
- [Claude Code](https://docs.claude.com/en/docs/claude-code)
|
|
26
|
+
|
|
27
|
+
No npm dependencies.
|
|
28
|
+
|
|
29
|
+
## Install
|
|
30
|
+
|
|
31
|
+
There are three parts: the command-line tool with its native host, a browser
|
|
32
|
+
extension, and a Claude skill.
|
|
33
|
+
|
|
34
|
+
### 1. The command-line tool
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm install -g github:nesetkab/claude4arc
|
|
38
|
+
claude4arc install
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
`claude4arc install` does three things:
|
|
42
|
+
|
|
43
|
+
1. It writes a small launcher to `~/.arc-bridge/host-launcher.sh`.
|
|
44
|
+
2. It registers the native messaging host `com.arcforclaude.bridge` for every
|
|
45
|
+
supported browser it finds in `/Applications`. Arc reads native hosts from
|
|
46
|
+
Google Chrome's folder
|
|
47
|
+
(`~/Library/Application Support/Google/Chrome/NativeMessagingHosts/`), not
|
|
48
|
+
from its own.
|
|
49
|
+
3. It links the Claude skill to `~/.claude/skills/claude4arc`. Pass
|
|
50
|
+
`--no-skill` if you install the skill as a plugin (below).
|
|
51
|
+
|
|
52
|
+
### 2. The extension
|
|
53
|
+
|
|
54
|
+
Load it once in each browser you want Claude to use:
|
|
55
|
+
|
|
56
|
+
1. Open the extensions page: `arc://extensions` in Arc, `brave://extensions`
|
|
57
|
+
in Brave, `edge://extensions` in Edge, and `chrome://extensions` in Dia,
|
|
58
|
+
Chrome, and Chromium.
|
|
59
|
+
2. Turn on **Developer mode** (top right).
|
|
60
|
+
3. Click **Load unpacked** and select the `extension` folder that
|
|
61
|
+
`claude4arc install` prints.
|
|
62
|
+
|
|
63
|
+
### 3. The skill
|
|
64
|
+
|
|
65
|
+
`claude4arc install` already linked it. To get it as a Claude Code plugin
|
|
66
|
+
instead, which updates with `claude plugin update`:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
claude plugin marketplace add nesetkab/claude4arc
|
|
70
|
+
claude plugin install claude4arc@claude4arc
|
|
71
|
+
claude4arc install --no-skill
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Check
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
claude4arc doctor
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Every line should start with `ok`. Start a new Claude Code session so that it
|
|
81
|
+
loads the skill.
|
|
82
|
+
|
|
83
|
+
### From a clone
|
|
84
|
+
|
|
85
|
+
For development, install from a clone so that your edits take effect at once:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
git clone https://github.com/nesetkab/claude4arc.git
|
|
89
|
+
cd claude4arc
|
|
90
|
+
npm link
|
|
91
|
+
claude4arc install
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Use
|
|
95
|
+
|
|
96
|
+
Ask Claude to do something in Arc, for example "open my GitHub notifications
|
|
97
|
+
in Arc and summarize them". The skill loads by itself, and Claude runs short
|
|
98
|
+
commands like these:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
claude4arc new news.ycombinator.com # task 7 p1 | Hacker News | https://...
|
|
102
|
+
claude4arc 7 find comments # @41 link "311 comments" →item?id=...
|
|
103
|
+
claude4arc 7 click @41 -s # click, then print what changed
|
|
104
|
+
claude4arc 7 fill "text=Email" ada@example.com -- click "text=Sign up" -s
|
|
105
|
+
claude4arc 7 section "Return value" # read one section of a document
|
|
106
|
+
claude4arc 7 finish # close the tabs Claude opened
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
For several tasks, `batch` runs one command chain per line in a single call.
|
|
110
|
+
It prints the start and end time of each line, keeps going after a failure,
|
|
111
|
+
and closes its tabs at the end:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
claude4arc batch <<'EOF'
|
|
115
|
+
form: goto https://example.com/signup -- fill "text=Name" Ada -- check "text=I agree" -- click "text=Submit" -s
|
|
116
|
+
docs: goto https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at -- section "Return value"
|
|
117
|
+
EOF
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
`claude4arc run` executes a Node script against the Page API for loops and
|
|
121
|
+
extraction. `claude4arc help` prints the full API, and
|
|
122
|
+
[skill/SKILL.md](skill/SKILL.md) is what Claude reads.
|
|
123
|
+
|
|
124
|
+
## Several browsers
|
|
125
|
+
|
|
126
|
+
Each browser runs its own bridge. Claude uses Arc when Arc is running, then
|
|
127
|
+
Dia, Chrome, Brave, Edge, and Chromium, in that order. To choose a browser,
|
|
128
|
+
set `CLAUDE4ARC_BROWSER`:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
CLAUDE4ARC_BROWSER=chrome claude4arc new https://example.com
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
A task stays in the browser where it started. `claude4arc status` lists the
|
|
135
|
+
connected browsers. The test suite passes in Arc and Chromium. Dia, Chrome,
|
|
136
|
+
Brave, and Edge use the same extension APIs, but have not been tested yet.
|
|
137
|
+
|
|
138
|
+
## How it works
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
Claude Code ─bash─▶ claude4arc CLI ─unix socket─▶ native host ─native messaging─▶ extension ─chrome.debugger─▶ tab
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
- **Extension** (`extension/`): an MV3 extension with the `debugger`, `tabs`,
|
|
145
|
+
`downloads`, and `nativeMessaging` permissions. It forwards an allow-listed
|
|
146
|
+
set of tab, window, download, and DevTools Protocol calls. Its `key` fixes
|
|
147
|
+
the extension ID to `bfbcdjkeonepklbmjjghoddpahhhnimp`, which the native
|
|
148
|
+
host manifest allows.
|
|
149
|
+
- **Native host** (`host/host.js`): Arc starts it when the extension connects.
|
|
150
|
+
It relays requests between a socket such as `~/.arc-bridge/arc.sock` (mode
|
|
151
|
+
0600) and the extension, and keeps per-tab state such as dialogs and frame
|
|
152
|
+
sessions.
|
|
153
|
+
- **CLI** (`bin/claude4arc.js`, `lib/`): a Page API with compact snapshots and
|
|
154
|
+
refs, trusted mouse and keyboard input, screenshots, dialogs, popups,
|
|
155
|
+
uploads, downloads, and editors.
|
|
156
|
+
- **Skill** (`skill/SKILL.md`): teaches Claude the commands and how to use
|
|
157
|
+
them with few tool calls.
|
|
158
|
+
|
|
159
|
+
Two internal names come from the first version and stay the same so that
|
|
160
|
+
existing installs keep working: the native host `com.arcforclaude.bridge` and
|
|
161
|
+
the state folder `~/.arc-bridge` (one socket per browser, the host log, task
|
|
162
|
+
records, the blocklist, and screenshots).
|
|
163
|
+
|
|
164
|
+
## Behavior in Arc
|
|
165
|
+
|
|
166
|
+
- Claude opens its own background tabs in your current space. Input,
|
|
167
|
+
snapshots, and screenshots work there without switching tabs.
|
|
168
|
+
- New windows never pop up. `target=_blank` links and `window.open` become new
|
|
169
|
+
background pages. For OAuth popups, `window.opener.postMessage` and
|
|
170
|
+
`window.close()` are relayed back to the opening page.
|
|
171
|
+
- `alert`, `confirm`, and `prompt` are answered inside the page, so no dialog
|
|
172
|
+
appears on your screen. Confirms default to cancel; Claude accepts one only
|
|
173
|
+
when it arms `accept` first.
|
|
174
|
+
- Claude's tabs are muted. Clipboard writes stay inside the page. Print,
|
|
175
|
+
share, fullscreen, permission prompts, native file pickers, and external
|
|
176
|
+
app links (`mailto:`, `zoom:`) are blocked and reported.
|
|
177
|
+
- Cross-origin iframes, open and closed shadow roots, virtual lists, and code
|
|
178
|
+
or rich-text editors (Monaco, CodeMirror, Ace, Quill, ProseMirror, Lexical,
|
|
179
|
+
CKEditor, TinyMCE) work.
|
|
180
|
+
- Google Docs and Sheets are read through Google's own export, and PDFs
|
|
181
|
+
through macOS PDFKit.
|
|
182
|
+
- `finish` closes only the tabs that Claude opened. Tabs you hand over with
|
|
183
|
+
`adopt` are released, never closed.
|
|
184
|
+
- Each task belongs to the Claude Code session that created it, so parallel
|
|
185
|
+
sessions do not interfere with each other. Set `CLAUDE4ARC_ANY_TASK=1` to
|
|
186
|
+
use a task from another session.
|
|
187
|
+
|
|
188
|
+
## Security
|
|
189
|
+
|
|
190
|
+
Any process that runs as your macOS user can connect to the socket and control
|
|
191
|
+
Arc with your logged-in sessions. This is the same trust model as other local
|
|
192
|
+
browser agents. Only install claude4arc on a machine you trust, and review
|
|
193
|
+
what Claude does in sensitive accounts.
|
|
194
|
+
|
|
195
|
+
The skill tells Claude to ask you before it sends messages, posts, buys,
|
|
196
|
+
deletes data, or changes account settings, and to hand over to you for
|
|
197
|
+
passwords, 2FA, and CAPTCHAs.
|
|
198
|
+
|
|
199
|
+
To remove access, run `claude4arc uninstall` and remove the extension in
|
|
200
|
+
`arc://extensions`.
|
|
201
|
+
|
|
202
|
+
## Blocklist
|
|
203
|
+
|
|
204
|
+
Keep Claude away from sites such as your bank or your email:
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
claude4arc block chase.com mail.google.com # a domain also covers its subdomains
|
|
208
|
+
claude4arc block github.com/settings # or only a path on a site
|
|
209
|
+
claude4arc blocked # list
|
|
210
|
+
claude4arc unblock chase.com
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Claude cannot open a blocked site, act on a page after it reaches one, or
|
|
214
|
+
adopt one of your tabs that shows one. If a page Claude opened navigates to a
|
|
215
|
+
blocked site by itself (a link, a redirect, a script), the host sends that tab
|
|
216
|
+
to `about:blank`. The list is in `~/.arc-bridge/config.json`. It is a
|
|
217
|
+
guardrail for mistakes, not a sandbox: a process that runs as you can still
|
|
218
|
+
edit the file.
|
|
219
|
+
|
|
220
|
+
## Troubleshooting
|
|
221
|
+
|
|
222
|
+
`claude4arc doctor` names the failing part. Common fixes:
|
|
223
|
+
|
|
224
|
+
| Symptom | Fix |
|
|
225
|
+
|---|---|
|
|
226
|
+
| `Arc bridge is not running` | Open Arc, and check that the claude4arc extension is on in `arc://extensions`. |
|
|
227
|
+
| `bridge socket` fails | Click the reload icon of the extension in `arc://extensions`. |
|
|
228
|
+
| `native host manifest` fails | Run `claude4arc install` again. |
|
|
229
|
+
| It stopped working after a Node upgrade | Run `claude4arc install` again: the launcher records the path to `node`. |
|
|
230
|
+
| Claude does not use the tool | Start a new Claude Code session, and check that `~/.claude/skills/claude4arc` exists. |
|
|
231
|
+
|
|
232
|
+
## Update
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
npm install -g github:nesetkab/claude4arc # or: git pull, in a clone
|
|
236
|
+
claude4arc install
|
|
237
|
+
claude4arc reload-extension
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
With the plugin, also run `claude plugin update claude4arc@claude4arc`.
|
|
241
|
+
|
|
242
|
+
The project was first called `arc-browser`. If you installed it under that
|
|
243
|
+
name, run `npm rm -g arc-browser` once, then the steps above. `install`
|
|
244
|
+
removes the old `~/.claude/skills/arc-browser` link.
|
|
245
|
+
|
|
246
|
+
## Tests
|
|
247
|
+
|
|
248
|
+
Unit tests need no browser and run in CI on every push:
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
npm test # unit tests
|
|
252
|
+
npm run check # syntax check of every script
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
The end-to-end tests drive real browser tabs against local fixture pages:
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
npm run test:e2e # all scenarios in Arc, fixtures on 127.0.0.1:8811-8812
|
|
259
|
+
node tests/run.js iframe -v # filter by name, print each command and its time
|
|
260
|
+
CLAUDE4ARC_BROWSER=chromium npm run test:e2e # run them in another browser
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
## Uninstall
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
claude4arc uninstall
|
|
267
|
+
npm uninstall -g claude4arc
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
Then remove the claude4arc extension in `arc://extensions`. To also delete
|
|
271
|
+
the task records, logs, and screenshots, run `rm -rf ~/.arc-bridge`.
|
|
272
|
+
|
|
273
|
+
## License
|
|
274
|
+
|
|
275
|
+
[MIT](LICENSE)
|