3. Claude Ecosystem & Beyond — Part 3: SDK, Cowork, OpenClaw & Agent Teams
3. Claude Ecosystem & Beyond — Part 3: SDK, Cowork, OpenClaw & Agent Teams
Continuation of 2ClaudeCLIpart2.md. Covers the Claude Agent SDK for building custom agents, Claude Cowork for collaborative AI workflows, OpenClaw as an open-source alternative, and experimental Agent Teams for multi-instance coordination.
Table of Contents
- Claude Agent SDK
- Claude Cowork
- OpenClaw
- Agent Teams
- Swarm vs Orchestrated Agents
- SDD — Specs Driven Design
- GSD — Get Shit Done
- Gastown — Orchestrating Swarms of Agents
Claude Agent SDK
What it is: A Python SDK for building custom AI agents powered by Claude. Instead of using Claude Code's built-in agent, you define your own agent logic — tools, workflows, guardrails, and orchestration — all in code.
Why use it: When you need agents embedded in your own application (not just the CLI), or you want full control over tool definitions, multi-step reasoning, and how agents interact with your systems.
How to get started:
# Install
pip install claude-agent-sdk
# Or with uv
uv pip install claude-agent-sdk
from claude_agent_sdk import Agent, Tool
# Define a tool
@Tool
def search_database(query: str) -> str:
"""Search the internal database."""
# your logic here
return results
# Create an agent with tools
agent = Agent(
model="claude-sonnet-4-6",
tools=[search_database],
system_prompt="You are a helpful data assistant."
)
# Run the agent
response = agent.run("Find all orders from last week")
Key concepts:
- Tools — Functions the agent can call (DB queries, API calls, file ops)
- System prompt — Sets the agent's behavior and constraints
- Multi-turn — Agent reasons across multiple steps automatically
- Guardrails — Add input/output validation to keep the agent safe
Docs: https://docs.anthropic.com/en/docs/agents-and-tools/claude-agent-sdk
Claude Cowork
What it is: A collaborative mode where Claude works alongside you in real-time on shared tasks — like pair programming but with AI. It's designed for ongoing, session-based collaboration rather than one-shot prompts.
Why use it: When your task benefits from back-and-forth iteration — designing architecture, debugging complex issues, writing and reviewing code together, or brainstorming solutions where context builds over time.
How to get started:
- Visit https://claude.com and start a conversation
- Use Projects to give Claude persistent context (files, instructions)
- Attach files, share your screen, or paste code for real-time collaboration
- Claude remembers the full conversation context within the session
Best for:
- Architecture discussions and design reviews
- Iterative debugging sessions
- Document drafting with feedback loops
- Exploring trade-offs before committing to an approach
OpenClaw
Not part of Claude — this is an independent open-source project.
What it is: An open-source alternative to Claude Code CLI. It provides a terminal-based AI coding agent that works with multiple LLM providers (not just Anthropic).
Why use it: If you want a Claude Code-like experience but with the flexibility to use different models (OpenAI, local models via Ollama, etc.), or you want to contribute to and customize an open-source tool.
How to get started:
# Install
npm install -g openclaw
# Or run directly
npx openclaw
Key differences from Claude Code:
- Open-source and community-driven
- Multi-provider support (Anthropic, OpenAI, local models)
- Customizable and extensible
- Free to use (you bring your own API keys)
Repo: https://opencode.ai/
Agent Teams
Experimental feature that coordinates multiple Claude Code instances working together on a shared task.
How it works:
- One instance acts as the team lead, assigning tasks
- Others are teammates that work and interact independently
- Teammates can message each other directly (unlike sub-agents which only report back)
When to use Agent Teams:
- Parallel research across different topics
- Debugging with different hypotheses simultaneously
- Working on independent modules at the same time
- Splitting work across layers (frontend, backend, AI, etc.)
Docs: https://code.claude.com/docs/en/agent-teams
Sub-agents vs Agent Teams
| Sub-agents | Agent Teams | |
|---|---|---|
| Context | Own context window; results return to caller | Own context window; fully independent |
| Communication | Report results back to main agent only | Teammates message each other directly |
| Coordination | Main agent manages all work | Shared task list with self-coordination |
| Best for | Focused tasks where only the result matters | Complex work requiring discussion and collaboration |
| Token cost | Lower: results summarized back to main context | Higher: each teammate is a separate Claude instance |
Setup
Step 1 — Enable the experimental feature in .claude/settings.json:
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
},
"teammateMode": "in-process"
}
Step 2 — Prompt Claude to create a team:
"Create an agent team to [describe the task]"
Step 3 — Use keyboard shortcuts:
| Shortcut | Action |
|---|---|
Shift+Tab |
Switch to delegate mode |
Shift+Up/Down |
Select a teammate |
Step 4 — Manage the team:
"Wait for your teammates to complete their tasks before proceeding"
"Ask the researcher teammate to shut down"
"Clean up the team"
Warning: Agent Teams is highly experimental. Invest in your
CLAUDE.mdfor clear instructions, expect higher token costs, and be willing to start over. Powerful but chaotic — keep testing.
Example Prompt for Multi-Agent Teams
Create an Agent Team to complete the project as defined. Team-members: a Front-end engineer to work on the frontend, a Backend API Engineer on the backend, a Database Engineer on all DB related code, an LLM Engineer on the LLM calls. While all team-members should work on unit tests, there should be an Integration Tester team-member that builds and runs end-to-end Playwright tests when ready, reporting issues back to be fixed by the team-members. Finally, a Devops engineer for the Docker container and the scripts.
Swarm vs Orchestrated Agents
Two patterns for multi-agent coordination:
Swarm Agents
- Agents operate autonomously with minimal central control
- Each agent decides what to do based on its own observations
- Good for: exploration, parallel search, creative brainstorming
- Trade-off: less predictable, harder to debug
Orchestrated Agents
- A central orchestrator assigns tasks and collects results
- Agents follow explicit instructions from the coordinator
- Good for: structured workflows, pipelines, reliable multi-step tasks
- Trade-off: single point of failure at the orchestrator
Agent Teams support both patterns depending on how you prompt the team lead.
SDD — Specs Driven Design
A development methodology where you write detailed specifications before writing any code. The AI agent (Claude Code, Agent Teams, etc.) receives a complete spec document and implements it end-to-end, reducing ambiguity and back-and-forth.
How it works:
- Write a detailed spec (features, API contracts, data models, edge cases)
- Feed the spec to Claude Code or an Agent Team
- The agent implements the spec with minimal guesswork
- Review, iterate on the spec, re-run
Why use it: Specs act as a contract between you and the AI — the clearer the spec, the better the output. Eliminates the "that's not what I meant" problem.
GSD — Get Shit Done
A framework and workflow tool for AI-assisted development that focuses on structured task execution.
Link: https://gsd.build/
What it does:
- Provides a structured workflow for breaking projects into actionable tasks
- Designed to work with AI coding agents (Claude Code, Cursor, etc.)
- Focuses on getting from idea to shipped code with minimal friction
Gastown — Orchestrating Swarms of Agents
An open-source framework by Steve Yegge for orchestrating swarms of AI agents working together on large codebases.
Repo: https://github.com/steveyegge/gastown
What it does:
- Coordinates multiple AI agents working on a shared codebase simultaneously
- Uses a swarm pattern — agents operate semi-autonomously with loose coordination
- Designed for large-scale refactoring, migrations, and codebase-wide changes
When to use it:
- Codebase-wide refactors that touch hundreds of files
- Large migrations (framework upgrades, API changes)
- When Agent Teams isn't enough and you need more agents with finer control
How it differs from Agent Teams:
- Agent Teams is built into Claude Code; Gastown is a standalone framework
- Gastown is optimized for swarm-scale work (many agents, large repos)
- Agent Teams uses a team-lead model; Gastown uses decentralized coordination