Answers · AI evidence
We're on Claude Enterprise and our compliance team wants to pull Claude Code and Cowork sessions through the Compliance API for eDiscovery and audits. What does a session transcript actually contain, what's left out, and can we treat it as a record of what happened on the developer's machine?
Last updated
TL;DR: A Compliance API session transcript is Anthropic's server-side reconstruction of the Claude API calls a session made: user prompts (including CLAUDE.md and skill text the client sent), assistant text, tool calls and the text parts of tool results, each tagged with the serving model on captured assistant turns. Claude Code and Cowork running on users' machines come back from the local session endpoints (GET /v1/compliance/apps/sessions/local, then /{id}/messages; IDs start clls_), read with a Compliance Access Key holding read:compliance_user_data. Coverage became generally available for Cowork and Claude Code on August 26, 2026, for Claude Enterprise organizations only. Thinking blocks, the system prompt, tool and MCP server definitions, images and other binary content are never returned, tool inputs and results are cut at 10,000 bytes unless you ask for more (up to about 1 MiB), and sessions under zero data retention, Console API keys, Bedrock, Vertex AI, Foundry or Claude Code cloud sessions aren't included. Anthropic's docs say it plainly: a local transcript shows what Claude was asked to do and what it returned, not what occurred on the device.
What should I check, step by step?
1. Confirm the sessions you need are in scope: Claude Code and Cowork on users' machines signed in with the Enterprise account are; Console API key sessions, Bedrock, Vertex AI, Foundry, Claude Code cloud sessions and zero-data-retention sessions aren't.
- Request the full tool blocks for evidence exports: set tool_use_input_max_bytes and tool_result_max_bytes to -1 (about 1 MiB each), because the standard cap is 10,000 bytes and a truncated tool input isn't valid JSON.
- Keep every message's provenance value: null means content captured from the Claude API; client_asserted means history the client sent that couldn't be matched to a captured response; content_unavailable with a reason (not_captured, client_aborted, retention_elapsed, oversize) means the turn exists but its content can't be returned.
- Join user.id against the list endpoint for email addresses: the messages endpoint always returns email_address as null.
- Poll with updated_at.gte set a few minutes before your previous run's start, not exactly at it, and deduplicate on session id, since created_at moves forward as old calls age out.
- Export what you must keep before retention removes it: local transcripts are kept 6 years unless your organization sets a finite custom period (30 days with HIPAA readiness), and the endpoints are read-only.
- Pair the transcript with a record from your own side (repository commits, CI runs, OpenTelemetry) for anything that happened on the machine itself.
What does a Claude Compliance API session transcript contain?
Anthropic records each local session server-side as its requests reach the Claude API; nothing is installed on the device. The messages endpoint rebuilds the transcript from those captured calls: user prompts, assistant text, tool_use blocks (id, name, input as a JSON-encoded string) and tool_result blocks (tool_use_id, name, is_error, text content), returned as sent apart from size limits. Nothing masks URLs, credentials or personal data, so the docs tell you to treat transcripts as sensitive.
- Project instruction files such as CLAUDE.md show up as ordinary user content, and skill text appears when the client sends it as message content, without being marked as a skill. Cowork and Claude Code call each connector under its own mcp__<server>__<tool> name, so MCP calls appear as named tool_use blocks.
- Each captured assistant turn carries the model that served it. Messages from the same inference call share one created_at timestamp, so keep the returned order instead of re-sorting by time.
- The session list gives metadata only: session id, organization, workspace, user id and email, product_surface (claude_code, cowork and others) and created_at/updated_at. A new conversation, or clearing the client's context, starts a new session record.
What do Claude Compliance API transcripts leave out?
Never returned: thinking blocks, the system prompt (a [system prompt content not shown] marker stands in for it), tool definitions and MCP server configuration. Images, PDFs and other binary blocks become placeholders such as [image content not shown], and non-text items in a tool result, such as web search results, collapse to one [N non-text item(s) not shown] entry. Citation metadata is dropped while the text stays.
- Tool inputs and each text entry of a tool result are cut at 10,000 bytes unless you pass a larger cap; a cut block carries truncated: true. Host and device details (terminal type, workspace paths) and token usage aren't in the transcript; the docs point to OpenTelemetry and the Enterprise Analytics API for those.
- Out of scope entirely: Claude Code authenticated with a Console API key or run through Amazon Bedrock, Google Cloud or Microsoft Foundry; Claude Code cloud sessions, including cloud scheduled tasks; and sessions under zero data retention, which are missing from the list and return 404. With HIPAA readiness on, only Cowork and Claude Code local sessions are returned, and content is kept 30 days.
What does provenance mean in a Claude Compliance API transcript?
Every message has a provenance field. null is the common case: content captured by the Claude API. client_asserted marks assistant messages the client supplied as history that couldn't be matched to a captured response, so their authorship isn't verified. synthetic_marker marks records the endpoint itself inserted, such as the system prompt stand-in or the point where the client compacted its history.
- content_unavailable means the turn exists but its content can't be returned, with a reason: not_captured, client_aborted (the client cancelled before the response finished; partial streamed output isn't included), retention_elapsed, oversize, or the reserved cmek_key_revoked. The docs warn that not_captured doesn't prove nothing was stored, because content withheld under Anthropic's data-handling policies is reported the same way.
- If your customer-managed encryption key is disabled or unreachable, affected pages return 503 instead of content. When the earliest calls of a session pass retention, the transcript starts with a retention_elapsed placeholder; when every call has aged out, the session disappears and the messages endpoint returns 404.
Does a Claude Code transcript show what ran on the developer's machine?
Anthropic's own wording: local session transcripts show what Claude was asked to do and what it returned, not what occurred on the device. A tool_use block shows a command Claude asked to run; the tool_result shows the text the client sent back. Whether the command actually ran as written, what else ran, and any files the session never sent aren't captured.
- So the transcript answers 'what did the user and Claude say, and which tools did Claude call' well, from a record Anthropic holds and you can't edit. For 'what changed in our systems', keep evidence on your side too: the commit and CI run the session produced, your own logs, and a fingerprint of the transcript export you relied on, so a reviewer can tie the two together later.
How do I ask Rightshold about this (free, no key)?
Add the MCP server https://www.rightshold.com/mcp to Claude, Cursor, ChatGPT, Grok or VS Code, then ask: “We exported a Claude Code session transcript from the Compliance API for a change review. Record a receipt with the session id, the user id, the time window, the commit it produced and the SHA-256 of the exported transcript JSON.”
{
"tool": "record_action",
"arguments": {
"action_type": "ai_session.transcript_exported",
"outcome": "success",
"occurred_at": "2026-11-22T13:00:00Z",
"client_event_id": "compliance-export:clls_<session id>",
"summary": "Compliance API local session transcript (product_surface claude_code) for change review; session clls_<session id>; user user_<id>; session window 2026-11-21T14:02Z to 15:10Z; tool caps -1; 0 content_unavailable turns; produced commit <sha>",
"action_sha256": "<sha256 of the exported transcript JSON>"
}
}- Needs an API key. Send ids, hashes and a summary; keep the transcript itself in your own restricted storage.
- Use one client_event_id per exported session, so a retry doesn't create a second entry.
- Anyone you share the receipt with can check it against your saved export without an account.
- A receipt records what you submitted and when. Rightshold doesn't read Claude transcripts and doesn't confirm what ran on a machine.
Rightshold isn't affiliated with Anthropic. Details are from Anthropic's 'Retrieve session transcripts' documentation, the Compliance API reference for local session messages and Anthropic's August 11, 2026 article (updated August 26, 2026) on Compliance API coverage for Cowork and Claude Code, all read November 22, 2026. Product coverage, caps and retention can change; check the current docs before relying on them.
What are the sources?
- Claude Docs: Retrieve session transcripts
- Claude API reference: Retrieve local session messages
- Claude: Compliance API coverage extends to Claude Cowork and Claude Code (August 11, 2026; updated August 26, 2026)
Related
- How do you trace what GitHub Copilot's cloud agent did?
- Is an LLM observability trace the same as an audit trail of AI answers?
- Logging every AI agent tool call for audit
- Can your ChatGPT or Claude chats be used as evidence?
Not legal advice. JSON · Markdown · All answers
Get a free API key in one call
No card and no email needed. 100 free credits; the license and policy checks stay free without a key.
curl -s -X POST https://www.rightshold.com/v1/accounts/signup -H "Content-Type: application/json" -d '{"accept_terms":true}'
export RIGHTSHOLD_API_KEY=rs_... # the api_key from the reply (shown once)
curl -s https://www.rightshold.com/v1/licenses/check -H "Authorization: Bearer $RIGHTSHOLD_API_KEY" \
-H "Content-Type: application/json" -d '{"license":"MIT","intended_use":{"commercial_use":true}}'
