← All notes

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

Sources

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

Permanent ID: iil:note:mdf131x9

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.},
}

Markdown

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.