Cloud sessions (`/ultraplan` handoff) die on first turn with generic "An error occurred while executing Claude Code" when repo-tracked settings enable sandbox with `failIfUnavailable: true`

Status Open
Reported on v2.1.198
Maintainer reply None cached
Activity 0 comments · opened Jul 18, 2026

What's wrong?

/ultraplan cloud sessions on claude.ai/code initialize fine (container ✅, repository cloned ✅, Claude Code started ✅) and then die instantly on the first turn — zero assistant output, zero tool calls — with the generic banner:

An error occurred while executing Claude Code. You can try again by sending a new message or starting a new session.

The CLI side reports error_during_execution. Manually resuming the same session from the browser (re-sending the plan as a message) works, and tools then run fine.

Root cause (established by A/B over our own commit history)

Our repo's tracked .claude/settings.json contains:

"sandbox": {
  "enabled": true,
  "failIfUnavailable": true,
  "allowUnsandboxedCommands": false,
  "filesystem": { "denyRead": ["~/", "/mnt"], "allowRead": ["."] }
}

Cloud sessions inherit this from the fresh clone. Correlation across ~13 sessions and 3 time windows is 100%, with window boundaries matching our two commits to the minute:

| Window | sandbox block in tracked settings | /ultraplan outcome |
|---|---|---|
| ≤ Jul 6, 21:39 CEST | present | 4 runs died on turn 1 |
| Jul 6 21:39 → Jul 11 21:17 (we removed the block) | absent | 6 sessions fully working from turn 1 (Bash commands executed in cloud, subagents launched, plans proposed) |
| ≥ Jul 11, 21:17 (we restored the block) | present | every run dies on turn 1 (e.g. session_01UckHhrdBHx9aJyLh9CkbYX, Jul 18) |

No other config element correlates: our PreToolUse hooks were only added Jul 12 (failures predate them, and the working window partially contains them — none fire on turn 1 anyway), there is no tracked .mcp.json, and the cloud environment was identical throughout (no setup script, default network).

Workaround (in place on our side)

Environment setup script that writes a local-scope override before Claude Code starts (we cannot remove the sandbox block from tracked settings — it is the security boundary of our headless/unattended clone subsystem):

set -eu
cd "${CLAUDE_PROJECT_DIR:-$PWD}"
test -d .git
mkdir -p .claude
printf '%s\n' '{"sandbox":{"enabled":false}}' > .claude/settings.local.json
python3 -m json.tool .claude/settings.local.json >/dev/null
printf 'FCN cloud local settings written: %s\n' "$(pwd)/.claude/settings.local.json"

Verified working (Jul 18, same day): with this setup script in place, the same repo that previously died on turn 1 completed a full remote-plan run — first turn survived, the override was present and honored in the clone (cat .claude/settings.local.json{"sandbox":{"enabled":false}}, gitignored), CLAUDE_CODE_REMOTE=true, and every probe command executed normally.

Environment

  • Claude Code 2.1.198 (CLI launcher), claude.ai Max account
  • Launcher host: Ubuntu 24.04 VPS (headless, tmux)
  • Cloud: claude.ai/code, default environment, no setup script at failure time, default network access

Possibly related

#78363 and #75328 report the same generic error with zero output for cloud routines — a different entry path (CCR), possibly the same opaque-error class.

What Should Happen?

Either the cloud VM supports the configured sandbox (and the session runs), or sandbox settings should be ignored / soft-failed in cloud with a visible warning — not an opaque first-turn crash. At minimum, please surface the real error: the banner plus error_during_execution give no clue, and we lost ~10 runs over 3 weeks before finding the cause via git archaeology.

Error Messages/Logs

Web UI banner (first turn, zero output):
"An error occurred while executing Claude Code. You can try again by sending a new message or starting a new session."

Steps to Reproduce

  1. Repo's tracked .claude/settings.json contains the sandbox block quoted in

"What's Wrong?" (enabled + failIfUnavailable: true).

  1. Start any claude.ai/code cloud session on that repo (e.g. /ultraplan <prompt>

from the CLI).

  1. Init completes fine (container, repo clone, Claude Code start: all green).
  2. First turn dies instantly with the generic banner, zero output/tool calls;

CLI side shows error_during_execution. Reproduced on ~13 sessions.
Removing the block from tracked settings — or overriding it via environment
setup script writing .claude/settings.local.json = {"sandbox":{"enabled":false}}
— makes the same repo work from turn 1 (see A/B table above).

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.198 (Claude Code)

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Warp

Additional Information

<img width="1816" height="1135" alt="Image" src="https://github.com/user-attachments/assets/e5947f7c-946d-4bd6-88e8-60f541dfd5d3" />

View original on GitHub ↗