Expand description
Session metadata sidecar + path derivation.
csd tracks each driven session with a small JSON sidecar under the state dir so ps/state
can recover the session id, cwd and transcript path without re-deriving them. tmux remains the
source of truth for liveness; the sidecar is the source of truth for identity.
Structs§
- Session
- Persisted identity of one driven session.
Functions§
- cwd_
slug - Slugify a cwd the way
claudenames its project transcript dir: every/→-. - jsonl_
path - Deterministic transcript path:
~/.claude/projects/<cwd-slug>/<session-id>.jsonl. - mtime_
epoch - Modification time of
pathas Unix epoch seconds, if available. - now_
epoch - Current Unix epoch in seconds. (Clock-before-epoch is impossible in practice → 0 fallback.)
- plans_
dir ~/.claude/plans— whereclaudewrites plan files in plan mode (global, not per-session).- validate_
name - Reject session names that aren’t a single safe path segment. A name becomes both a tmux session
name and a sidecar filename, so it must contain only
[A-Za-z0-9._-], start with an alphanumeric or underscore (no leading-that tmux could read as a flag), and never contain...