Skip to main content

Opening an existing codespace

You can reopen a codespace that you have closed or stopped and return to your work.

Note

GitHub Codespaces is not available on subdomains of GHE.com, such as octocorp.ghe.com.

You can reopen any of your active or stopped codespaces on GitHub, in Visual Studio Code, or by using GitHub CLI. You can't reopen a codespace that has been deleted. See Understanding the codespace lifecycle.

You can view all your codespaces on the "Your codespaces" page at github.com/codespaces. From this page, you can:

Reopening an existing codespace

If you have installed GitHub CLI, you can use it to work with GitHub Codespaces. For installation instructions for GitHub CLI, see the GitHub CLI repository.

  1. In a terminal, enter one of the following GitHub CLI commands.

    • To open a codespace in VS Code, enter:

      Shell
      gh codespace code
      

      Note

      You must have VS Code installed on your local machine. See Setting up Visual Studio Code in the VS Code documentation.

    • To open a codespace in the browser, enter:

      Shell
      gh codespace code --web
      
    • To open a codespace in JupyterLab, enter:

      Shell
      gh codespace jupyter
      

      Note

      The JupyterLab application must be installed in the codespace you are opening. The default dev container image includes JupyterLab, so codespaces created from the default image will always have JupyterLab installed. For more information about the default image, see Introduction to dev containers and the devcontainers/images repository. If you're not using the default image in your dev container configuration, you can install JupyterLab by adding the ghcr.io/devcontainers/features/python feature to your devcontainer.json file. You should include the option "installJupyterlab": true. For more information, see the README for the python feature, in the devcontainers/features repository.

    • To access a codespace from the command line, over SSH, enter:

      Shell
      gh codespace ssh
      
  2. Using the arrow keys, navigate to the codespace that you want to open.

  3. To open the codespace, press Enter.

See gh codespace code in the GitHub CLI manual.

Further reading