Claude Code for Web: setup-script field DX makes setup failures very hard to debug
Context: Getting a uv-based Python repo's setup script working in a Claude Code for Web cloud environment took ~8 new-session iterations. Most of the round-trips were caused by undocumented execution-context behavior of the setup-script field, not the script itself. Filing as field feedback — each item below is individually minor but they compounded badly.
Issues
- The setup-script field runs under
set -e, with no indication. A command sequence that works fine interactively aborts in the field because a non-zero status mid-pipeline kills everything (e.g. awhile readloop returns 1 at EOF insidevar=$(...), which trips errexit).
- No output is shown when the field fails early / under errexit. The result was literally:
````
Setup script failed with exit code 1.
with no "Script output" section at all — zero diagnostic signal. This was by far the biggest time-sink. (Normal command failures do show output; the silent errexit case is the trap.) Please always surface captured stdout/stderr, even on early exit.
- The execution context is surprising and undocumented. The field runs with
CWD=/home/user,$HOME=/root, and the repo cloned at/home/user/<repo>— three different locations. As a result, bothbash scripts/setup.sh(relative to CWD) andbash ~/<repo>/scripts/setup.sh(HOME-anchored) fail withNo such file or directory. Please run the setup field from the repo root, or document the layout.
- There is no documented env var pointing at the checkout. I ended up auto-discovering the repo by scanning
envfor a value whose directory contained the script. A documented$REPO_DIR/$WORKSPACE-style variable would make setup scripts trivial.
- Egress blocks
astral.sh(HTTP 403) while allowinggithub.com,objects.githubusercontent.com,pypi.org, andfiles.pythonhosted.org. The officialuvinstaller (https://astral.sh/uv/<ver>/install.sh) fails; pulling theuvbinary from GitHub Releases works. The allowlist is undocumented and the inconsistency is surprising — please document the exact allowlist (or allowastral.sh).
- Every iteration requires a brand-new session with a full cold setup (re-download Python + ~240 packages, re-clone git deps). An in-place re-run / faster debug loop for the setup script would help a lot.
Net
Individually small, but together these turned "point the environment at a working setup script" into a multi-hour, ~8-session loop — mostly spent guessing at undocumented context because failures produced no output. Fixing #2 (always show output) and #3/#4 (normalize/document the context + expose a repo-path var) would remove most of the pain.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗