用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/UitbreidenOS/UitKit --skill managed-agents命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Guidelines and instructions for Agent execution state rollback rules
Guidelines and instructions for Agent execution step counters limits
Guidelines and instructions for Agent execution timeout limits setups
基于 SOC 职业分类
| name | managed-agents |
| description | Deploy and manage Claude agents with lifecycle management, monitoring, and scaling |
Building applications where agents need to run autonomously in the cloud, or when the user mentions Claude Managed Agents, long-running agent tasks, or building agent-powered products via the Anthropic API.
Task tool, not this APIKey distinction from Claude Code subagents: Managed Agents run independently of your terminal in Anthropic's cloud. Use them for async, long-running, or API-driven agent products — not for Claude Code slash commands.
All Managed Agents API calls require:
anthropic-beta: managed-agents-2026-04-01
To give an agent access to all built-in tools (Bash, file operations, web search, web fetch, MCP):
tools=[{"type": "agent_toolset_20260401"}]
import anthropic
client = anthropic.Anthropic()
# 1. Create the agent (do once; reuse agent_id)
agent = client.beta.agents.create(
model="claude-opus-4-5",
name="research-agent",
system="You are a research agent. When given a topic, search the web, gather facts, and produce a structured summary.",
tools=[{"type": "agent_toolset_20260401"}],
)
# 2. Create an environment (cloud sandbox)
env = client.beta.environments.create(type="cloud")
# 3. Create a session and stream events
with client.beta.sessions.stream(
agent_id=agent.id,
environment_id=env.id,
input="Research the latest developments in quantum computing and summarize in 3 bullet points.",
) as stream:
for event in stream:
if event.type == "agent.message":
print(event.data.text, end="", flush=True)
elif event.type == "agent.tool_use":
print(f"\n[Tool: {event.data.name}]")
elif event.type == "session.status_idle":
print("\n[Session complete]")
break
| Event | Meaning |
|---|---|
agent.message | Agent producing output text |
agent.tool_use | Agent calling a tool — data.name is the tool name |
agent.tool_result | Result returned from a tool call |
session.status_idle | Agent has finished and is waiting |
session.status_error | Session ended with an error |
For workloads where you don't want to hold a connection open:
# Start session without streaming
session = client.beta.sessions.create(
agent_id=agent.id,
environment_id=env.id,
input="Analyze these 50 documents and extract action items.",
)
session_id = session.id
# Poll status later
import time
while True:
session = client.beta.sessions.retrieve(session_id)
if session.status in ("idle", "error"):
break
time.sleep(10)
# Retrieve output
output = client.beta.sessions.retrieve(session_id)
print(output.output)
| Operation | Limit |
|---|---|
| Create session | 300 RPM |
| Read session / stream | 600 RPM |
ant CLI# Install
npm install -g @anthropic-ai/ant
# Test an agent interactively
ant run --agent-id <id> --environment cloud
# Run with a specific input
ant run --agent-id <id> --input "Summarize today's AI news"
agent_id in your application config; store session output in your databasetype: "cloud"): fastest to start, no infrastructure, appropriate for most use casesA product that lets users submit research tasks asynchronously via a web form:
type: "cloud" environment — stores session_id in the job queuesession.status == "idle", worker retrieves session.output and emails the userThe entire agent run — web searches, data extraction, synthesis — happens in Anthropic's cloud with no infrastructure management.