# Running the claude CLI under hx Status: accepted ## Context `claude` keeps its own tools while hx supplies MCP servers through `hx mcp-serve`. Claude starts that child and hides its stderr; inside the sandbox claude needs its binary dir, config, network, and on macOS the login keychain (else "Not logged in"). ## Decision - Leaving the sandbox for claude requires an explicit stored rule (`claude:unsandboxed` in `.hx/allow.json`), is never asked for and never implied by yolo: yolo is only safe because claude's tools stay confined. - hx's MCP servers are given to claude directly, or only through `codemode` when enabled; claude sees only `hx mcp-serve` tools. A server entry that is hx itself is skipped to avoid recursive spawning. Codemode-run tools ask hx for permission like any other. - Sandbox profile includes claude's resolved install dir (versions/..) and the macOS keychain. - mcp-serve startup failures are also written to `$TMPDIR/hx-mcp-serve.log`, since the only visible symptom is "mcp__hx__approve not found". ## Consequences Sandbox escape is auditable; failures are diagnosable via the log. Code: crates/hx-cli/src/main.rs (claude unsandboxed rule, mcp_serve, claude sandbox spec, CLAUDE_CODEMODE/mcp tool config, mcp-serve log)