Skip to main content

Module session_state

Module session_state 

Source
Expand description

Per-session workspace-mode state: which repo a roaming/detached Claude Code session is currently bound to. Persisted outside any repo so it survives a session that changes directories. Set by tracevault repo switch (sub-plan B); read by stream/commands as a resolution fallback.

Structs§

ProjectBinding
A resolved binding to a registered project.
RepoBinding
A resolved binding to a registered repo.
SessionState
Session-level active binding plus per-worktree subagent overrides (keyed by the subagent’s git worktree toplevel path — design §7).

Enums§

ForceStatus
What a ProjectBinding::forced_until currently says about its force.

Functions§

force_status
Classify a stored forced_until — see ForceStatus.
load
Load a session’s state, returning the default (empty) state if the file is absent or malformed (workspace state is best-effort, never fatal).
load_from
Load a session’s state from an explicit sessions dir (test seam / callers that resolve the dir themselves). Absent or malformed → default state.
save
Persist a session’s state, creating the state dir if needed.
sessions_dir
$XDG_STATE_HOME/tracevault/sessions or ~/.local/state/tracevault/sessions.