Register and share your invite link to earn from video plays and referrals.

cv usk
@cv_usk
AI / Software Research Notes AI Agent, LLMOps, MLOps, Software Architecture
Joined May 2026
238 Following    212 Followers
# Practical ways to use the Claude Agent SDK ๐Ÿ’ฌ Continue, resume, and fork agent conversations to tackle complex tasks across multiple turns. Session Management uses `continue`, `resume`, and `fork` to maintain context across multi-turn conversations. ๐Ÿ“Œ Title: Working with Sessions ๐Ÿ”— URL: ๐Ÿงฉ Overview Sessions preserve conversation context. Python uses `ClaudeSDKClient` (auto session ID management), TypeScript uses `continue: true`. `resume` restarts interrupted sessions, and `fork_session` branches history to explore alternatives. ๐Ÿ›  How to use it ```python options = ClaudeAgentOptions(resume=session_id) # Resume options = ClaudeAgentOptions(fork_session=True) # Fork ``` ๐Ÿ— Practical usage - Build multi-turn conversations: "Analyze the auth module" โ†’ "Refactor it to use JWT" with full context preserved. - Resume sessions that ended with `error_max_turns` using `resume` with higher limits. - Use `fork_session=True` to explore an OAuth2 approach without destroying the original JWT approach. Two independent histories are maintained. - Build session picker UIs with `list_sessions` / `get_session_messages` / `rename_session`. ๐Ÿ’ก Use cases ๐Ÿ”„ Resuming sessions after hitting limits ๐ŸŒฟ Parallel exploration of alternative approaches via fork ๐Ÿ—‚ Building session management UIs โš ๏ธ Watch out Sessions are saved at `~/.claude/projects//.jsonl`. Cross-host resume requires matching `cwd`. Sub-agent transcripts persist independently from the main conversation. #ClaudeAgentSDK# #AI#
Show more