跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

提交记录
修改README.md+2 −2看文件
@@ -71,8 +71,8 @@ agent-vm vibe # Mistral Vibe
7171Creates a persistent VM for the current directory (or reuses it if one already exists), mounts your working directory, and runs the agent with full permissions. The VM persists after the agent exits so you can reconnect later. Ports opened inside the VM (e.g. by Docker containers or dev servers) are automatically forwarded to your host by Lima.
7272
7373Each agent runs with its respective auto-approve flag:
74删除:- `claude` runs with `--dangerously-skip-permissions`
75删除:- `opencode` does not yet have an auto-approve flag (waiting on [this PR](https://github.com/anomalyco/opencode/pull/11833))
74新增:- `claude` runs with `--dangerously-skip-permissions`, and the VM also enforces bypass mode via managed settings (`/etc/claude-code/managed-settings.json`) so autonomy survives Claude Code's self-update/fullscreen relaunches — which otherwise drop the CLI flag ([#72479](https://github.com/anthropics/claude-code/issues/72479))
75新增:- `opencode` runs with `--auto` (auto-approves permission prompts that aren't explicitly denied)
7676- `codex` runs with `--dangerously-bypass-approvals-and-sandbox`
7777- `vibe` runs with `--agent auto-approve`
7878
修改agent-vm.setup.sh+20 −0看文件
@@ -144,6 +144,26 @@ if [[ "$INSTALL_CLAUDE" == "1" ]]; then
144144 curl -fsSL https://claude.ai/install.sh | bash
145145 echo 'export PATH=$HOME/.claude/local/bin:$PATH' >> ~/.zshrc
146146 echo 'export PATH=$HOME/.claude/local/bin:$PATH' >> ~/.zshenv
147新增:
148新增: # Enforce full autonomy via *managed* settings (highest precedence), not the
149新增: # user's ~/.claude/. A user can bind-mount or overwrite their own ~/.claude/
150新增: # dir freely; this system-level policy is untouched and always wins.
151新增: #
152新增: # Why not just rely on the `claude --dangerously-skip-permissions` launch flag:
153新增: # Claude Code relaunches itself in-process on self-update and on the first-run
154新增: # fullscreen-TUI opt-in, and the relaunched process drops the CLI flag (see
155新增: # https://github.com/anthropics/claude-code/issues/72479), reverting to the
156新增: # "ask" permission mode. Settings are re-read on every (re)launch, so encoding
157新增: # the policy here makes it survive those relaunches. `tui: fullscreen` also
158新增: # pins fullscreen from the first launch, so the opt-in relaunch never fires.
159新增: echo "Configuring Claude managed settings (bypass permissions + fullscreen)..."
160新增: sudo mkdir -p /etc/claude-code
161新增: cat << 'JSON' | sudo tee /etc/claude-code/managed-settings.json > /dev/null
162新增:{
163新增: "permissions": { "defaultMode": "bypassPermissions" },
164新增: "tui": "fullscreen"
165新增:}
166新增:JSON
147167fi
148168
149169if [[ "$INSTALL_OPENCODE" == "1" ]]; then
修改agent-vm.sh+4 −3看文件
@@ -1160,10 +1160,11 @@ _agent_vm_opencode() {
11601160 _agent_vm_ensure_running "$vm_name" "$host_dir" "${vm_opts[@]}" || return 1
11611161 _agent_vm_print_resources "$vm_name"
11621162
1163删除: # TODO: add --dangerously-skip-permissions once released
1164删除: # (waiting on https://github.com/anomalyco/opencode/pull/11833)
1163新增: # --auto auto-approves permission prompts that aren't explicitly denied,
1164新增: # giving full autonomy (safe inside the sandbox). This is OpenCode's shipped
1165新增: # equivalent of a "yolo" mode; the proposed --yolo flag was never merged.
11651166 local exit_code=0
1166删除: limactl shell --tty --workdir "$host_dir" "$vm_name" opencode "${args[@]}"
1167新增: limactl shell --tty --workdir "$host_dir" "$vm_name" opencode --auto "${args[@]}"
11671168 exit_code=$?
11681169 [[ -n "$rm" ]] && { echo "Removing VM..."; _agent_vm_destroy; }
11691170 return $exit_code