Manage Claude Managed Agents end to end through a Python helper CLI, with ant CLI equivalents documented as a secondary path. Use this whenever the user wants to create, update, list, archive, or inspect Claude Managed Agents agents, environments, sessions, or event streams; configure built-in tools, MCP servers, skills, packages, or networking; send session messages, interrupts, confirmations, or custom tool results; or work with Anthropic's managed-agents beta lifecycle from this machine.
Use this skill to operate Anthropic Claude Managed Agents safely and cleanly from this machine.
This skill is SDK-first through the bundled Python helper, with ant CLI documented as a secondary operator lane. Raw REST is only for debugging or when the SDK is unavailable.
doctordoctor --liveSet:
ANTHROPIC_API_KEYOptional:
ANTHROPIC_API_BASE_URLANTHROPIC_MANAGED_AGENTS_BETAANTHROPIC_TIMEOUT_SECONDSThe managed-agents beta header is required. The helper uses managed-agents-2026-04-01 by default.
Use:
scripts/managed_agents.pyRun it with Python 3:
python3 ~/.openclaw/skills/claude-managed-agents/scripts/managed_agents.py --help
Run a preflight before live work when the lane feels sketchy:
python3 ~/.openclaw/skills/claude-managed-agents/scripts/managed_agents.py \
doctor \
--allowed-host api.example.com
Prefer this order:
ant equivalent when the user wants a direct CLI pathThe helper supports:
--backend auto (default)--backend sdk--backend httpUse sdk when the Anthropic Python SDK is installed. Use http if the SDK is missing or behaving oddly.
ANTHROPIC_API_KEY existsuser.interruptuser.messageuser.tool_confirmationuser.custom_tool_resultapi.example.com, not full URLs.python3 ~/.openclaw/skills/claude-managed-agents/scripts/managed_agents.py \
agent create \
--name "Coding Assistant" \
--model claude-sonnet-4-6 \
--system "You are a helpful coding agent." \
--agent-toolset
python3 ~/.openclaw/skills/claude-managed-agents/scripts/managed_agents.py \
doctor \
--live \
--allowed-host api.example.com
python3 ~/.openclaw/skills/claude-managed-agents/scripts/managed_agents.py \
environment create \
--name "python-dev" \
--network limited \
--allowed-host api.example.com \
--allow-package-managers \
--pip pandas==2.2.0 \
--pip numpy==2.1.0
python3 ~/.openclaw/skills/claude-managed-agents/scripts/managed_agents.py \
file upload \
--file-path ./data.csv \
--only-id
FILE_ID=$(python3 ~/.openclaw/skills/claude-managed-agents/scripts/managed_agents.py \
file upload \
--file-path ./data.csv \
--only-id)
python3 ~/.openclaw/skills/claude-managed-agents/scripts/managed_agents.py \
session create \
--agent-id agent_123 \
--environment-id env_123 \
--title "Repo analysis" \
--resource-json "{\"type\":\"file\",\"file_id\":\"${FILE_ID}\",\"mount_path\":\"/workspace/data.csv\"}"
python3 ~/.openclaw/skills/claude-managed-agents/scripts/managed_agents.py \
session resource add \
--session-id sess_123 \
--file-id file_abc123 \
--mount-path /workspace/config.json
python3 ~/.openclaw/skills/claude-managed-agents/scripts/managed_agents.py \
file download \
--file-id file_abc123 \
--output ./artifact.txt
Use this mainly for generated artifacts. Uploaded source files often come back with downloadable: false.
python3 ~/.openclaw/skills/claude-managed-agents/scripts/managed_agents.py \
session send \
--session-id sess_123 \
--message "Summarize the repository and propose the next refactor."
python3 ~/.openclaw/skills/claude-managed-agents/scripts/managed_agents.py \
session send \
--session-id sess_123 \
--interrupt \
--message "Stop the broad audit and focus on the auth bug in line 42."
python3 ~/.openclaw/skills/claude-managed-agents/scripts/managed_agents.py \
session stream \
--session-id sess_123 \
--until-idle
python3 ~/.openclaw/skills/claude-managed-agents/scripts/managed_agents.py \
session send \
--session-id sess_123 \
--confirm-tool-use-id tool_evt_123 \
--confirm-result allow
python3 ~/.openclaw/skills/claude-managed-agents/scripts/managed_agents.py \
agent delete \
--agent-id agent_123
python3 ~/.openclaw/skills/claude-managed-agents/scripts/managed_agents.py \
session send \
--session-id sess_123 \
--custom-tool-use-id custom_evt_123 \
--custom-tool-text '{"temperature_f":72,"condition":"sunny"}'
Use ant when the user explicitly wants Anthropic's native CLI experience, copy-pasteable operator commands, or quick manual inspection.
Examples:
ant beta:agents create --name "Coding Assistant" --model '{id: claude-sonnet-4-6}' --tool '{type: agent_toolset_20260401}'
ant beta:environments list
ant beta:sessions retrieve --session-id "$SESSION_ID"
ant beta:sessions:events send --session-id "$SESSION_ID"
ant beta:sessions stream --session-id "$SESSION_ID"
Read these when needed:
references/quickstart.md for the end-to-end happy pathreferences/lifecycle-recipes.md for lifecycle operations and payload patternsreferences/files-api.md for upload, list, download, delete, and session resource workflowsreferences/event-model.md for streaming, interruptions, approvals, and custom toolsreferences/ant-cli-recipes.md for direct ant commands mirroring the helperreferences/known-gaps.md for dependency assumptions and operational caveatsDefault answer shape:
If the user asks for raw JSON, return the raw JSON instead.