Hatch environments are isolated workspaces, and hatch shell enters the default one
Answer: Hatch environments are isolated workspaces for testing, docs builds, or other project work. If you do not pick an environment, Hatch uses default. hatch shell starts a shell in that environment. Type exit to leave it.
Choosing and entering
hatch shell is the command that spawns a shell inside the environment. Dependencies you add are installed the next time you spawn a shell or run a command.
Scripts and location
You can define scripts on an environment and ask Hatch where that environment's Python lives.
Claims
- id: C1 claim: Hatch environments are isolated workspaces for testing and other project work. source: S1 evidence: "isolated workspaces for testing, building documentation"
- id: C2 claim: Hatch uses the default environment unless one is chosen explicitly. source: S1 evidence: "Hatch will use the
defaultenvironment"
- id: C3 claim: hatch shell opens a shell in an environment. source: S1 evidence: "You can spawn a [shell]"
- id: C4 claim: The website documents the same default-environment rule. source: S2 evidence: "default"
Sources
- [S1] Hatch environments intro. pypa/hatch (GitHub). https://github.com/pypa/hatch/blob/master/docs/environment.md . License: MIT. Accessed 2026-11-18.
- [S2] Hatch environments (website). Hatch (hatch.pypa.io). https://hatch.pypa.io/latest/environment/ . License: MIT. Accessed 2026-11-18.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: pypa/hatch (GitHub), Hatch environments intro, MIT (https://raw.githubusercontent.com/pypa/hatch/master/LICENSE.txt); Hatch (hatch.pypa.io), Hatch environments (website), MIT (https://raw.githubusercontent.com/pypa/hatch/master/LICENSE.txt). Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: pypa/hatch (GitHub), Hatch environments intro, MIT (https://raw.githubusercontent.com/pypa/hatch/master/LICENSE.txt); Hatch (hatch.pypa.io), Hatch environments (website), MIT (https://raw.githubusercontent.com/pypa/hatch/master/LICENSE.txt).
Cite this
iinventedlight. 2026. "Hatch environments are isolated workspaces, and hatch shell enters the default one." iinventedlight Library, iil:note:mdf131x9, version of 2026-11-18. https://iinventedlight.com/library/notes/hatch-environments/. License: CC-BY-4.0.
@misc{iil_note_mdf131x9,
author = {{iinventedlight}},
title = {{Hatch environments are isolated workspaces, and hatch shell enters the default one}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-18},
url = {https://iinventedlight.com/library/notes/hatch-environments/},
note = {Permanent ID iil:note:mdf131x9. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/hatch-environments.md.