Modal Claude Agent Sdk Python
Description
This package wraps the Claude Agent SDK to execute AI agents in secure, scalable Modal containers. It provides progressive complexity—simple usage mirrors the original Agent SDK, while advanced features expose Modal's full capabilities (GPU, volumes, image customization, etc.).
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
README
Modal Agents SDK
**Disclaimer**: This is an unofficial community package. It is not affiliated with, endorsed by, or associated with Anthropic or Modal in any way.
Run [Claude Agent SDK](https://github.com/anthropics/claude-agent-sdk-python) agents in [Modal](https://modal.com) sandboxes.
This package wraps the Claude Agent SDK to execute AI agents in secure, scalable Modal containers. It provides progressive complexity—simple usage mirrors the original Agent SDK, while advanced features expose Modal's full capabilities (GPU, volumes, image customization, etc.).
Features
| Feature | modal-agents-sdk | claude-agent-sdk |
|---|---|---|
| Sandboxed execution | ✅ Modal containers | ❌ Local only |
| GPU support | ✅ A10G, H100, A100, etc. | ❌ |
| Persistent storage | ✅ Modal Volumes | ❌ |
| Custom images | ✅ Docker/Dockerfile | ❌ |
| Network isolation | ✅ Configurable | ❌ |
| Auto-scaling | ✅ Built-in | ❌ |
| Built-in tools | ✅ Read, Write, Bash, etc. | ✅ |
| MCP servers | ✅ | ✅ |
| Host-side hooks | ✅ Intercept tool calls | ✅ |
| Host-side tools | ✅ Run on local machine | ✅ |
| Multi-turn conversations | ✅ | ✅ |
Installation
pip install modal-agents-sdk
Prerequisites
- Modal account: Sign up at modal.com
- Modal CLI: Install and authenticate
pip install modal modal setup - Anthropic API key: Create a Modal secret
modal secret create anthropic-key ANTHROPIC_API_KEY=sk-ant-...
Quick Start
import asyncio
from modal_agents_sdk import query
async def main():
async for message in query("What is 2 + 2?"):
print(message)
asyncio.run(main())
Basic Usage: `query()`
`query()` is an async function for querying Claude in a Modal sandbox. It returns an `AsyncIterator` of response messages.
from modal_agents_sdk import query, ModalAgentOptions, AssistantMessage, TextBlock
import modal
# S
Related Skills
Agency Agents
A complete AI agency at your fingertips - From frontend wizards to Reddit community ninjas, from whimsy inject
AI Firecrawl
🔥 The API to search, scrape, and interact with the web for AI
AI Artifacts Builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web tech
AI CrewAI
Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewA
AI TrendRadar
⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的
AI mem0
| Universal memory layer for AI Agents | 51341 | 221 | 1 |
AI