Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/skills/conductor/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Validate, run, and execute workflows; creating new workflows when e

# Conductor

CLI tool for defining and running multi-agent workflows with the GitHub Copilot SDK or Anthropic Claude.
CLI tool for defining and running multi-agent workflows with the GitHub Copilot SDK, Anthropic Claude, or Claude Agent SDK.

> **DO NOT create new workflow files unless the user explicitly asks you to create one.** Default to running, validating, or debugging existing workflows. If the user's request is ambiguous, assume they want to run or modify an existing workflow rather than create a new one.

Expand Down
14 changes: 7 additions & 7 deletions .claude/skills/conductor/references/yaml-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Complete reference for all YAML configuration options. Derived from the Pydantic

```yaml
workflow: WorkflowDef # Required: workflow configuration
tools: [string] # Optional: workflow-level tool names
tools: [string] # Optional: workflow-level tool names (ignored by claude-agent-sdk — uses CLI config)
agents: [AgentDef] # Required: agent definitions
parallel: [ParallelGroup] # Optional: static parallel groups
for_each: [ForEachDef] # Optional: dynamic parallel groups
Expand All @@ -27,14 +27,14 @@ workflow:

# Runtime configuration
runtime:
provider: string # "copilot" (default) or "claude"
provider: string # "copilot" (default), "claude", or "claude-agent-sdk"
default_model: string # Default model for all agents
temperature: float # 0.0-1.0, controls randomness (optional)
max_tokens: integer # Max OUTPUT tokens per response, 1-200000 (optional)
timeout: float # Per-request timeout in seconds (optional, default: 600)
temperature: float # 0.0-1.0, controls randomness (optional, copilot/claude only)
max_tokens: integer # Max OUTPUT tokens per response, 1-200000 (optional, copilot/claude only)
timeout: float # Per-request timeout in seconds (optional, default: 600, copilot/claude only)
max_agent_iterations: integer # Max tool-use roundtrips per agent (1-500, optional)
max_session_seconds: float # Wall-clock timeout per agent session in seconds (optional)
mcp_servers: # MCP server configurations
mcp_servers: # MCP server configurations (ignored by claude-agent-sdk — uses CLI config)
<server_name>:
type: string # "stdio" (default), "http", or "sse"
command: string # Command to run (required for stdio)
Expand Down Expand Up @@ -93,7 +93,7 @@ agents:
type: string # "agent" (default), "human_gate", "script", or "workflow"
description: string # What this agent does
model: string # Override default_model
provider: string # Per-agent provider override ("copilot" or "claude")
provider: string # Per-agent provider override ("copilot", "claude", or "claude-agent-sdk")

# Input specification (for explicit context mode)
input:
Expand Down
11 changes: 10 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ make validate-examples # validate all examples
- `base.py` - `AgentProvider` ABC defining `execute()`, `validate_connection()`, `close()`
- `copilot.py` - GitHub Copilot SDK implementation
- `claude.py` - Anthropic Claude API implementation
- `claude_agent_sdk.py` - Claude Agent SDK implementation (uses `claude-agent-sdk` package)
- `factory.py` - Provider instantiation

- **gates/**: Human-in-the-loop support
Expand Down Expand Up @@ -146,7 +147,7 @@ Use `pytest.mark.performance` for performance tests (exclude with `-m "not perfo

### Provider Parity

All providers (`copilot.py`, `claude.py`) must maintain feature parity. Any change to one provider's behavior, contract, or capabilities must be applied to all providers. This includes:
All providers must maintain feature parity where applicable. Any change to one provider's behavior, contract, or capabilities must be applied to all providers. This includes:

- **Event callbacks**: Same event types emitted at the same semantic points
- `agent_turn_start` with `{"turn": "awaiting_model"}` — immediately before each API call
Expand All @@ -160,3 +161,11 @@ All providers (`copilot.py`, `claude.py`) must maintain feature parity. Any chan
- **Session management**: Same lifecycle (`validate_connection()`, `execute()`, `close()`)

When modifying any provider, check all other providers for the same change. The dashboard, JSONL logger, console subscriber, and workflow engine all depend on consistent behavior across providers.

#### `claude_agent_sdk.py` parity notes

The Claude Agent SDK provider (`claude_agent_sdk.py`) delegates the agentic loop to the `claude` CLI via the `claude-agent-sdk` package. This achieves **event and output parity** but the following are managed by the SDK rather than Conductor:

- **Retry and error handling**: The SDK handles retries, backoff, and parse recovery internally. The provider wraps SDK errors in `ProviderError` but does not implement its own retry logic.
- **Tool execution**: Tools and MCP servers are managed by the `claude` CLI's own configuration. Workflow-level `tools` and `runtime.mcp_servers` fields are ignored.
- **Runtime config**: `temperature`, `max_tokens`, and `timeout` are not configurable per-workflow — they are controlled by the CLI.
29 changes: 21 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Conductor provides the patterns that work: evaluator-optimizer loops for iterati
## Features

- **YAML-based workflows** - Define multi-agent workflows in readable YAML
- **Multiple providers** - GitHub Copilot or Anthropic Claude with seamless switching
- **Multiple providers** - GitHub Copilot, Anthropic Claude, or Claude Agent SDK with seamless switching
- **Parallel execution** - Run agents concurrently (static groups or dynamic for-each)
- **Script steps** - Run shell commands and route on exit code without an AI agent
- **Conditional routing** - Route between agents based on output conditions
Expand Down Expand Up @@ -155,13 +155,13 @@ conductor stop

Conductor supports multiple AI providers. Choose based on your needs:

| Feature | Copilot | Claude |
|---------|---------|--------|
| **Pricing** | Subscription ($10-39/mo) | Pay-per-token |
| **Context Window** | 8K-128K tokens | 200K tokens |
| **Tool Support (MCP)** | Yes | Planned |
| **Streaming** | Yes | Planned |
| **Best For** | Heavy usage, tools | Large context, pay-per-use |
| Feature | Copilot | Claude | Claude Agent SDK |
|---------|---------|--------|------------------|
| **Pricing** | Subscription ($10-39/mo) | Pay-per-token | Via Claude Code CLI |
| **Context Window** | 8K-128K tokens | 200K tokens | 200K tokens |
| **Tool Support (MCP)** | Yes | Planned | Yes (built-in) |
| **Streaming** | Yes | Planned | Yes |
| **Best For** | Heavy usage, tools | Large context, pay-per-use | Full Claude Code toolset |

### Using Claude

Expand All @@ -174,6 +174,19 @@ workflow:

Set your API key: `export ANTHROPIC_API_KEY=sk-ant-...`

### Using Claude Agent SDK

```yaml
workflow:
runtime:
provider: claude-agent-sdk
default_model: claude-sonnet-4-6
```

Requires the `claude` CLI to be installed and authenticated. Install the SDK: `uv add claude-agent-sdk`

> **Note:** The `claude-agent-sdk` provider delegates tool and MCP server management to the `claude` CLI. Workflow-level `tools` and `runtime.mcp_servers` fields are ignored — configure these through your Claude Code settings instead.

**See also:** [Claude Documentation](docs/providers/claude.md) | [Provider Comparison](docs/providers/comparison.md) | [Migration Guide](docs/providers/migration.md)

## CLI Reference
Expand Down
2 changes: 1 addition & 1 deletion docs/cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ conductor run <workflow.yaml> [OPTIONS]
|--------|-------|-------------|
| `--input NAME=VALUE` | `-i` | Workflow input (repeatable) |
| `--input.NAME=VALUE` | | Alternative input syntax |
| `--provider PROVIDER` | `-p` | Override provider (copilot, claude) |
| `--provider PROVIDER` | `-p` | Override provider (copilot, claude, claude-agent-sdk) |
| `--dry-run` | | Show execution plan without running |
| `--skip-gates` | | Auto-select first option at human gates |
| `--quiet` | `-q` | Minimal output (agent lifecycle and routing only) |
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The `runtime` section of your workflow defines provider settings and global defa
```yaml
workflow:
runtime:
provider: copilot # or 'claude'
provider: copilot # or 'claude' or 'claude-agent-sdk'
default_model: gpt-5.2
# Provider-specific settings...
```
Expand Down
84 changes: 69 additions & 15 deletions docs/providers/comparison.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Provider Comparison: Copilot vs Claude
# Provider Comparison: Copilot vs Claude vs Claude Agent SDK

This guide helps you choose between GitHub Copilot and Anthropic Claude providers for your workflows.
This guide helps you choose between GitHub Copilot, Anthropic Claude, and Claude Agent SDK providers for your workflows.

## Quick Comparison

| Feature | Copilot | Claude | Winner |
|---------|---------|--------|--------|
| **Context Window** | 8K-128K | 200K (all models) | Claude |
| **Pricing Model** | Subscription ($10-39/mo) | Pay-per-token | Depends |
| **Setup** | GitHub auth | API key | Copilot (easier) |
| **Model Selection** | GPT-5.2, o1 | Haiku, Sonnet, Opus | Tie |
| **Streaming** | Yes | No (Phase 1) | Copilot |
| **Tool Support** | Yes (MCP) | No (Phase 1) | Copilot |
| **Speed** | Fast | Fast | Tie |
| **Output Quality** | Excellent | Excellent | Tie |
| **Cost Predictability** | High (flat rate) | Variable (usage-based) | Copilot |
| **Multi-provider** | No | Yes (via Conductor) | Claude |
| Feature | Copilot | Claude | Claude Agent SDK |
|---------|---------|--------|------------------|
| **Context Window** | 8K-128K | 200K (all models) | 200K |
| **Pricing Model** | Subscription ($10-39/mo) | Pay-per-token | Via Claude Code CLI |
| **Setup** | GitHub auth | API key | `claude` CLI auth |
| **Model Selection** | GPT-5.2, o1 | Haiku, Sonnet, Opus | Haiku, Sonnet, Opus |
| **Streaming** | Yes | No (Phase 1) | Yes |
| **Tool Support** | Yes (MCP) | No (Phase 1) | Yes (built-in) |
| **Speed** | Fast | Fast | Fast |
| **Output Quality** | Excellent | Excellent | Excellent |
| **Cost Predictability** | High (flat rate) | Variable (usage-based) | Variable |
| **Agentic Loop** | SDK-managed | Manual (provider code) | SDK-managed |

## When to Use Copilot

Expand Down Expand Up @@ -111,6 +111,51 @@ agents:
prompt: "Analyze the following document ({{ document | length }} chars)"
```

## When to Use Claude Agent SDK

### ✅ Choose Claude Agent SDK if:

1. **You want built-in tool support with Claude models**
- WebSearch, WebFetch, Bash, file operations out of the box
- No MCP server configuration needed for common tools
- Full Claude Code toolset available

2. **You already use the `claude` CLI**
- Authentication handled by the CLI
- No separate API key management
- Settings inherited from your Claude Code environment

3. **You want the SDK to manage the agentic loop**
- Retry logic, tool execution, and structured output handled by the SDK
- Less provider code to maintain
- Native interrupt support

4. **You need streaming with Claude models**
- Real-time message streaming (unlike the raw Claude provider)
- Typed message objects for each event

### Important: Tools and MCP Servers

The `claude-agent-sdk` provider delegates tool and MCP server management entirely to the `claude` CLI. This means:

- Workflow-level `tools` and `runtime.mcp_servers` fields are **ignored** — configure tools and MCP servers through your Claude Code settings instead
- The full Claude Code toolset (WebSearch, Bash, Read, Write, etc.) is available automatically
- `temperature`, `max_tokens`, and `timeout` are also managed by the CLI and not configurable per-workflow

### Example Claude Agent SDK Workflow

```yaml
workflow:
name: sdk-workflow
runtime:
provider: claude-agent-sdk
default_model: claude-sonnet-4-6

agents:
- name: researcher
prompt: "Research {{ topic }} using web search"
```

## Cost Comparison

### Scenario 1: Light Usage (10 hours/month)
Expand Down Expand Up @@ -298,6 +343,8 @@ Use this matrix to decide:
| Process long documents | **Claude** |
| Complex reasoning tasks | **Claude** (Opus) |
| Simple high-volume tasks | **Claude** (Haiku 4.5) |
| Already use `claude` CLI | **Claude Agent SDK** |
| Want streaming with Claude | **Claude Agent SDK** |

## Multi-Provider Strategy

Expand Down Expand Up @@ -347,4 +394,11 @@ workflow:
- ✅ Long document processing
- ✅ Cost optimization (Haiku)

**Bottom line**: Both are excellent. Choose based on your usage patterns, budget, and feature requirements. Conductor makes it easy to switch between them or use both strategically.
**Choose Claude Agent SDK** for:
- ✅ Built-in tools (WebSearch, Bash, etc.)
- ✅ Streaming with Claude models
- ✅ SDK-managed agentic loop
- ✅ Existing `claude` CLI users
- ✅ No API key management

**Bottom line**: All three are excellent. Choose based on your usage patterns, budget, and feature requirements. Conductor makes it easy to switch between them or use all three strategically.
53 changes: 53 additions & 0 deletions examples/test-claude-agent-sdk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Simple Question-Answering Workflow using Claude Agent SDK
#
# This example demonstrates a basic linear workflow with a single agent
# that answers questions. It shows:
# - Basic workflow structure
# - Input parameters
# - Output schema validation
# - Simple routing to $end
#
# Usage:
# conductor run examples/test-claude-agent-sdk.yaml --input question="What is Microsoft Conductor?"
#
# Note: Requires Claude Code CLI installed and configured. Adjust the runtime model as needed based on your Claude Code setup.

workflow:
name: simple-qa
description: A simple question-answering workflow with a single agent
version: "1.0.0"
entry_point: answerer

runtime:
provider: claude-agent-sdk
default_model: claude-haiku-4-5@20251001 # Vertex AI naming; it depends on the backedend your Claude Code setup uses. Adjust as needed.

input:
question:
type: string
required: true
description: The question to answer

agents:
- name: answerer
description: Answers the user's question clearly and concisely
prompt: |
You are a helpful assistant and researcher. Please answer the following question
clearly and concisely:

Question: {{ workflow.input.question }}

Provide a direct answer without unnecessary preamble.
output:
answer:
type: string
description: The answer to the question
confidence:
type: string
description: Confidence level (high, medium, low)
routes:
- to: $end

output:
answer: "{{ answerer.output.answer }}"
confidence: "{{ answerer.output.confidence }}"
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ dependencies = [
"uvicorn>=0.30.0",
"websockets>=12.0",
"httpx>=0.27.0",
"claude-agent-sdk>=0.1.64",
]

[project.optional-dependencies]
claude-agent-sdk = [
"claude-agent-sdk>=0.1.0",
]

[project.urls]
Expand Down
4 changes: 2 additions & 2 deletions src/conductor/config/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ class AgentDef(BaseModel):
type: Literal["agent", "human_gate", "script", "workflow"] | None = None
"""Agent type. Defaults to 'agent' if not specified."""

provider: Literal["copilot", "claude"] | None = None
provider: Literal["copilot", "claude", "claude-agent-sdk"] | None = None
"""Provider override for this agent.

If None (default), the agent uses the workflow.runtime.provider.
Expand Down Expand Up @@ -630,7 +630,7 @@ def validate_type_requirements(self) -> MCPServerDef:
class RuntimeConfig(BaseModel):
"""Provider and runtime configuration."""

provider: Literal["copilot", "openai-agents", "claude"] = "copilot"
provider: Literal["copilot", "openai-agents", "claude", "claude-agent-sdk"] = "copilot"
"""SDK provider to use for agent execution."""

default_model: str | None = None
Expand Down
2 changes: 2 additions & 0 deletions src/conductor/providers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@

from conductor.providers.base import AgentOutput, AgentProvider
from conductor.providers.claude import ClaudeProvider
from conductor.providers.claude_agent_sdk import ClaudeAgentSdkProvider
from conductor.providers.copilot import CopilotProvider
from conductor.providers.factory import create_provider

__all__ = [
"AgentOutput",
"AgentProvider",
"ClaudeAgentSdkProvider",
"ClaudeProvider",
"CopilotProvider",
"create_provider",
Expand Down
Loading