Back to catalog / Agent memory
Set retention and deletion policy for persisted sessions
Define an enforceable retention period for transcripts covering object lifecycle and explicit deletion.
Goal
Prevent unbounded growth or overdue retention of conversation data in an external SessionStore.
Steps
- Classify transcript data, ownership, and an organization-approved retention period. [stores]
- Configure lifecycle/TTL in the backend; the reference S3 adapter does not delete objects automatically. [stores]
- Implement and review
delete_session_via_store(), test that load no longer returns a deleted session, and monitor failures. [stores]
How to verify
Expired objects are removed by lifecycle rules; explicitly deleted sessions cannot be resumed; audit records omit transcript bodies.
Troubleshooting
If objects remain, inspect prefix/lifecycle scope and the delete role; CLI local-data cleanup is a separate mechanism.
Permissions
Prerequisites
- An external SessionStore, permission to manage retention rules, and an approved data-retention policy.
Permissions
- Verify ownership and scope before deletion; do not copy transcripts to public locations through logs or backups.
Limitations
Object lifecycle and SDK-local CLAUDE_CONFIG_DIR cleanup are separate; deletion may be irreversible, so verify the session ID first.
Pinned upstream source
- Repository
- anthropics/claude-agent-sdk-python
- File path
- examples/session_stores/README.md
- 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
Make Agent behavior safer and easier to verify