claude-code-on-the-web.md +193 −51
20* **Repositories not on your local machine**: Work on code you don't have checked out locally20* **Repositories not on your local machine**: Work on code you don't have checked out locally
21* **Backend changes**: Where Claude Code can write tests and then write code to pass those tests21* **Backend changes**: Where Claude Code can write tests and then write code to pass those tests
22 22
2323Claude Code is also available on the Claude iOS app for kicking off tasks on the go and monitoring work in progress.Claude Code is also available on the Claude app for [iOS](https://apps.apple.com/us/app/claude-by-anthropic/id6473753684) and [Android](https://play.google.com/store/apps/details?id=com.anthropic.claude) for kicking off tasks on the go and monitoring work in progress.
24 24
2525You can move between local and remote development: [send tasks from your terminal to run on the web](#from-terminal-to-web) with the `&` prefix, or [teleport web sessions back to your terminal](#from-web-to-terminal) to continue locally.You can [kick off new tasks on the web from your terminal](#from-terminal-to-web) with `--remote`, or [teleport web sessions back to your terminal](#from-web-to-terminal) to continue locally. To use the web interface while running Claude Code on your own machine instead of cloud infrastructure, see [Remote Control](/en/remote-control).
26 26
27## Who can use Claude Code on the web?27## Who can use Claude Code on the web?
28 28
30 30
31* **Pro users**31* **Pro users**
32* **Max users**32* **Max users**
3333* **Team premium seat users*** **Team users**
3434* **Enterprise premium seat users*** **Enterprise users** with premium seats or Chat + Claude Code seats
35 35
36## Getting started36## Getting started
37 37
38Set up Claude Code on the web from the browser or from your terminal.
39
40### From the browser
41
381. Visit [claude.ai/code](https://claude.ai/code)421. Visit [claude.ai/code](https://claude.ai/code)
392. Connect your GitHub account432. Connect your GitHub account
40443. Install the Claude GitHub app in your repositories3. Install the Claude GitHub App in your repositories
414. Select your default environment454. Select your default environment
425. Submit your coding task465. Submit your coding task
436. Review changes in diff view, iterate with comments, then create a pull request476. Review changes in diff view, iterate with comments, then create a pull request
44 48
49### From the terminal
50
51Run `/web-setup` inside Claude Code to connect GitHub using your local `gh` CLI credentials. The command syncs your `gh auth token` to Claude Code on the web, creates a default cloud environment, and opens claude.ai/code in your browser when it finishes.
52
53This path requires the `gh` CLI to be installed and authenticated with `gh auth login`. If `gh` is not available, `/web-setup` opens claude.ai/code so you can connect GitHub from the browser instead.
54
55Your `gh` credentials give Claude access to clone and push, so you can skip the GitHub App for basic sessions. Install the App later if you want [Auto-fix](#auto-fix-pull-requests), which uses the App to receive PR webhooks.
56
57<Note>
58 Team and Enterprise admins can disable terminal setup with the Quick web setup toggle at [claude.ai/admin-settings/claude-code](https://claude.ai/admin-settings/claude-code).
59</Note>
60
45## How it works61## How it works
46 62
47When you start a task on Claude Code on the web:63When you start a task on Claude Code on the web:
48 64
491. **Repository cloning**: Your repository is cloned to an Anthropic-managed virtual machine651. **Repository cloning**: Your repository is cloned to an Anthropic-managed virtual machine
50662. **Environment setup**: Claude prepares a secure cloud environment with your code2. **Environment setup**: Claude prepares a secure cloud environment with your code, then runs your [setup script](#setup-scripts) if configured
513. **Network configuration**: Internet access is configured based on your settings673. **Network configuration**: Internet access is configured based on your settings
524. **Task execution**: Claude analyzes code, makes changes, runs tests, and checks its work684. **Task execution**: Claude analyzes code, makes changes, runs tests, and checks its work
535. **Completion**: You're notified when finished and can create a PR with the changes695. **Completion**: You're notified when finished and can create a PR with the changes
67 83
68This lets you refine changes through multiple rounds of feedback without creating draft PRs or switching to GitHub.84This lets you refine changes through multiple rounds of feedback without creating draft PRs or switching to GitHub.
69 85
7086## Moving tasks between web and terminal## Auto-fix pull requests
71 87
7288You can start tasks on the web and continue them in your terminal, or send tasks from your terminal to run on the web. Web sessions persist even if you close your laptop, and you can monitor them from anywhere including the Claude iOS app.Claude can watch a pull request and automatically respond to CI failures and review comments. Claude subscribes to GitHub activity on the PR, and when a check fails or a reviewer leaves a comment, Claude investigates and pushes a fix if one is clear.
73 89
74<Note>90<Note>
7591 Session handoff is one-way: you can pull web sessions into your terminal, but you can't push an existing terminal session to the web. The [`&` prefix](#from-terminal-to-web) creates a *new* web session with your current conversation context. Auto-fix requires the Claude GitHub App to be installed on your repository. If you haven't already, install it from the [GitHub App page](https://github.com/apps/claude) or when prompted during [setup](#getting-started).
76</Note>92</Note>
77 93
7894### From terminal to webThere are a few ways to turn on auto-fix depending on where the PR came from and what device you're using:
79 95
8096Start a message with `&` inside Claude Code to send a task to run on the web:* **PRs created in Claude Code on the web**: open the CI status bar and select **Auto-fix**
97* **From the mobile app**: tell Claude to auto-fix the PR, for example "watch this PR and fix any CI failures or review comments"
98* **Any existing PR**: paste the PR URL into a session and tell Claude to auto-fix it
81 99
82100```### How Claude responds to PR activity
83101& Fix the authentication bug in src/auth/login.ts
84102```When auto-fix is active, Claude receives GitHub events for the PR including new review comments and CI check failures. For each event, Claude investigates and decides how to proceed:
103
104* **Clear fixes**: if Claude is confident in a fix and it doesn't conflict with earlier instructions, Claude makes the change, pushes it, and explains what was done in the session
105* **Ambiguous requests**: if a reviewer's comment could be interpreted multiple ways or involves something architecturally significant, Claude asks you before acting
106* **Duplicate or no-action events**: if an event is a duplicate or requires no change, Claude notes it in the session and moves on
107
108Claude may reply to review comment threads on GitHub as part of resolving them. These replies are posted using your GitHub account, so they appear under your username, but each reply is labeled as coming from Claude Code so reviewers know it was written by the agent and not by you directly.
109
110<Warning>
111 If your repository uses comment-triggered automation such as Atlantis, Terraform Cloud, or custom GitHub Actions that run on `issue_comment` events, be aware that Claude can reply on your behalf, which can trigger those workflows. Review your repository's automation before enabling auto-fix, and consider disabling auto-fix for repositories where a PR comment can deploy infrastructure or run privileged operations.
112</Warning>
113
114## Moving tasks between web and terminal
115
116You can start new tasks on the web from your terminal, or pull web sessions into your terminal to continue locally. Web sessions persist even if you close your laptop, and you can monitor them from anywhere including the Claude mobile app.
117
118<Note>
119 Session handoff is one-way: you can pull web sessions into your terminal, but you can't push an existing terminal session to the web. The `--remote` flag creates a *new* web session for your current repository.
120</Note>
85 121
86122This creates a new web session on claude.ai with your current conversation context. The task runs in the cloud while you continue working locally. Use `/tasks` to check progress, or open the session on claude.ai or the Claude iOS app to interact directly. From there you can steer Claude, provide feedback, or answer questions just like any other conversation.### From terminal to web
87 123
88124You can also start a web session directly from the command line:Start a web session from the command line with the `--remote` flag:
89 125
90```bash theme={null}126```bash theme={null}
91claude --remote "Fix the authentication bug in src/auth/login.ts"127claude --remote "Fix the authentication bug in src/auth/login.ts"
92```128```
93 129
94130#### Tips for background tasksThis creates a new web session on claude.ai. The task runs in the cloud while you continue working locally. Use `/tasks` to check progress, or open the session on claude.ai or the Claude mobile app to interact directly. From there you can steer Claude, provide feedback, or answer questions just like any other conversation.
95 131
96132**Plan locally, execute remotely**: For complex tasks, start Claude in plan mode to collaborate on the approach before sending work to the web:#### Tips for remote tasks
133
134**Plan locally, execute remotely**: For complex tasks, start Claude in plan mode to collaborate on the approach, then send work to the web:
97 135
98```bash theme={null}136```bash theme={null}
99claude --permission-mode plan137claude --permission-mode plan
100```138```
101 139
102140In plan mode, Claude can only read files and explore the codebase. Once you're satisfied with the plan, send it to the web for autonomous execution:In plan mode, Claude can only read files and explore the codebase. Once you're satisfied with the plan, start a remote session for autonomous execution:
103 141
104142``````bash theme={null}
105143& Execute the migration plan we discussedclaude --remote "Execute the migration plan in docs/migration-plan.md"
106```144```
107 145
108This pattern gives you control over the strategy while letting Claude execute autonomously in the cloud.146This pattern gives you control over the strategy while letting Claude execute autonomously in the cloud.
109 147
110148**Run tasks in parallel**: Each `&` command creates its own web session that runs independently. You can kick off multiple tasks and they'll all run simultaneously in separate sessions:**Plan in the cloud with ultraplan**: To draft and review the plan itself in a web session, use [ultraplan](/en/ultraplan). Claude generates the plan on Claude Code on the web while you keep working, then you comment on sections in your browser and choose to execute remotely or send the plan back to your terminal.
111 149
112150```**Run tasks in parallel**: Each `--remote` command creates its own web session that runs independently. You can kick off multiple tasks and they'll all run simultaneously in separate sessions:
113151& Fix the flaky test in auth.spec.ts
114152& Update the API documentation```bash theme={null}
115153& Refactor the logger to use structured outputclaude --remote "Fix the flaky test in auth.spec.ts"
154claude --remote "Update the API documentation"
155claude --remote "Refactor the logger to use structured output"
116```156```
117 157
118Monitor all sessions with `/tasks`. When a session completes, you can create a PR from the web interface or [teleport](#from-web-to-terminal) the session to your terminal to continue working.158Monitor all sessions with `/tasks`. When a session completes, you can create a PR from the web interface or [teleport](#from-web-to-terminal) the session to your terminal to continue working.
139| Branch available | The branch from the web session must have been pushed to the remote. Teleport automatically fetches and checks it out. |179| Branch available | The branch from the web session must have been pushed to the remote. Teleport automatically fetches and checks it out. |
140| Same account | You must be authenticated to the same Claude.ai account used in the web session. |180| Same account | You must be authenticated to the same Claude.ai account used in the web session. |
141 181
182### Sharing sessions
183
184To share a session, toggle its visibility according to the account
185types below. After that, share the session link as-is. Recipients who open your
186shared session will see the latest state of the session upon load, but the
187recipient's page will not update in real time.
188
189#### Sharing from an Enterprise or Team account
190
191For Enterprise and Team accounts, the two visibility options are **Private**
192and **Team**. Team visibility makes the session visible to other members of your
193Claude.ai organization. Repository access verification is enabled by default,
194based on the GitHub account connected to the recipient's account. Your account's
195display name is visible to all recipients with access. [Claude in Slack](/en/slack)
196sessions are automatically shared with Team visibility.
197
198#### Sharing from a Max or Pro account
199
200For Max and Pro accounts, the two visibility options are **Private**
201and **Public**. Public visibility makes the session visible to any user logged
202into claude.ai.
203
204Check your session for sensitive content before sharing. Sessions may contain
205code and credentials from private GitHub repositories. Repository access
206verification is not enabled by default.
207
208Enable repository access verification and/or withhold your name from your shared
209sessions by going to Settings > Claude Code > Sharing settings.
210
211## Schedule recurring tasks
212
213Run Claude on a recurring schedule to automate work like daily PR reviews, dependency audits, and CI failure analysis. See [Schedule tasks on the web](/en/web-scheduled-tasks) for the full guide.
214
215## Managing sessions
216
217### Archiving sessions
218
219You can archive sessions to keep your session list organized. Archived sessions are hidden from the default session list but can be viewed by filtering for archived sessions.
220
221To archive a session, hover over the session in the sidebar and click the archive icon.
222
223### Deleting sessions
224
225Deleting a session permanently removes the session and its data. This action cannot be undone. You can delete a session in two ways:
226
227* **From the sidebar**: Filter for archived sessions, then hover over the session you want to delete and click the delete icon
228* **From the session menu**: Open a session, click the dropdown next to the session title, and select **Delete**
229
230You will be asked to confirm before a session is deleted.
231
142## Cloud environment232## Cloud environment
143 233
144### Default image234### Default image
187 277
188When you start a session in Claude Code on the web, here's what happens under the hood:278When you start a session in Claude Code on the web, here's what happens under the hood:
189 279
1902801. **Environment preparation**: We clone your repository and run any configured Claude hooks for initialization. The repo will be cloned with the default branch on your GitHub repo. If you would like to check out a specific branch, you can specify that in the prompt.1. **Environment preparation**: We clone your repository and run any configured [setup script](#setup-scripts). The repo will be cloned with the default branch on your GitHub repo. If you would like to check out a specific branch, you can specify that in the prompt.
191 281
1922. **Network configuration**: We configure internet access for the agent. Internet access is limited by default, but you can configure the environment to have no internet or full internet access based on your needs.2822. **Network configuration**: We configure internet access for the agent. Internet access is limited by default, but you can configure the environment to have no internet or full internet access based on your needs.
193 283
199 Claude operates entirely through the terminal and CLI tools available in the environment. It uses the pre-installed tools in the universal image and any additional tools you install through hooks or dependency management.289 Claude operates entirely through the terminal and CLI tools available in the environment. It uses the pre-installed tools in the universal image and any additional tools you install through hooks or dependency management.
200</Note>290</Note>
201 291
202292**To add a new environment:** Select the current environment to open the environment selector, and then select "Add environment". This will open a dialog where you can specify the environment name, network access level, and any environment variables you want to set.**To add a new environment:** Select the current environment to open the environment selector, and then select "Add environment". This will open a dialog where you can specify the environment name, network access level, environment variables, and a [setup script](#setup-scripts).
203 293
204294**To update an existing environment:** Select the current environment, to the right of the environment name, and select the settings button. This will open a dialog where you can update the environment name, network access, and environment variables.**To update an existing environment:** Select the current environment, to the right of the environment name, and select the settings button. This will open a dialog where you can update the environment name, network access, environment variables, and setup script.
205 295
206296**To select your default environment from the terminal:** If you have multiple environments configured, run `/remote-env` to choose which one to use when starting web sessions from your terminal with `&` or `--remote`. With a single environment, this command shows your current configuration.**To select your default environment from the terminal:** If you have multiple environments configured, run `/remote-env` to choose which one to use when starting web sessions from your terminal with `--remote`. With a single environment, this command shows your current configuration.
207 297
208<Note>298<Note>
209 Environment variables must be specified as key-value pairs, in [`.env` format](https://www.dotenv.org/). For example:299 Environment variables must be specified as key-value pairs, in [`.env` format](https://www.dotenv.org/). For example:
210 300
211301 ``` ```text theme={null}
212 API_KEY=your_api_key302 API_KEY=your_api_key
213 DEBUG=true303 DEBUG=true
214 ```304 ```
215</Note>305</Note>
216 306
307### Setup scripts
308
309A setup script is a Bash script that runs when a new cloud session starts, before Claude Code launches. Use setup scripts to install dependencies, configure tools, or prepare anything the cloud environment needs that isn't in the [default image](#default-image).
310
311Scripts run as root on Ubuntu 24.04, so `apt install` and most language package managers work.
312
313<Tip>
314 To check what's already installed before adding it to your script, ask Claude to run `check-tools` in a cloud session.
315</Tip>
316
317To add a setup script, open the environment settings dialog and enter your script in the **Setup script** field.
318
319This example installs the `gh` CLI, which isn't in the default image:
320
321```bash theme={null}
322#!/bin/bash
323apt update && apt install -y gh
324```
325
326Setup scripts run only when creating a new session. They are skipped when resuming an existing session.
327
328If the script exits non-zero, the session fails to start. Append `|| true` to non-critical commands to avoid blocking the session on a flaky install.
329
330<Note>
331 Setup scripts that install packages need network access to reach registries. The default network access allows connections to [common package registries](#default-allowed-domains) including npm, PyPI, RubyGems, and crates.io. Scripts will fail to install packages if your environment has network access disabled.
332</Note>
333
334#### Setup scripts vs. SessionStart hooks
335
336Use a setup script to install things the cloud needs but your laptop already has, like a language runtime or CLI tool. Use a [SessionStart hook](/en/hooks#sessionstart) for project setup that should run everywhere, cloud and local, like `npm install`.
337
338Both run at the start of a session, but they belong to different places:
339
340| | Setup scripts | SessionStart hooks |
341| ------------- | ------------------------------------------------- | -------------------------------------------------------------- |
342| Attached to | The cloud environment | Your repository |
343| Configured in | Cloud environment UI | `.claude/settings.json` in your repo |
344| Runs | Before Claude Code launches, on new sessions only | After Claude Code launches, on every session including resumed |
345| Scope | Cloud environments only | Both local and cloud |
346
347SessionStart hooks can also be defined in your user-level `~/.claude/settings.json` locally, but user-level settings don't carry over to cloud sessions. In the cloud, only hooks committed to the repo run.
348
217### Dependency management349### Dependency management
218 350
219351Configure automatic dependency installation using [SessionStart hooks](/en/hooks#sessionstart). This can be configured in your repository's `.claude/settings.json` file:Custom environment images and snapshots are not yet supported. Use [setup scripts](#setup-scripts) to install packages when a session starts, or [SessionStart hooks](/en/hooks#sessionstart) for dependency installation that should also run in local environments. SessionStart hooks have [known limitations](#dependency-management-limitations).
352
353To configure automatic dependency installation with a setup script, open your environment settings and add a script:
354
355```bash theme={null}
356#!/bin/bash
357npm install
358pip install -r requirements.txt
359```
360
361Alternatively, you can use SessionStart hooks in your repository's `.claude/settings.json` file for dependency installation that should also run in local environments:
220 362
221```json theme={null}363```json theme={null}
222{364{
240 382
241```bash theme={null}383```bash theme={null}
242#!/bin/bash384#!/bin/bash
243npm install
244pip install -r requirements.txt
245exit 0
246```
247 385
248386Make it executable: `chmod +x scripts/install_pkgs.sh`# Only run in remote environments
249
250#### Local vs remote execution
251
252By default, all hooks execute both locally and in remote (web) environments. To run a hook only in one environment, check the `CLAUDE_CODE_REMOTE` environment variable in your hook script.
253
254```bash theme={null}
255#!/bin/bash
256
257# Example: Only run in remote environments
258if [ "$CLAUDE_CODE_REMOTE" != "true" ]; then387if [ "$CLAUDE_CODE_REMOTE" != "true" ]; then
259 exit 0388 exit 0
260fi389fi
261 390
262npm install391npm install
263pip install -r requirements.txt392pip install -r requirements.txt
393exit 0
264```394```
265 395
266396#### Persisting environment variablesMake it executable: `chmod +x scripts/install_pkgs.sh`
397
398#### Persist environment variables
399
400SessionStart hooks can persist environment variables for subsequent Bash commands by writing to the file specified in the `CLAUDE_ENV_FILE` environment variable. For details, see [SessionStart hooks](/en/hooks#sessionstart) in the hooks reference.
401
402#### Dependency management limitations
267 403
268404SessionStart hooks can persist environment variables for subsequent bash commands by writing to the file specified in the `CLAUDE_ENV_FILE` environment variable. For details, see [SessionStart hooks](/en/hooks#sessionstart) in the hooks reference.* **Hooks fire for all sessions**: SessionStart hooks run in both local and remote environments. There is no hook configuration to scope a hook to remote sessions only. To skip local execution, check the `CLAUDE_CODE_REMOTE` environment variable in your script as shown above.
405* **Requires network access**: Install commands need network access to reach package registries. If your environment is configured with "No internet" access, these hooks will fail. Use "Limited" (the default) or "Full" network access. The [default allowlist](#default-allowed-domains) includes common registries like npm, PyPI, RubyGems, and crates.io.
406* **Proxy compatibility**: All outbound traffic in remote environments passes through a [security proxy](#security-proxy). Some package managers do not work correctly with this proxy. Bun is a known example.
407* **Runs on every session start**: Hooks run each time a session starts or resumes, adding startup latency. Keep install scripts fast by checking whether dependencies are already present before reinstalling.
269 408
270## Network access and security409## Network access and security
271 410
301 440
302* api.anthropic.com441* api.anthropic.com
303* statsig.anthropic.com442* statsig.anthropic.com
304443* docs.claude.com* platform.claude.com
305* code.claude.com444* code.claude.com
306* claude.ai445* claude.ai
307 446
437* gradle.org576* gradle.org
438* [www.gradle.org](http://www.gradle.org)577* [www.gradle.org](http://www.gradle.org)
439* services.gradle.org578* services.gradle.org
579* plugins.gradle.org
580* kotlin.org
581* [www.kotlin.org](http://www.kotlin.org)
440* spring.io582* spring.io
441* repo.spring.io583* repo.spring.io
442 584
565## Limitations707## Limitations
566 708
567* **Repository authentication**: You can only move sessions from web to local when you are authenticated to the same account709* **Repository authentication**: You can only move sessions from web to local when you are authenticated to the same account
568710* **Platform restrictions**: Claude Code on the web only works with code hosted in GitHub. GitLab and other non-GitHub repositories cannot be used with cloud sessions* **Platform restrictions**: Claude Code on the web only works with code hosted in GitHub. Self-hosted [GitHub Enterprise Server](/en/github-enterprise-server) instances are supported for Team and Enterprise plans. GitLab and other non-GitHub repositories cannot be used with cloud sessions
569 711
570## Best practices712## Best practices
571 713
5727141. **Use Claude Code hooks**: Configure [SessionStart hooks](/en/hooks#sessionstart) to automate environment setup and dependency installation.1. **Automate environment setup**: Use [setup scripts](#setup-scripts) to install dependencies and configure tools before Claude Code launches. For more advanced scenarios, configure [SessionStart hooks](/en/hooks#sessionstart).
5732. **Document requirements**: Clearly specify dependencies and commands in your `CLAUDE.md` file. If you have an `AGENTS.md` file, you can source it in your `CLAUDE.md` using `@AGENTS.md` to maintain a single source of truth.7152. **Document requirements**: Clearly specify dependencies and commands in your `CLAUDE.md` file. If you have an `AGENTS.md` file, you can source it in your `CLAUDE.md` using `@AGENTS.md` to maintain a single source of truth.
574 716
575## Related resources717## Related resources