Repository navigation
Commit 4002862
feat(anthropic): enforce --safe-mode on all claude-cli subprocess launches
OpenClaw manages its own skills, CLAUDE.md, memory, and hooks. Any
user-level Claude Code customizations on the host are redundant and can
silently interfere with OpenClaw-managed sessions — injecting unexpected
context, skills, or hook side-effects into turns that OpenClaw controls.
This mirrors how --setting-sources user is already enforced: added to the
default args in cli-backend.ts and enforced unconditionally via a new
normalizeClaudeSafeModeArgs normalizer in cli-shared.ts, which is wired
into the normalizeClaudeBackendConfig pipeline for both fresh and resumed
sessions. Even if a user removes --safe-mode from their
agents.defaults.cliBackends.claude-cli config override, normalization
re-applies it.
Requires Claude Code CLI >= 2.1.169 (2026-06-08), which introduced
--safe-mode / CLAUDE_CODE_SAFE_MODE.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>1 parent 706132c commit 4002862
2 files changed
Lines changed: 15 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| 50 | + | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
168 | 169 | | |
169 | 170 | | |
170 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
171 | 182 | | |
172 | 183 | | |
173 | 184 | | |
| |||
177 | 188 | | |
178 | 189 | | |
179 | 190 | | |
180 | | - | |
| 191 | + | |
181 | 192 | | |
182 | | - | |
| 193 | + | |
183 | 194 | | |
184 | 195 | | |
185 | 196 | | |
| |||
0 commit comments