MCPcopy Create free account
hub / github.com/Work-Fisher/code-claw / save_session

Function save_session

claw-code/src/session_store.py:19–24  ·  view source on GitHub ↗
(session: StoredSession, directory: Path | None = None)

Source from the content-addressed store, hash-verified

17
18
19def save_session(session: StoredSession, directory: Path | None = None) -> Path:
20 target_dir = directory or DEFAULT_SESSION_DIR
21 target_dir.mkdir(parents=True, exist_ok=True)
22 path = target_dir / f'{session.session_id}.json'
23 path.write_text(json.dumps(asdict(session), indent=2))
24 return path
25
26
27def load_session(session_id: str, directory: Path | None = None) -> StoredSession:

Callers 1

persist_sessionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected