Expand description
Live environment - git context, cwd insights, OS-side observations the agent needs but the SDK doesn’t.
Distinct from userdata (on-disk Claude state) and cloud
(network-side talk to api.anthropic.com): env is local-machine
state about the project the user is working on right now.
Modules§
- cli_
version - Detect the installed
claudeCLI version and (when reachable) the latest published version on npm. - config_
watch - A watch on exactly one file -
forge.toml- so an edit reaches a running forge without a restart. - documents
- The document read: one file from a session’s tree, bounded, as bytes with a kind.
- file_
index - File-index walker + filesystem watcher for the user’s project
tree. Speaks the language of paths,
ignore::WalkBuilderwalks, andnotify::Watcherevents; produces typed snapshots and change batches without knowing anything about session routing. - git_
command - The shared constructor every production
git/ghspawn goes through. - git_
diff - Git diff scanner - on-demand
gitsubprocess invocations that produce aGitDiffSnapshotdescribing the project’s current changeset. - git_
state - The working tree as a handoff brief reads it: branch,
HEAD, the dirty paths and the diff’s stat. - lsp_
path - Whether a declared LSP server binary resolves on PATH.
- processes
- OS-level process introspection for the Inspector pane’s PROCESSES section.
- timezone
- The host’s local IANA timezone, resolved dynamically, and the wall clock an RFC-3339 timestamp reads as in it. A generic OS-env probe shared by the usage scan’s day-bucketing, the SCHEDULES schedule formatter and the turn rows a view draws from a transcript.
- token_
usage - Token/cost accounting for the
usagesubject. - worktree
- Git-worktree helpers for the worker spawn and despawn paths: detecting a repo, reading a worktree’s branch, deciding whether a worktree is safe to remove, removing it, and reaping the branch behind it.
Functions§
- is_
content_ 🔒change - Whether an event kind can change a watched path’s content. A read cannot, and it matters: on inotify a read of a watched path is itself an event, so a watcher that reacts to one feeds itself.