claude-cac 1.0.0 → 1.1.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
@@ -1,14 +1,19 @@
1
1
  <div align="center">
2
2
 
3
- # cac — Claude Code Cloak
3
+ # :umbrella: cac
4
4
 
5
- **Privacy Cloak + CLI Proxy for Claude Code**
5
+ **Claude Code 小雨伞** Isolate, protect, and manage your Claude Code.
6
6
 
7
- **[中文](#中文) | [English](#english)**
7
+ *Run Claude Code your way — isolated, protected, managed.*
8
8
 
9
+ **[中文](#中文) | [English](#english) | [:book: Docs](https://cac.nextmind.space/docs)**
10
+
11
+ [![GitHub stars](https://img.shields.io/github/stars/nmhjklnm/cac?style=social)](https://github.com/nmhjklnm/cac)
12
+ [![Docs](https://img.shields.io/badge/Docs-cac.nextmind.space-D97706.svg)](https://cac.nextmind.space/docs)
9
13
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
10
- [![Platform](https://img.shields.io/badge/Platform-macOS%20%7C%20Linux-lightgrey.svg)]()
11
- [![Shell](https://img.shields.io/badge/Shell-Bash-green.svg)]()
14
+ [![Platform](https://img.shields.io/badge/Platform-macOS%20%7C%20Linux%20%7C%20Windows-lightgrey.svg)]()
15
+
16
+ :star: Star this repo if it helps — it helps others find it too.
12
17
 
13
18
  </div>
14
19
 
@@ -20,127 +25,173 @@
20
25
 
21
26
  > **[Switch to English](#english)**
22
27
 
23
- ### 为什么需要 cac
28
+ ### 简介
24
29
 
25
- Claude Code 在运行过程中会读取并上报设备标识符(硬件 UUID、安装 ID、网络出口 IP 等)。cac 通过 wrapper 机制拦截所有 `claude` 调用,在进程层面同时解决两个问题:
30
+ **cac** 是 Claude Code 的环境管理器,类似 uv 之于 Python:
26
31
 
27
- **A. 隐私隔离**每个配置对外呈现独立的设备身份,彻底隔离真实设备指纹。
32
+ - **版本管理**安装、切换、回滚 Claude Code 版本
33
+ - **环境隔离** — 每个环境独立的 `.claude` 配置 + 身份 + 代理
34
+ - **隐私保护** — 设备指纹伪装 + 遥测阻断 + mTLS
35
+ - **零配置** — 无需 setup,首次使用自动初始化
28
36
 
29
- **B. CLI 专属代理** — 进程级注入代理,`claude` 流量直连远端代理服务器。无需 Clash / Shadowrocket 等本地代理工具,无需中转,无需起本地服务端。配合静态住宅 IP,获得固定、干净的出口身份。
37
+ ### 安装
30
38
 
31
- ### 特性一览
39
+ ```bash
40
+ # npm(推荐)
41
+ npm install -g claude-cac
32
42
 
33
- | | 特性 | 说明 |
34
- |:---|:---|:---|
35
- | **A** | 硬件 UUID 隔离 | macOS: 拦截 `ioreg` / Linux: 拦截 `machine-id` |
36
- | **A** | hostname / MAC 隔离 | 拦截 `hostname` 和 `ifconfig` 命令 |
37
- | **A** | stable_id / userID 隔离 | 切换配置时自动写入独立标识 |
38
- | **A** | 时区 / 语言伪装 | 根据代理出口地区自动匹配 |
39
- | **A** | NS 层级遥测拦截 | DNS guard 拦截 `statsig.anthropic.com` 等遥测域名 |
40
- | **A** | 12 层环境变量保护 | 全面禁用遥测、错误上报、非必要流量 |
41
- | **A** | fetch 遥测拦截 | 替换原生 fetch,防止绕过 DNS 拦截 |
42
- | **A** | mTLS 客户端证书 | 自签 CA + 每环境独立客户端证书 |
43
- | **B** | 进程级代理 | 支持 HTTP/HTTPS/SOCKS5 代理 |
44
- | **B** | 免本地服务端 | 无需 Clash / Shadowrocket / TUN,CLI 直连 |
45
- | **B** | 静态住宅 IP 支持 | 配置固定代理 → 固定出口 IP |
46
- | **B** | 启动前连通检测 | 代理不可达时拒绝启动,真实 IP 零泄漏 |
47
- | **B** | 本地代理冲突检测 | `cac check` 自动检测 Clash/TUN 冲突 |
43
+ # 或手动安装
44
+ curl -fsSL https://raw.githubusercontent.com/nmhjklnm/cac/master/install.sh | bash
45
+ ```
48
46
 
49
- 所有 `claude` 调用(含 Agent 子进程)均通过 wrapper 拦截。零入侵 Claude Code 源代码。
47
+ ### 快速上手
50
48
 
51
- ### 安装
49
+ ```bash
50
+ # 安装 Claude Code
51
+ cac claude install latest
52
52
 
53
- **一键安装(推荐):**
53
+ # 创建环境
54
+ cac env create work -p 1.2.3.4:1080:u:p -c latest
54
55
 
55
- ```bash
56
- curl -fsSL https://raw.githubusercontent.com/nmhjklnm/cac/master/install.sh | bash
56
+ # 激活
57
+ cac work
58
+
59
+ # 启动 Claude Code(首次需 /login)
60
+ claude
57
61
  ```
58
62
 
59
- **手动安装:**
63
+ 代理可选 — 不需要代理也能用:
60
64
 
61
65
  ```bash
62
- git clone https://github.com/nmhjklnm/cac.git
63
- cd cac
64
- bash install.sh
66
+ cac env create personal # 只要身份隔离
67
+ cac env create work -c 2.1.81 # 指定版本,无代理
65
68
  ```
66
69
 
67
- 安装完成后重开终端,或执行 `source ~/.zshrc`。
68
-
69
- ### 使用
70
+ ### 版本管理
70
71
 
71
72
  ```bash
72
- # 添加配置
73
- cac add us1 1.2.3.4:1080:username:password
74
- cac add us2 "socks5://username:password@1.2.3.4:1080"
75
-
76
- # 切换配置
77
- cac us1
73
+ cac claude install latest # 安装最新版
74
+ cac claude install 2.1.81 # 安装指定版本
75
+ cac claude ls # 列出已安装版本
76
+ cac claude pin 2.1.81 # 当前环境切换版本
77
+ cac claude uninstall 2.1.81 # 卸载
78
+ ```
78
79
 
79
- # 检查状态(含代理冲突检测)
80
- cac check
80
+ ### 环境管理
81
81
 
82
- # 启动 Claude Code
83
- claude
82
+ ```bash
83
+ cac env create <name> [-p <proxy>] [-c <version>] [--type local|container]
84
+ cac env ls # 列出所有环境
85
+ cac env rm <name> # 删除环境
86
+ cac <name> # 激活环境(快捷方式)
87
+ cac ls # = cac env ls
84
88
  ```
85
89
 
86
- 首次使用需在 Claude Code 内执行 `/login` 完成账号登录。
90
+ 每个环境完全隔离:
91
+ - **Claude Code 版本** — 不同环境可以用不同版本
92
+ - **`.claude` 配置** — sessions、settings、memory 各自独立
93
+ - **身份信息** — UUID、hostname、MAC 等完全不同
94
+ - **代理出口** — 每个环境走不同代理(或不走代理)
87
95
 
88
- ### 命令
96
+ ### 全部命令
89
97
 
90
98
  | 命令 | 说明 |
91
99
  |:---|:---|
92
- | `cac add <名字> <host:port:u:p>` | 添加配置 |
93
- | `cac <名字>` | 切换配置,刷新所有隐私参数 |
94
- | `cac ls` | 列出所有配置 |
95
- | `cac check` | 检查代理 + 安全防护 + 冲突检测 |
96
- | `cac stop` | 临时停用保护 |
97
- | `cac -c` | 恢复保护 |
100
+ | **版本管理** | |
101
+ | `cac claude install [latest\|<ver>]` | 安装 Claude Code |
102
+ | `cac claude uninstall <ver>` | 卸载版本 |
103
+ | `cac claude ls` | 列出已安装版本 |
104
+ | `cac claude pin <ver>` | 当前环境绑定版本 |
105
+ | **环境管理** | |
106
+ | `cac env create <name> [-p proxy] [-c ver]` | 创建环境 |
107
+ | `cac env ls` | 列出环境 |
108
+ | `cac env rm <name>` | 删除环境 |
109
+ | `cac <name>` | 激活环境 |
110
+ | **自管理** | |
111
+ | `cac self update` | 更新 cac 自身 |
112
+ | **其他** | |
113
+ | `cac ls` | 列出环境(= `cac env ls`) |
114
+ | `cac check` | 检查当前环境 |
115
+ | `cac relay on\|off\|status` | 本地中转(绕过 TUN) |
116
+ | `cac stop` / `cac resume` | 暂停 / 恢复保护 |
117
+ | `cac delete` | 卸载 cac |
118
+ | `cac -v` | 版本号 |
119
+
120
+ ### 代理格式
121
+
122
+ ```
123
+ host:port:user:pass 带认证(自动检测协议)
124
+ host:port 无认证
125
+ socks5://u:p@host:port 指定协议
126
+ ```
127
+
128
+ ### 隐私保护
129
+
130
+ | 特性 | 实现方式 |
131
+ |:---|:---|
132
+ | 硬件 UUID 隔离 | macOS `ioreg` / Linux `machine-id` / Windows `wmic`+`reg` shim |
133
+ | 主机名 / MAC 隔离 | Shell shim + Node.js `os.hostname()` / `os.networkInterfaces()` hook |
134
+ | Node.js 指纹钩子 | `fingerprint-hook.js` 通过 `NODE_OPTIONS --require` 注入 |
135
+ | 遥测阻断 | DNS guard + 12 层环境变量 + fetch 拦截 + HOSTALIASES |
136
+ | 健康检查 bypass | 本地 HTTPS server + `/etc/hosts` + `NO_PROXY` |
137
+ | mTLS 客户端证书 | 自签 CA + 每环境独立客户端证书 |
138
+ | `.claude` 配置隔离 | 每个环境独立的 `CLAUDE_CONFIG_DIR` |
98
139
 
99
140
  ### 工作原理
100
141
 
101
142
  ```
102
- cac wrapper (进程级,零入侵源代码)
103
- ┌──────────────────────────────────────┐
104
- claude ──────►│ 12 层环境变量遥测保护 │──── 直连远端代理 ────► Anthropic API
105
- NODE_OPTIONS --require DNS guard (静态住宅 IP)
106
- PATH 前置 shim(设备指纹隔离)
107
- mTLS 客户端证书注入 │
108
- 启动前代理连通性检测
109
- └──────────────────────────────────────┘
110
- dns.lookup / net.connect / fetch 遥测拦截
111
- ↑ macOS: ioreg/hostname/ifconfig shim
112
- ↑ Linux: cat/hostname/ifconfig shim
143
+ cac wrapper(进程级,零侵入源代码)
144
+ ┌──────────────────────────────────────────┐
145
+ claude ────►│ CLAUDE_CONFIG_DIR 隔离配置目录 │
146
+ 版本解析 ~/.cac/versions/<ver>/claude
147
+ 健康检查 bypass(本地 HTTPS server)
148
+ 12 层遥测环境变量保护 │──► 代理 ──► Anthropic API
149
+ NODE_OPTIONS: DNS guard + 指纹钩子
150
+ │ PATH: 设备指纹 shim │
151
+ │ mTLS: 客户端证书注入 │
152
+ └──────────────────────────────────────────┘
113
153
  ```
114
154
 
115
155
  ### 文件结构
116
156
 
117
157
  ```
118
158
  ~/.cac/
119
- ├── bin/claude # wrapper(拦截所有 claude 调用)
120
- ├── shim-bin/ # ioreg / hostname / ifconfig / cat shim
121
- ├── cac-dns-guard.js # NS 层级 DNS 拦截 + mTLS 注入 + fetch 补丁
122
- ├── blocked_hosts # HOSTALIASES 遥测域名拦截(备用层)
123
- ├── ca/ # mTLS 自签 CA 证书
124
- ├── real_claude # 真实 claude 二进制路径
125
- ├── current # 当前激活的配置名
159
+ ├── versions/<ver>/claude # Claude Code 二进制文件
160
+ ├── bin/claude # wrapper
161
+ ├── shim-bin/ # ioreg / hostname / ifconfig / cat shim
162
+ ├── fingerprint-hook.js # Node.js 指纹拦截
163
+ ├── cac-dns-guard.js # DNS + fetch 遥测拦截
164
+ ├── ca/ # 自签 CA + 健康检查 bypass 证书
165
+ ├── current # 当前激活的环境名
126
166
  └── envs/<name>/
127
- ├── proxy # 代理地址
128
- ├── uuid / stable_id / user_id # 独立身份标识
129
- ├── machine_id / hostname / mac_address # 独立设备指纹
130
- ├── client_cert.pem / client_key.pem # mTLS 客户端证书
131
- └── tz / lang # 时区 / 语言
167
+ ├── .claude/ # 隔离的 .claude 配置目录
168
+ ├── proxy # 代理地址(可选)
169
+ ├── version # 绑定的 Claude Code 版本
170
+ ├── type # local / container
171
+ ├── uuid / stable_id # 隔离身份
172
+ ├── hostname / mac_address / machine_id
173
+ └── client_cert.pem # mTLS 证书
132
174
  ```
133
175
 
134
- ### 注意事项
176
+ ### Docker 容器模式
177
+
178
+ 完全隔离的运行环境:sing-box TUN 网络隔离 + cac 身份伪装,预装 Claude Code。
179
+
180
+ ```bash
181
+ cac docker setup # 粘贴代理地址,网络自动检测
182
+ cac docker start # 启动容器
183
+ cac docker enter # 进入容器,claude + cac 直接可用
184
+ cac docker check # 网络 + 身份一键诊断
185
+ cac docker port 6287 # 端口转发
186
+ ```
135
187
 
136
- > **本地代理工具共存**
137
- > 若同时使用 Clash / Shadowrocket 等 TUN 模式,需为代理服务器 IP 添加 DIRECT 规则。`cac check` 会自动检测冲突并给出修复建议。
188
+ 代理格式:`ip:port:user:pass`(SOCKS5)、`ss://...`、`vmess://...`、`vless://...`、`trojan://...`
138
189
 
139
- > **第三方 API 配置**
140
- > wrapper 启动时自动清除 `ANTHROPIC_BASE_URL` / `ANTHROPIC_AUTH_TOKEN` / `ANTHROPIC_API_KEY`。
190
+ ### 注意事项
141
191
 
142
- > **IPv6**
143
- > 建议在系统层关闭 IPv6,防止真实出口 IPv6 地址被暴露。
192
+ - **首次登录**:启动 `claude` 后,输入 `/login` 完成 OAuth 授权
193
+ - **TUN 冲突**:使用 `cac relay on` 或在 TUN 软件中为代理 IP 添加 DIRECT 规则
194
+ - **IPv6**:建议系统级关闭,防止真实地址泄露
144
195
 
145
196
  ---
146
197
 
@@ -150,100 +201,165 @@ claude
150
201
 
151
202
  > **[切换到中文](#中文)**
152
203
 
153
- ### Why cac
204
+ ### Overview
154
205
 
155
- Claude Code reads and reports device identifiers at runtime (hardware UUID, installation ID, network egress IP, etc.). cac intercepts all `claude` invocations via a wrapper, solving two problems at the process level — without modifying any Claude Code source code:
206
+ **cac** Isolate, protect, and manage your Claude Code:
156
207
 
157
- **A. Privacy Cloak** — Each profile presents an independent device identity, fully isolating your real device fingerprint.
208
+ - **Version management** — install, switch, rollback Claude Code versions
209
+ - **Environment isolation** — independent `.claude` config + identity + proxy per environment
210
+ - **Privacy protection** — device fingerprint spoofing + telemetry blocking + mTLS
211
+ - **Zero config** — no setup needed, auto-initializes on first use
158
212
 
159
- **B. CLI Proxy** — Process-level proxy injection; `claude` traffic connects directly to the remote proxy server. No Clash / Shadowrocket or any local proxy tools needed.
213
+ ### Install
160
214
 
161
- ### Features
215
+ ```bash
216
+ # npm (recommended)
217
+ npm install -g claude-cac
162
218
 
163
- | | Feature | Description |
164
- |:---|:---|:---|
165
- | **A** | Hardware UUID isolation | macOS: intercepts `ioreg` / Linux: intercepts `machine-id` |
166
- | **A** | hostname / MAC isolation | Intercepts `hostname` and `ifconfig` commands |
167
- | **A** | stable_id / userID isolation | Writes independent identifiers on profile switch |
168
- | **A** | Timezone / locale spoofing | Auto-detected from proxy exit region |
169
- | **A** | NS-level telemetry blocking | DNS guard blocks `statsig.anthropic.com` and other telemetry domains |
170
- | **A** | 12-layer env var protection | Disables telemetry, error reporting, non-essential traffic |
171
- | **A** | fetch telemetry interception | Replaces native fetch to prevent DNS interception bypass |
172
- | **A** | mTLS client certificates | Self-signed CA + per-profile client certificates |
173
- | **B** | Process-level proxy | Supports HTTP/HTTPS/SOCKS5 proxies |
174
- | **B** | No local server needed | No Clash / Shadowrocket / TUN — direct CLI connection |
175
- | **B** | Static residential IP support | Fixed proxy config = fixed egress IP |
176
- | **B** | Pre-launch connectivity check | Blocks startup if proxy unreachable — zero real IP leakage |
177
- | **B** | Local proxy conflict detection | `cac check` detects Clash/TUN conflicts automatically |
219
+ # or manual
220
+ curl -fsSL https://raw.githubusercontent.com/nmhjklnm/cac/master/install.sh | bash
221
+ ```
178
222
 
179
- All `claude` invocations (including Agent subprocesses) are intercepted. Zero invasion of Claude Code source code.
223
+ ### Quick start
180
224
 
181
- ### Installation
225
+ ```bash
226
+ # Install Claude Code
227
+ cac claude install latest
182
228
 
183
- **One-line install (recommended):**
229
+ # Create environment
230
+ cac env create work -p 1.2.3.4:1080:u:p -c latest
184
231
 
185
- ```bash
186
- curl -fsSL https://raw.githubusercontent.com/nmhjklnm/cac/master/install.sh | bash
232
+ # Activate
233
+ cac work
234
+
235
+ # Run Claude Code (first time: /login)
236
+ claude
187
237
  ```
188
238
 
189
- **Manual install:**
239
+ Proxy is optional:
190
240
 
191
241
  ```bash
192
- git clone https://github.com/nmhjklnm/cac.git
193
- cd cac
194
- bash install.sh
242
+ cac env create personal # identity isolation only
243
+ cac env create work -c 2.1.81 # pinned version, no proxy
195
244
  ```
196
245
 
197
- After installation, restart your terminal or run `source ~/.zshrc`.
246
+ ### Version management
198
247
 
199
- ### Usage
248
+ ```bash
249
+ cac claude install latest # install latest
250
+ cac claude install 2.1.81 # install specific version
251
+ cac claude ls # list installed versions
252
+ cac claude pin 2.1.81 # pin current env to version
253
+ cac claude uninstall 2.1.81 # remove
254
+ ```
255
+
256
+ ### Environment management
200
257
 
201
258
  ```bash
202
- cac add us1 1.2.3.4:1080:username:password
203
- cac us1
204
- cac check # includes proxy conflict detection
205
- claude
259
+ cac env create <name> [-p <proxy>] [-c <version>] [--type local|container]
260
+ cac env ls # list all environments
261
+ cac env rm <name> # remove environment
262
+ cac <name> # activate (shortcut)
263
+ cac ls # = cac env ls
206
264
  ```
207
265
 
208
- On first use, run `/login` inside Claude Code to authenticate.
266
+ Each environment is fully isolated:
267
+ - **Claude Code version** — different envs can use different versions
268
+ - **`.claude` config** — sessions, settings, memory are independent
269
+ - **Identity** — UUID, hostname, MAC are all different
270
+ - **Proxy** — each env routes through a different proxy (or none)
209
271
 
210
- ### Commands
272
+ ### All commands
211
273
 
212
274
  | Command | Description |
213
275
  |:---|:---|
214
- | `cac add <name> <host:port:u:p>` | Add profile |
215
- | `cac <name>` | Switch profile, refresh all privacy parameters |
216
- | `cac ls` | List all profiles |
217
- | `cac check` | Check proxy + security + conflict detection |
218
- | `cac stop` | Temporarily disable protection |
219
- | `cac -c` | Re-enable protection |
276
+ | **Version management** | |
277
+ | `cac claude install [latest\|<ver>]` | Install Claude Code |
278
+ | `cac claude uninstall <ver>` | Remove version |
279
+ | `cac claude ls` | List installed versions |
280
+ | `cac claude pin <ver>` | Pin current env to version |
281
+ | **Environment management** | |
282
+ | `cac env create <name> [-p proxy] [-c ver]` | Create environment |
283
+ | `cac env ls` | List environments |
284
+ | `cac env rm <name>` | Remove environment |
285
+ | `cac <name>` | Activate environment |
286
+ | **Self-management** | |
287
+ | `cac self update` | Update cac itself |
288
+ | **Other** | |
289
+ | `cac ls` | List environments (= `cac env ls`) |
290
+ | `cac check` | Verify current environment |
291
+ | `cac relay on\|off\|status` | Local relay (bypass TUN) |
292
+ | `cac stop` / `cac resume` | Pause / resume protection |
293
+ | `cac delete` | Uninstall cac |
294
+ | `cac -v` | Show version |
295
+
296
+ ### Privacy protection
297
+
298
+ | Feature | How |
299
+ |:---|:---|
300
+ | Hardware UUID isolation | macOS `ioreg` / Linux `machine-id` / Windows `wmic`+`reg` shim |
301
+ | Hostname / MAC isolation | Shell shim + Node.js `os.hostname()` / `os.networkInterfaces()` hook |
302
+ | Node.js fingerprint hook | `fingerprint-hook.js` via `NODE_OPTIONS --require` |
303
+ | Telemetry blocking | DNS guard + 12 env vars + fetch interception + HOSTALIASES |
304
+ | Health check bypass | Local HTTPS server + `/etc/hosts` + `NO_PROXY` |
305
+ | mTLS client certificates | Self-signed CA + per-profile client certs |
306
+ | `.claude` config isolation | Per-environment `CLAUDE_CONFIG_DIR` |
220
307
 
221
- ### How It Works
308
+ ### How it works
222
309
 
223
310
  ```
224
- cac wrapper (process-level, zero source invasion)
225
- ┌──────────────────────────────────────┐
226
- claude ──────►│ 12-layer env var telemetry protection │──── Direct to remote ────► Anthropic API
227
- NODE_OPTIONS --require DNS guard (static residential)
228
- PATH-prepended shims (fingerprint)
229
- mTLS client cert injection │
230
- Pre-flight proxy check
231
- └──────────────────────────────────────┘
232
- dns.lookup / net.connect / fetch telemetry interception
233
- ↑ macOS: ioreg/hostname/ifconfig shim
234
- ↑ Linux: cat/hostname/ifconfig shim
311
+ cac wrapper (process-level, zero source invasion)
312
+ ┌──────────────────────────────────────────┐
313
+ claude ────►│ CLAUDE_CONFIG_DIR isolated config dir │
314
+ Version resolve ~/.cac/versions/<ver>
315
+ Health check bypass (local HTTPS server)
316
+ Env vars: 12-layer telemetry kill │──► Proxy ──► Anthropic API
317
+ NODE_OPTIONS: DNS guard + fingerprint
318
+ │ PATH: device fingerprint shims │
319
+ │ mTLS: client cert injection │
320
+ └──────────────────────────────────────────┘
235
321
  ```
236
322
 
237
- ### Notes
323
+ ### File layout
324
+
325
+ ```
326
+ ~/.cac/
327
+ ├── versions/<ver>/claude # Claude Code binaries
328
+ ├── bin/claude # wrapper
329
+ ├── shim-bin/ # ioreg / hostname / ifconfig / cat shims
330
+ ├── fingerprint-hook.js # Node.js fingerprint interception
331
+ ├── cac-dns-guard.js # DNS + fetch telemetry interception
332
+ ├── ca/ # self-signed CA + health bypass cert
333
+ ├── current # active environment name
334
+ └── envs/<name>/
335
+ ├── .claude/ # isolated .claude config directory
336
+ ├── proxy # proxy URL (optional)
337
+ ├── version # pinned Claude Code version
338
+ ├── type # local / container
339
+ ├── uuid / stable_id # isolated identity
340
+ ├── hostname / mac_address / machine_id
341
+ └── client_cert.pem # mTLS cert
342
+ ```
238
343
 
239
- > **Coexisting with local proxy tools**
240
- > If you also use Clash / Shadowrocket in TUN mode, add a DIRECT rule for the proxy server IP. `cac check` will detect conflicts and provide fix suggestions.
344
+ ### Docker mode
241
345
 
242
- > **Third-party API configuration**
243
- > The wrapper automatically clears `ANTHROPIC_BASE_URL` / `ANTHROPIC_AUTH_TOKEN` / `ANTHROPIC_API_KEY` on startup.
346
+ Fully isolated environment: sing-box TUN network isolation + cac identity protection, with Claude Code pre-installed.
347
+
348
+ ```bash
349
+ cac docker setup # paste proxy, network auto-detected
350
+ cac docker start # start container
351
+ cac docker enter # shell with claude + cac ready
352
+ cac docker check # network + identity diagnostics
353
+ cac docker port 6287 # port forwarding
354
+ ```
355
+
356
+ Proxy formats: `ip:port:user:pass` (SOCKS5), `ss://...`, `vmess://...`, `vless://...`, `trojan://...`
357
+
358
+ ### Notes
244
359
 
245
- > **IPv6**
246
- > It is recommended to disable IPv6 at the system level to prevent your real IPv6 egress address from being exposed.
360
+ - **First login**: Run `claude`, then type `/login`. Health check is automatically bypassed.
361
+ - **TUN conflicts**: Use `cac relay on` or add DIRECT rule in your TUN software.
362
+ - **IPv6**: Recommend disabling system-wide to prevent real address exposure.
247
363
 
248
364
  ---
249
365