AnthropicClaude Certified Architect – Foundations2026-101.7 Manage session state, resumption, and forking
Building a Session Browser
Completed by opening the official lab
Why it matters
Section 1.7 treats a session as something you resume or fork deliberately. This notebook shows what a session is underneath: a JSONL transcript filed by working directory, which the Agent SDK and the Claude Code CLI both write.
What to practise
Create a few sessions with query() and a shared cwd. Browse them with list_sessions() and get_session_messages(), both of which read files without starting the agent. Label them with rename_session() and tag_session(). Fork one with fork_session(), optionally up to a chosen message, and continue the fork by passing its ID to ClaudeAgentOptions.resume. Check that the original transcript stays unchanged.
How it fits
Resuming by ID is 1.7.1. The fork is the shared-baseline branch of 1.7.2: it isolates history, not files. Before you resume an old session, ask 1.7.3’s question: is its saved evidence still valid?