ClaudeEnvironment

The environment that a claude process starts with: the environment of this process, less the API key and the session-nesting markers of a parent Claude Code session.

Group libllmsession

In the namespace octomy::llmsession. Declared in src/libs/libllmsession/llmsession/ClaudeEnvironment.hpp.

Detailed description

The third-party claude program decides its billing and its session-nesting from these variables, and reads nothing else for them. So a child environment is the only channel (no-environment-variables §NEV-A2a):

  • Without ANTHROPIC_API_KEY, Claude Code bills the subscription of the machine, not the API (§TD-2).
  • A HUB that a Claude Code session started inherits that session's nesting markers. A claude that believes that it is a nested child writes no transcript of its own (verified on 2026-07-09). A session of this tree is never a child of what started the HUB.
  • The folder of the trove tool of this install comes first on PATH, so that a session finds the tool that reaches the door of its own HUB (trove-parts §TPC-5).

It was a part of the terminal driver until the PTY transport retired (trove-parts phase 8). Every claude process of the tree starts with it: the stream transport, the version probe, the model list, the spec triage and the spec apply of a lane.

The environment is a utility::process::ChildEnvironment.

In this section