anthropics / anthropics/claude-code
[BUG] Cloud session started from the Desktop app has no `gh` CLI, although the cloud-environments docs list `gh` as pre-installed
- Dominant language
- Python
- Stars
- 145k
- Forks
- 23.1k
- PR merge metrics
- PR metrics pending
Description
## Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet. The closest matches (#73782, #72933) are about the GitHub proxy returning 403, not about `gh` being absent from the image.
- [x] This is a single bug report. The proxy 403 that co-occurred in the same session is already tracked in #73782 / #72933 and is included below only as context.
- [x] I am using the latest version of Claude Code. The cloud container runs whatever the service provisions; `claude --version` inside it reports 2.1.259.
## What's Wrong?
The cloud-environments docs list `gh` as a pre-installed utility and describe using it through the `proxy-injected` token:
> **Utilities** | git, gh, jq, yq, ripgrep, tmux, vim, nano
> — https://code.claude.com/docs/en/cloud-environments#installed-tools
> GitHub's `gh` CLI is pre-installed. If you need a `gh` command the built-in tools don't cover, like `gh release` or `gh workflow run`, ask Claude to run it. `gh` reads `GH_TOKEN` automatically, so you don't need to run `gh auth login`.
> — https://code.claude.com/docs/en/cloud-environments#work-with-github-issues-and-pull-requests
In a cloud session started from the Claude Desktop app (Code tab, Environment = Cloud, default Anthropic-hosted environment), `gh` does not exist anywhere in the container:
- `which gh` / `command -v gh` print nothing
- a filesystem-wide `find` for a file named `gh` (excluding `/proc`, `/sys`, `node_modules`) returns only `/usr/share/X11/xkb/symbols/gh`
- `dpkg -l` has no `gh` package and there is no apt source for `cli.github.com`
Everything else in the Installed tools table is present (`check-tools` runs, `/opt/node20`–`/opt/node22`, jq, yq, ripgrep, tmux, docker, psql), so this is the documented standard image (`ANT_IMAGE_REPOSITORY=sandbox-ccr-default`) minus `gh`.
The harness system prompt in the session also tells the agent: "You do NOT have access to the `gh` CLI, `hub` CLI, or direct GitHub API access. Instead, use the GitHub MCP server tools". So the omission looks deliberate for this session flavour, but the docs promise the opposite. The GitHub MCP server cannot edit or dismiss a submitted pull-request review or edit a comment, which is exactly the kind of gap the docs say `gh` is there to cover.
## What Should Happen?
One of:
- `gh` is present in the cloud image, as the docs state, and works through the `proxy-injected` `GH_TOKEN` placeholder; or
- the Installed tools table and the "Work with GitHub issues and pull requests" section say that `gh` is not available in sessions started from the Desktop app (or whichever session flavour this is), and that the GitHub MCP server is the only route.
## Error Messages/Logs
```shell
$ which gh; command -v gh; echo "exit=$?"
exit=1
$ find / -xdev \( -path /proc -o -path /sys -o -path '*/node_modules' \) -prune -o -type f -name gh -print
/usr/share/X11/xkb/symbols/gh
$ dpkg -l | awk '$2=="gh"'
(no output)
$ grep -rl cli.github.com /etc/apt
(no output)
$ command -v check-tools; ls -d /opt/node*
/usr/local/bin/check-tools
/opt/node20 /opt/node21 /opt/node22
$ echo "$GH_TOKEN"
proxy-injected
$ claude --version
2.1.259 (Claude Code)
# session markers (no identifiers)
CLAUDE_CODE_REMOTE=true
CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE=cloud_default
CLAUDE_CODE_ENTRYPOINT=remote_desktop
CLAUDE_CODE_DISABLE_BUILTIN_ANTMCP=1
CLAUDE_CODE_REMOTE_HERMETIC_MODE=0
CLAUDE_CODE_USE_CCR_V2=true
ANT_IMAGE_REPOSITORY=sandbox-ccr-default
CLAUDE_CODE_ENVIRONMENT_RUNNER_VERSION=release-0b91c7974-ext
CLAUDE_CODE_VERSION=2.1.42 # env var; the binary itself reports 2.1.259
OS: Ubuntu 24.04.4 LTS
```
## Steps to Reproduce
1. In the Claude Desktop app, open the Code tab and start a new session with **Environment** set to **Cloud** (default Anthropic-hosted environment) and any GitHub repository as the project. The environment used here allowed all domains, so network access level is not the cause.
2. Ask Claude to run `which gh; echo $GH_TOKEN; check-tools | head -20`.
3. Observe: `which gh` prints nothing, `GH_TOKEN` is `proxy-injected`, and `check-tools` runs and lists the other documented tools.
4. Compare with https://code.claude.com/docs/en/cloud-environments#installed-tools, which lists `gh` under Utilities.
## Claude Model
Not applicable (environment/tooling issue).
## Is this a regression?
Yes, this worked in a previous version. Earlier cloud sessions started from the web had `gh` available. I don't have the exact version.
## Last Working Version
Unknown.
## Claude Code Version
2.1.259 (Claude Code), as provisioned in the cloud container.
## Platform
Anthropic API (claude.ai subscription, Anthropic-hosted cloud environment).
## Operating System
Container: Ubuntu 24.04.4 LTS. Session launched from the Claude Desktop app.
## Terminal/Shell
Other: Claude Desktop app, Code tab, cloud session.
## Additional Information
**Related and already tracked (context only).** In the same session the GitHub proxy also refused every `/repos///...` REST call for the session's own attached source repository, while `/user` and `/rate_limit` succeeded with the account's credentials. This is the same symptom as #73782 and #72933, so it is not refiled here, but the data point may help triage: the session was started from the Desktop app, GitHub is connected through the Claude GitHub App (Connectors shows it connected and the app is installed on the org), and the GitHub MCP server could read from and write to the same repository without trouble.
| request through the proxy | result |
| --- | --- |
| `GET /rate_limit` | 200, core limit 5000 |
| `GET /user` | 200, correct login |
| `GET /repos//` (the attached source repo) | 403 |
| `GET /repos///pulls/N` | 403 |
| `GET /repos///pulls/N/reviews` | 403 |
| `GET /repos///issues/N/comments` | 403 |
403 body:
```
{"message":"GitHub access is not enabled for this session. An org admin must connect the Claude GitHub App for this organization.","documentation_url":"https://docs.anthropic.com/en/docs/claude-code/github-actions"}
```
The docs' GitHub proxy section (https://code.claude.com/docs/en/cloud-environments#github-proxy) says "GitHub API and release-asset requests reach only repositories attached to the session", and this repository was attached. So even with `gh` installed it would fail on the same gate; both halves need to line up for the documented "ask Claude to run `gh ...`" workflow to work.
Also, `add_repo` in that session refused to attach a repository from a different owner ("cross-tier adds are not supported in v1"), which is why this report was filed from a separate session. That matches #78277.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the Desktop cloud session with `which gh`, `check-tools`, and the `cloud-environments#installed-tools` and GitHub workflow documentation sections. Trace the `sandbox-ccr-default` image and `cloud_default` session entry point to determine whether `gh` is omitted by provisioning; done means the documented tool availability and the actual image behavior agree.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github, ubuntu
- Domain
- cloud, devops, documentation
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100