Back to catalog / Agent memory
Store and resume a session transcript in private S3
Use the reference S3 SessionStore to mirror session messages and resume a conversation by session ID.
Goal
Provide controlled object-store persistence and resume for agent sessions.
Steps
- Follow
examples/session_stores/s3_session_store.py, install boto3 separately, and configure a private bucket/prefix client. [s3] - Pass the store through
ClaudeAgentOptions(session_store=store)and retain the session ID after a successful turn. [s3] - Resume with
ClaudeAgentOptions(session_store=store, resume="previous-session-id")and verify ordered history. [s3]
How to verify
The new turn can refer to prior conversation, permissions are limited to the target bucket/prefix, and transcript order is preserved.
Troubleshooting
If history is incomplete, inspect object ordering and multi-writer clock skew; the example notes load latency grows linearly beyond 1,000 parts.
Permissions
Prerequisites
- Python 3.10+, SDK, boto3, an isolated AWS account/bucket, and least-privilege IAM.
Permissions
- Grant IAM only required Put/Get/List/Delete access to the target bucket/prefix; protect transcripts as sensitive private data.
Limitations
This is reference code; deletion requires explicit delete_session_via_store and an S3 lifecycle policy; never store trading credentials.
Pinned upstream source
- Repository
- anthropics/claude-agent-sdk-python
- File path
- examples/session_stores/s3_session_store.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
Turn ecommerce campaign materials into a reviewable weekly brief