Over the weekend, I received a couple of emails I was running out of GitHub Codespaces storage. My limit is 20GB, but more interesting is that I rarely use codespaces.
The last time I used Codespaces was about a year ago, but I couldn’t remember which repository it was. I tried to check a couple of repositories but without success.
When reaching out to GitHub and following the documentation, I found out how to best find all of your old Codespace instances.
Finding your old Codespaces
To find your old Codespaces, you must first go to your Billing and plans page, which you find under your settings.
You will see a Codespaces status, but this does not return the instances. For that, you have to generate a usage report.
You can create a usage report by clicking on the Get usage report button and selecting the date range of your preference. I went for the last seven days.
In the report, you will see the old Codespace instances.
Deleting your old Codespaces
Now the only thing to do is delete these instances. With the report, you get the repository slug. Use the slug to your GitHub repo, where you can find the Codespace.
Delete the Codespace, and you are done.
important Repeat these steps for your old Codespaces, which you do not use anymore.