Skip to main content

Deleting a codespace

You can delete a codespace you no longer need.

Overview

GitHub Codespaces are automatically deleted after they have been stopped and have remained inactive for a defined number of days. The retention period for each codespace is set when the codespace is created and does not change. The default retention period is 30 days. See Configuring automatic deletion of your codespaces.

You can manually delete a codespace in a variety of ways:

  • In the terminal by using GitHub CLI
  • In Visual Studio Code
  • In your web browser

Use the tabs at the top of this article to display instructions for each of these ways of deleting a codespace.

Note

You can't delete a codespace from within JupyterLab.

Why you should delete unused codespaces

There are costs associated with storing codespaces. You should therefore delete any codespaces you no longer need. See GitHub Codespaces billing.

There are limits to the number of codespaces you can create, and the number of codespaces you can run at the same time. These limits vary based on a number of factors. If you reach the maximum number of codespaces and try to create another, a message is displayed telling you that you must remove an existing codespace before you can create a new one.

Deleting a codespace

  1. In the top-left corner of GitHub, select , then click Codespaces to take you to the "Your codespaces" page at github.com/codespaces.

  2. To the right of the codespace you want to delete, click , then click Delete.

    Screenshot of a list of codespaces with the dropdown menu for one of them displayed, showing the "Delete" option.

Note

You may have prebuild codespaces that are consuming additional storage which are not displayed on this dashboard. To delete them, follow the steps for “