GitHub Codespaces: what happens when you create and stop one
Answer: You can connect to your codespaces from your browser, from Visual Studio Code, or by using GitHub CLI. When you connect, you are placed within the Docker container, with limited access to the outer Linux virtual machine host. (S1)
Creating and setting up
- There are a number of entry points to create a codespace. (S2)
- Your codespace can be ephemeral if you need to test something, or you can return to the same codespace for long-running feature work. (S2)
- When you create a codespace, various steps happen in the background before the codespace is available to you. (S2)
- Once you are connected, your automated setup may continue to build based on the configuration in your devcontainer.json file, so you may see postCreateCommand and postAttachCommand run. (S2)
- If you want to use Git hooks in your codespace, set up hooks using the devcontainer.json lifecycle scripts, such as postCreateCommand. (S2)
Saving, stopping and ports
- If you work on codespaces in Visual Studio Code, you can enable Auto Save to ensure that your changes are always saved. (S2)
- If a codespace times out it will stop running, but you can restart it from the browser tab, from within VS Code, or from your list of codespaces. (S2)
- When you close or stop your codespace, all uncommitted changes are preserved until you connect to the codespace again. (S2)
- Port forwarding gives you access to TCP ports running within your codespace. (S2)
Claims
- id: C1 claim: You connect to codespaces from a browser, VS Code, or GitHub CLI. source: S1 evidence: "You can connect to your codespaces from your browser"
- id: C2 claim: When you connect you are placed inside the Docker container. source: S1 evidence: "When you connect, you are placed within the Docker container."
- id: C3 claim: Uncommitted changes are preserved when a codespace is stopped. source: S2 evidence: "all uncommitted changes are preserved until you connect to the codespace again."
- id: C4 claim: Port forwarding exposes TCP ports running in the codespace. source: S2 evidence: "Port forwarding gives you access to TCP ports running within your codespace."
Sources
- [S1] What are GitHub Codespaces? - GitHub Docs. GitHub Docs. https://docs.github.com/en/codespaces/about-codespaces/what-are-codespaces . License: CC BY 4.0 (github/docs). Accessed 2026-11-04.
- [S2] Deep dive into GitHub Codespaces - GitHub Docs. GitHub Docs. https://docs.github.com/en/codespaces/about-codespaces/deep-dive . License: CC BY 4.0 (github/docs). Accessed 2026-11-04.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: GitHub Docs, What are GitHub Codespaces? - GitHub Docs, CC BY 4.0 (github/docs); GitHub Docs, Deep dive into GitHub Codespaces - GitHub Docs, CC BY 4.0 (github/docs).
Cite this
iinventedlight. 2026. "GitHub Codespaces: what happens when you create and stop one." iinventedlight Library, iil:note:g2t996jd, version of 2026-11-04. https://iinventedlight.com/library/notes/github-codespaces/. License: CC-BY-4.0.
@misc{iil_note_g2t996jd,
author = {{iinventedlight}},
title = {{GitHub Codespaces: what happens when you create and stop one}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-04},
url = {https://iinventedlight.com/library/notes/github-codespaces/},
note = {Permanent ID iil:note:g2t996jd. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.
For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/github-codespaces.md.