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

Note

To use GitHub Codespaces in VS Code, you need to install the Codespaces extension. See Using GitHub Codespaces in Visual Studio Code.

  1. In the VS Code desktop application, open the Command Palette with Command+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux).

  2. Type "Codespaces" and select one of the following commands.

    • To open a codespace in a new window of VS Code, select Codespaces: Open Codespace in New Window
    • To open a codespace in the web editor, select Codespaces: Open in Browser
  3. Click the codespace that you want to open.

    Screenshot of the VS Code Command Palette showing a list of codespaces available to connect to.

You can also access the commands listed above by navigating to the Remote Explorer view in VS Code and right-clicking the codespace that you want to open.

Screenshot of a codespace selected in the Remote Explorer, with "Open in Browser" highlighted in the right-click menu.

Note

If the Remote Explorer is not displayed in the Activity Bar:

  1. Access the Command Palette. For example, by pressing Shift+Command+P (Mac) / Ctrl+Shift+P (Windows/Linux).
  2. Type: details.
  3. Click Codespaces: Details.

Linking to an existing codespace

You can create links to your existing codespaces. This is useful if you have a long-lived codespace that you return to frequently. You can save the link in a location of your choice, as an alternative to using the link on https://github.com/codespaces.

Note

You can only open your own codespaces. If someone clicks a link to one of your codespaces they will see a 404 error message.

Create a link using one of the following URL patterns. In these URLs CODESPACE-NAME represents the unique, permanent name of the codespace, such as literate-space-parakeet-w5vg5ww5p793g7g9, not the codespace's display name. You can find the name of a codespace by copying the link to the codespace on your https://github.com/codespaces page and extracting the codespace name from the URL.

Link opens inLink syntax
VS Code web clienthttps://CODESPACE-NAME.github.dev
VS Code web client with a specified workspacehttps://CODESPACE-NAME.github.dev?folder=/workspaces/PATH/TO/WORKSPACE/DIRECTORY
VS Code desktop applicationhttps://github.com/codespaces/CODESPACE-NAME?editor=vscode
JupyterLabhttps://github.com/codespaces/CODESPACE-NAME?editor=jupyter

Further reading