Feature: Pin cloud environment to repository

Status Closed — duplicate
Maintainer reply None cached
Activity 1 comment · opened Aug 5, 2026 · closed Aug 20, 2026

Problem

When starting a Claude Code session or fanning out an agent to the cloud, the cloud environment defaults to the last-used one globally, not the one configured for the current repository. This breaks multi-repo workflows:

  1. Session start: Select repo A → forget to also pick environment → defaults to last-used environment (probably from repo B) → wrong setup, have to backtrack
  2. Agent fan-out: Agent spawns cloud work → also defaults to last-used environment → wrong setup

Both workflows need the same fix.

Desired behavior

Respect a per-repository cloud environment preference. When a user:

  • Opens Claude Code and selects repo A
  • Or an agent fans out work to the cloud for repo A

...the cloud should default to the environment pinned to repo A, not the last-used global default.

Suggested implementation

Store environment preference in .claude/settings.json:

{
  "cloudEnvironment": "<environment-name>"
}

This preference should be respected at both entry points:

  1. Session start (when selecting a repo in the UI)
  2. Agent fan-out (when an agent spawns a new cloud session)

Impact

  • Reduces friction in multi-repo workflows
  • Eliminates the "wrong environment" surprise when fanning out agents
  • Makes cloud environment setup a one-time per-repo config, not a per-session decision

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗