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

Search results for ClaudeAgentSDK
ClaudeAgentSDK community
One keyword maps to one global community path.
Create community
People
Not Found
Tweets including ClaudeAgentSDK
# Practical ways to use the Claude Agent SDK 📡 Master streaming input mode for image uploads, interrupts, and persistent context. Streaming vs Single-Message Input covers the streaming mode for persistent conversations and single-message mode for stateless environments. 📌 Title: Streaming Input 🔗 URL: 🧩 Overview Streaming input mode (recommended) supports image uploads, message queues, interrupts, and context persistence for rich interactive experiences. Single-message input is ideal for stateless environments like AWS Lambda for one-shot responses. 🛠 How to use it Streaming mode is the default. Single-message mode is explicitly selected for stateless environments like Lambda. 🏗 Practical usage - In a chat UI, upload an architecture diagram after "Analyze this codebase" for visual code review. - Inject external events (CI results, Slack notifications) via message queues to dynamically extend context. - Use single-message mode for serverless functions that run "Explain the auth flow" as a one-shot task. 💡 Use cases 🖼 Code review with image attachments 📨 Dynamic injection of external events ⚡ One-shot task execution in serverless environments ⚠️ Watch out Single-message mode doesn't support image attachments, interrupts, or multi-turn conversations. Use streaming mode when rich interaction is needed. #ClaudeAgentSDK# #AI#
Show more
# 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