Back to catalog / Agent runtime
Build an interactive session with ClaudeSDKClient
Keep conversational context within one client, sending turns and consuming each full response.
Goal
Implement multi-turn agent interaction with explicit turn boundaries.
Steps
How to verify
The second turn can refer to the first turn’s context, and each turn has a terminal result.
Troubleshooting
If responses cross turns, consume turns serially; concurrent queries on one client require separate design and testing.
Permissions
Prerequisites
- Python 3.10+, claude-agent-sdk, and supported CLI authentication.
Permissions
- Treat session messages as potentially sensitive; expose sessions only to authorized users.
Limitations
Context is scoped to the client lifetime; this example does not provide cross-process persistence.
Pinned upstream source
- Repository
- anthropics/claude-agent-sdk-python
- File path
- examples/streaming_mode.py
- Pinned commit
b6e9d12fe1cc98dde988ab7b7713c1feeee50c6c- Source checked
- 2026-10-14 · Reviewed against the pinned upstream source
Repository metrics
These values describe the upstream repository, not popularity or likes for an individual skill or playbook.
- Stars
- Not collected
- Forks
- Not collected
- Observed at
- Not collected
No metrics snapshot is available yet.
License: MIT
Main topic
Take a coding Agent change from context to verification