claude-code - 💡(How to fix) Fix Cloud environment "Environment variables" aren't available to the Setup script

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…

Error Message

Summary: In Claude Code on the web, variables set in a cloud environment's Environment variables panel are empty inside the Setup script — they're only injected once the session is running. Both fields sit in the same "Update cloud environment" dialog with no hint they run in different contexts, and it fails silently (empty value, no error). mytool init "$MYTOOL_API_KEY" # empty here → confusing downstream auth error The downstream tool fails with an auth error that gives no hint the real cause is a missing variable. 2. If intentional, warn in the dialog and document the supported way to pass a setup-time secret (e.g. CLAUDE_ENV_FILE).

Code Example

#!/bin/bash
   echo "FOO=[$FOO]"

---

curl -fsSL https://example.com/install.sh | sh
mytool init "$MYTOOL_API_KEY"   # empty here → confusing downstream auth error
RAW_BUFFERClick to expand / collapse

Summary: In Claude Code on the web, variables set in a cloud environment's Environment variables panel are empty inside the Setup script — they're only injected once the session is running. Both fields sit in the same "Update cloud environment" dialog with no hint they run in different contexts, and it fails silently (empty value, no error).

Repro:

  1. Environment variables panel → add FOO=bar → Save.
  2. Setup script:
    #!/bin/bash
    echo "FOO=[$FOO]"
  3. Start a session.

Expected FOO=[bar]; actual FOO=[].

Impact: The standard "install a CLI, then authenticate with a key from an env var" pattern breaks silently:

curl -fsSL https://example.com/install.sh | sh
mytool init "$MYTOOL_API_KEY"   # empty here → confusing downstream auth error

The downstream tool fails with an auth error that gives no hint the real cause is a missing variable.

Asks (any one):

  1. Inject panel env vars into the setup script (like GitHub Actions / Codespaces do); or
  2. If intentional, warn in the dialog and document the supported way to pass a setup-time secret (e.g. CLAUDE_ENV_FILE).

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

claude-code - 💡(How to fix) Fix Cloud environment "Environment variables" aren't available to the Setup script