claude-code - 💡(How to fix) Fix Claude Code for Web: setup-script field DX makes setup failures very hard to debug

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

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.

Code Example

Setup script failed with exit code 1.
RAW_BUFFERClick to expand / collapse

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

  1. 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. a while read loop returns 1 at EOF inside var=$(...), which trips errexit).

  2. 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.

  3. 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, both bash scripts/setup.sh (relative to CWD) and bash ~/<repo>/scripts/setup.sh (HOME-anchored) fail with No such file or directory. Please run the setup field from the repo root, or document the layout.

  4. There is no documented env var pointing at the checkout. I ended up auto-discovering the repo by scanning env for a value whose directory contained the script. A documented $REPO_DIR / $WORKSPACE-style variable would make setup scripts trivial.

  5. Egress blocks astral.sh (HTTP 403) while allowing github.com, objects.githubusercontent.com, pypi.org, and files.pythonhosted.org. The official uv installer (https://astral.sh/uv/<ver>/install.sh) fails; pulling the uv binary from GitHub Releases works. The allowlist is undocumented and the inconsistency is surprising — please document the exact allowlist (or allow astral.sh).

  6. 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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING