Loading...
  • Messages
  • Managed Agents
  • Admin
Search...
⌘K
First steps
OverviewQuickstartPrototype in Console
Define your agent
Agent setupToolsMCP connectorPermission policiesAgent Skills
Configure agent environment
Cloud environment setupCloud sandbox reference
Delegate work to your agent
Start a sessionSession operationsSession event streamSubscribe to webhooksDefine outcomesAuthenticate with vaults
Manage agent context
Access GitHubAttach and download files
Advanced orchestration
Multiagent sessions
Reference
Managed Agents reference
Working with files
Files APIPDF supportImages and vision
Skills
OverviewBest practicesSkills for enterprise
MCP
Remote MCP servers
Claude on cloud platforms
Claude Platform on AWS
Log in
Session operations
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Solutions

  • AI agents
  • Code modernization
  • Coding
  • Customer support
  • Education
  • Financial services
  • Government
  • Life sciences

Partners

  • Amazon Bedrock
  • Google Cloud's Vertex AI

Learn

  • Blog
  • Courses
  • Use cases
  • Connectors
  • Customer stories
  • Engineering at Anthropic
  • Events
  • Powered by Claude
  • Service partners
  • Startups program

Company

  • Anthropic
  • Careers
  • Economic Futures
  • Research
  • News
  • Responsible Scaling Policy
  • Security and compliance
  • Transparency

Learn

  • Blog
  • Courses
  • Use cases
  • Connectors
  • Customer stories
  • Engineering at Anthropic
  • Events
  • Powered by Claude
  • Service partners
  • Startups program

Help and security

  • Availability
  • Status
  • Support
  • Discord

Terms and policies

  • Privacy policy
  • Responsible disclosure policy
  • Terms of service: Commercial
  • Terms of service: Consumer
  • Usage policy
Managed Agents/Delegate work to your agent

Session operations

Retrieve, list, update, archive, and delete Claude Managed Agents sessions.

Once a session exists, use these operations to read, update, archive, or delete it. See Start a session for creating a session and sending it work.

All Managed Agents API requests require the managed-agents-2026-04-01 beta header. The SDK sets the beta header automatically.

Session statuses

Sessions progress through these statuses. See Start a session for the session lifecycle.

StatusDescription
idleAgent is waiting for input, including user messages or tool confirmations. Sessions start in idle.
runningAgent is actively executing.
reschedulingTransient error occurred, retrying automatically.
terminatedSession has ended because of an unrecoverable error.

Updating the agent configuration

You can update a session's agent.tools and agent.mcp_servers, including permission policies, mid-session without creating a new agent version. Updates are session-local and do not propagate back to the underlying agent.

The semantics of an update are full replacement: the provided array is the new value. To preserve existing entries, GET the session, modify the array, and POST it back.

The session must be idle to update the agent. Interrupt the session if you need to update the agent while it's running.

ant beta:sessions update --session-id "$SESSION_ID" <<'YAML'
agent:
  tools:
    - type: agent_toolset_20260401
    - type: mcp_toolset
      mcp_server_name: linear
  mcp_servers:
    - type: url
      name: linear
      url: https://mcp.linear.app/sse
YAML

Retrieving a session

ant beta:sessions retrieve --session-id "$SESSION_ID"

Listing sessions

ant beta:sessions list --agent-id "$AGENT_ID"

Archiving a session

Archive a session to prevent new events from being sent while preserving its history. A running session cannot be archived; send an interrupt event if you need to archive it immediately.

ant beta:sessions archive \
  --session-id "$SESSION_ID"

Deleting a session

Delete a session to permanently remove its record, events, and associated sandbox. A running session cannot be deleted; send an interrupt event if you need to delete it immediately.

Files, memory stores, vaults, skills, environments, and agents are independent resources and are not affected by session deletion.

ant beta:sessions delete \
  --session-id "$SESSION_ID"

Was this page helpful?

  • Session statuses
  • Updating the agent configuration
  • Retrieving a session
  • Listing sessions
  • Archiving a session
  • Deleting a session