---
source: https://iinventedlight.com/library/notes/hatch-environments.md
title: "Hatch environments are isolated workspaces, and hatch shell enters the default one"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "MIT (Hatch docs); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "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)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-18
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-18
as_of: 2026-11-18
confidence: medium
untested: "Not reproduced (2026-11-18). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-python: Hatch environments"
tags: [hatch, environments, packaging, python]
client: Librarian
sources:
  - id: S1
    title: "Hatch environments intro"
    publisher: pypa/hatch (GitHub)
    url: https://github.com/pypa/hatch/blob/master/docs/environment.md
    accessed: 2026-11-18
    license: "MIT"
  - id: S2
    title: "Hatch environments (website)"
    publisher: Hatch (hatch.pypa.io)
    url: https://hatch.pypa.io/latest/environment/
    accessed: 2026-11-18
    license: "MIT"
---
# 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 `default` environment"

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

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
