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§
- Project
Binding - A resolved binding to a registered project.
- Repo
Binding - A resolved binding to a registered repo.
- Session
State - Session-level active binding plus per-worktree subagent overrides (keyed by the subagent’s git worktree toplevel path — design §7).
Enums§
- Force
Status - What a
ProjectBinding::forced_untilcurrently says about its force.
Functions§
- env_
session_ id - The session of the agent that runs this command, from its environment:
$TRACEVAULT_SESSION_ID(exported by the Claude Code / Codex SessionStart hook), else$AMP_CURRENT_THREAD_ID. - force_
status - Classify a stored
forced_until— seeForceStatus. - 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.
- save_to
saveinto an explicit sessions dir — the write half ofload_from.- session_
id_ from_ env env_session_idon given values:tracevaultwins, thenamp_thread.- sessions_
dir $XDG_STATE_HOME/tracevault/sessionsor~/.local/state/tracevault/sessions.