Remote sessions¶
Cowork sessions started on claude.ai web or mobile, which run in the cloud in Anthropic-managed environments. For sessions on users' own machines — including Claude Code — see Local sessions.
remote_sessions ¶
Remote Sessions resource group.
Remote sessions are Cowork sessions started on claude.ai web or mobile,
which run in the cloud in Anthropic-managed environments. Sessions that
run on users' own machines are a separate family — see
local_sessions.
Wraps two endpoints, both read-only. There is deliberately no
retrieve-one method: the API exposes a list and a transcript, but no
GET /sessions/remote/{id}.
GET /v1/compliance/apps/sessions/remote— page of session metadata. Exposed vialistanditer.GET /v1/compliance/apps/sessions/remote/{id}/messages— one session's transcript. Exposed vialist_messagesanditer_messages.
Requires a Compliance Access Key with read:compliance_user_data.
Admin API keys are rejected with 403.
These endpoints count against a second request budget on top of the shared Compliance API rate limit, so a 429 here can arrive well below 600 requests per minute.
Example
from claude_compliance_sdk import ComplianceClient
with ComplianceClient(api_key="sk-ant-api01-...") as client:
for session in client.remote_sessions.iter(
created_at_gte="2026-06-01T00:00:00Z",
):
if session.status == "pending":
continue # No transcript until provisioning completes.
transcript = client.remote_sessions.list_messages(session.id)
print(session.id, len(transcript.messages.data))
RemoteSession
dataclass
¶
Metadata for one Cowork session running in the cloud.
A session is owned by either a user or an agent, never both.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Session identifier ( |
organization_uuid |
str
|
UUID of the organisation the session belongs to. |
created_at |
str
|
When the session was created (RFC 3339, UTC). |
updated_at |
str
|
When the session was last modified. |
status |
str
|
Lifecycle state — |
user |
SessionUser | None
|
The owning user, or |
agent_id |
str | None
|
The owning agent ( |
started_by_user |
SessionUser | None
|
On agent-owned sessions, the human who
initiated the run — for example by starting a scheduled
task. |
product_surface |
str | None
|
Currently only |
claude_project_id |
str | None
|
The claude.ai project the session belongs
to ( |
extra |
dict[str, Any]
|
Any additional fields the API adds in a later revision. |
from_dict
classmethod
¶
Build a RemoteSession from one decoded record.
RemoteSessionMessage
dataclass
¶
One user or assistant turn in a remote session transcript.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Message identifier ( |
role |
str
|
|
created_at |
str
|
A commit timestamp. Consecutive messages can share one or slightly invert, so preserve the returned order rather than re-sorting by this field. |
content |
list[dict[str, Any]]
|
Content blocks, each a raw dict discriminated on
|
sent_by_user_id |
str | None
|
On agent-owned sessions, the user who sent
this message when it is attributable. |
content_unavailable |
bool
|
|
extra |
dict[str, Any]
|
Any additional fields the API adds in a later revision. |
from_dict
classmethod
¶
Build a RemoteSessionMessage from one decoded record.
RemoteSessionTranscript
dataclass
¶
A page of transcript, plus the session it belongs to.
Attributes:
| Name | Type | Description |
|---|---|---|
session |
RemoteSession
|
The session the messages belong to. On this endpoint
its |
messages |
OffsetPage[RemoteSessionMessage]
|
One |
from_dict
classmethod
¶
Split the envelope into a session and a page of messages.
RemoteSessions ¶
Synchronous client for the remote session endpoints.
list ¶
list(
*,
organization_ids: StrList | None = None,
user_ids: StrList | None = None,
created_at_gte: str | None = None,
created_at_gt: str | None = None,
created_at_lte: str | None = None,
created_at_lt: str | None = None,
limit: int | None = None,
page: str | None = None
) -> OffsetPage[RemoteSession]
Fetch one page of remote session metadata, newest first.
Defaults to every organisation the key can read. There is no
updated_at filter on this endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
organization_ids
|
StrList | None
|
Up to 500 organisation identifiers
( |
None
|
user_ids
|
StrList | None
|
1–10 user IDs. Matches the session's owning
user, so setting this excludes every agent-owned
session. |
None
|
created_at_gte
|
str | None
|
|
None
|
created_at_gt
|
str | None
|
|
None
|
created_at_lte
|
str | None
|
|
None
|
created_at_lt
|
str | None
|
|
None
|
limit
|
int | None
|
Maximum results (default 100, max 500). |
None
|
page
|
str | None
|
Opaque token from a prior response's |
None
|
Returns:
| Type | Description |
|---|---|
OffsetPage[RemoteSession]
|
One |
Raises:
| Type | Description |
|---|---|
ValueError
|
When |
RateLimitError
|
These endpoints carry a second budget on top of the shared limit, so this can arrive well below 600 requests per minute. |
InsufficientScopeError
|
When the key lacks
|
iter ¶
iter(
*,
organization_ids: StrList | None = None,
user_ids: StrList | None = None,
created_at_gte: str | None = None,
created_at_gt: str | None = None,
created_at_lte: str | None = None,
created_at_lt: str | None = None,
limit: int | None = None
) -> Iterator[RemoteSession]
Iterate every matching remote session, auto-paginating.
Same filters as list except that page is managed by the
iterator.
list_messages ¶
list_messages(
session_id: str,
*,
order: str | None = None,
limit: int | None = None,
page: str | None = None,
tool_use_input_max_bytes: int | None = None,
tool_result_max_bytes: int | None = None
) -> RemoteSessionTranscript
Fetch one page of a remote session's transcript.
A page can end early when the response hits its size limit, so
a short page does not mean you have reached the end. Keep
paginating until next_page is None.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session_id
|
str
|
Session identifier ( |
required |
order
|
str | None
|
|
None
|
limit
|
int | None
|
Maximum messages per page (default 100, max 1000). |
None
|
page
|
str | None
|
Opaque token from a prior response's |
None
|
tool_use_input_max_bytes
|
int | None
|
Truncate each tool-use input to
this many bytes (server default 10,000). |
None
|
tool_result_max_bytes
|
int | None
|
Truncate each text item inside a tool result the same way. |
None
|
Returns:
| Type | Description |
|---|---|
RemoteSessionTranscript
|
A |
RemoteSessionTranscript
|
page of messages. |
Raises:
| Type | Description |
|---|---|
ValueError
|
When either truncation cap is |
NotFoundError
|
When the session is still |
iter_messages ¶
iter_messages(
session_id: str,
*,
order: str | None = None,
limit: int | None = None,
tool_use_input_max_bytes: int | None = None,
tool_result_max_bytes: int | None = None
) -> Iterator[RemoteSessionMessage]
Iterate a remote session's whole transcript, auto-paginating.
Same arguments as list_messages except that page is
managed by the iterator. The session envelope is dropped.
AsyncRemoteSessions ¶
Asynchronous client for the remote session endpoints.
list
async
¶
list(
*,
organization_ids: StrList | None = None,
user_ids: StrList | None = None,
created_at_gte: str | None = None,
created_at_gt: str | None = None,
created_at_lte: str | None = None,
created_at_lt: str | None = None,
limit: int | None = None,
page: str | None = None
) -> OffsetPage[RemoteSession]
Async analogue of list.
iter ¶
iter(
*,
organization_ids: StrList | None = None,
user_ids: StrList | None = None,
created_at_gte: str | None = None,
created_at_gt: str | None = None,
created_at_lte: str | None = None,
created_at_lt: str | None = None,
limit: int | None = None
) -> AsyncIterator[RemoteSession]
Async analogue of iter.
list_messages
async
¶
list_messages(
session_id: str,
*,
order: str | None = None,
limit: int | None = None,
page: str | None = None,
tool_use_input_max_bytes: int | None = None,
tool_result_max_bytes: int | None = None
) -> RemoteSessionTranscript
Async analogue of list_messages.
iter_messages ¶
iter_messages(
session_id: str,
*,
order: str | None = None,
limit: int | None = None,
tool_use_input_max_bytes: int | None = None,
tool_result_max_bytes: int | None = None
) -> AsyncIterator[RemoteSessionMessage]
Async analogue of iter_messages.