/install claude-managed-agents
Claude Managed Agents
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.
What this skill handles
- agents
- create
- update
- retrieve
- list
- list versions
- archive
- delete
- environments
- create
- update
- retrieve
- list
- archive
- delete
- sessions
- create
- retrieve
- list
- archive
- delete
- session events
- send user messages
- interrupt and redirect
- list history
- stream live SSE events
- send tool confirmations
- send custom tool results
- files
- upload local files to the Files API
- list, download, and delete files
- return file IDs for mounting into sessions
- session resources
- add resources to running sessions
- list mounted resources
- delete mounted resources by resource ID
- configuration domains
- built-in toolset controls
- MCP servers
- skills
- packages
- networking
- vault IDs
- mounted resources
- diagnostics
- local preflight via
doctor - optional live read-only connectivity checks via
doctor --live
- local preflight via
Required environment
Set:
ANTHROPIC_API_KEY
Optional:
ANTHROPIC_API_BASE_URLANTHROPIC_MANAGED_AGENTS_BETAANTHROPIC_TIMEOUT_SECONDS
The managed-agents beta header is required. The helper uses managed-agents-2026-04-01 by default.
Script
Use:
scripts/managed_agents.py
Run 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
Operating model
Prefer this order:
- Python helper CLI
- documented
antequivalent when the user wants a direct CLI path - raw REST only when troubleshooting edge cases
The helper supports:
--backend auto(default)--backend sdk--backend http
Use sdk when the Anthropic Python SDK is installed. Use http if the SDK is missing or behaving oddly.
Safe workflow
For new setups
- confirm
ANTHROPIC_API_KEYexists - create or inspect the target agent
- create or inspect the target environment
- create the session
- send a user message event
- stream or list events to monitor progress
For mid-run steering
- list or stream session events
- if the agent is going the wrong direction, send:
user.interrupt- followed by a new
user.message
- if the session is waiting on approval, send
user.tool_confirmation - if the session is waiting on a custom tool result, send
user.custom_tool_result
High-value guardrails
- Do not guess event IDs, tool use IDs, or custom tool use IDs.
- For approval flows, read recent events first and use the exact pending tool ID.
- For custom tools, return only the result the tool actually produced. Do not fabricate success.
- Prefer limited networking with explicit hosts for production-oriented environments. Use bare hostnames like
api.example.com, not full URLs. - Do not delete environments, sessions, or agents casually. Archive first unless the user clearly wants hard deletion.
- Archiving is usually the safer lifecycle move than deletion, but disposable smoke fixtures may need delete for full cleanup.
Recommended command patterns
Create an agent with the full built-in toolset
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
Run doctor before a live session
python3 ~/.openclaw/skills/claude-managed-agents/scripts/managed_agents.py \
doctor \
--live \
--allowed-host api.example.com
Create an environment with limited networking and pip packages
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
Upload a file and get a file ID
python3 ~/.openclaw/skills/claude-managed-agents/scripts/managed_agents.py \
file upload \
--file-path ./data.csv \
--only-id
Create a session with an uploaded file mounted in the container
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\"}"
Add another file to a running session
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
Download a session-scoped file artifact
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.
Send a user message to the session
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."
Interrupt and redirect the session
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."
Stream events until idle
python3 ~/.openclaw/skills/claude-managed-agents/scripts/managed_agents.py \
session stream \
--session-id sess_123 \
--until-idle
Approve a pending tool call
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
Delete an agent when the user explicitly wants permanent cleanup
python3 ~/.openclaw/skills/claude-managed-agents/scripts/managed_agents.py \
agent delete \
--agent-id agent_123
Return a custom tool result
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"}'
When to use ant CLI instead
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"
References in this skill
Read these when needed:
references/quickstart.mdfor the end-to-end happy pathreferences/lifecycle-recipes.mdfor lifecycle operations and payload patternsreferences/files-api.mdfor upload, list, download, delete, and session resource workflowsreferences/event-model.mdfor streaming, interruptions, approvals, and custom toolsreferences/ant-cli-recipes.mdfor direct ant commands mirroring the helperreferences/known-gaps.mdfor dependency assumptions and operational caveats
Output contract
Default answer shape:
- short lead sentence with the answer or current state
- 2-6 bullets with the important IDs, statuses, or lifecycle facts
- exact next command when a follow-up step is likely
If the user asks for raw JSON, return the raw JSON instead.
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install claude-managed-agents - After installation, invoke the skill by name or use
/claude-managed-agents - Provide required inputs per the skill's parameter spec and get structured output
What is Claude Managed Agents?
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 want... It is an AI Agent Skill for Claude Code / OpenClaw, with 23 downloads so far.
How do I install Claude Managed Agents?
Run "/install claude-managed-agents" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Claude Managed Agents free?
Yes, Claude Managed Agents is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Claude Managed Agents support?
Claude Managed Agents is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Claude Managed Agents?
It is built and maintained by Aaron (@aaronfaby); the current version is v1.0.0.