Skip to content

Claude Code agents provide AgentPool's native integration with the Claude Agent SDK, enabling file operations, terminal access, and advanced code editing capabilities through Claude's official tooling.

Overview

While Claude Code can be used via the ACP bridge, AgentPool provides its own complete integration using the Claude Agent SDK directly. This approach offers several advantages:

  • Lower latency: No ACP protocol overhead between AgentPool and Claude Code
  • Tighter integration: Direct access to Claude Code's streaming, tools, and events
  • Toolset bridging: Expose AgentPool's internal toolsets to Claude Code via MCP
  • Better error handling: Native exception propagation and recovery
  • Structured outputs: Full support for typed response schemas

Claude Code agents are ideal for:

  • Complex coding tasks requiring file system access
  • Terminal operations and shell command execution
  • Multi-file refactoring and code generation
  • Tasks that need deep reasoning

Configuration Reference

Claude Code Agent Configuration

Configuration for Claude Code agents.

Claude Code agents use the Claude Agent SDK to interact with Claude Code CLI, enabling file operations, terminal access, and code editing capabilities.

Example:

agent:
  coder:
    type: claude_code
    model: claude-sonnet-4-5
    allowed_tools:
      - Read
      - Write
      - Bash
    system_prompt: "You are a helpful coding assistant."
    max_turns: 10

  planner:
    permission_mode: plan
    reasoning_effort: max
    include_builtin_system_prompt: false
    system_prompt:
      - "You are a planning-only assistant."
      - "Focus on architecture decisions."

Claude Code Agent Configuration (YAML)
type: claude_code  # Top-level discriminator for agent type.
model: opus  # Model to use for this agent. Defaults to Claude's default model.
allowed_tools: null  # List of tool names the agent is allowed to use.
disallowed_tools: null  # List of tool names the agent is NOT allowed to use.
system_prompt: null  # System prompt for the agent.
include_builtin_system_prompt: true  # Whether to include Claude Code's builtin system prompt.
max_turns: null  # Maximum number of conversation turns before stopping.
max_budget_usd: null  # Maximum budget in USD before stopping.
reasoning_effort: null  # How much the model thinks (Claude's adaptive thinking). Defaults to the CLI's setting.
permission_mode: null  # Permission handling mode:
output_type: null  # Optional structured output type for responses. Can be either a reference to a response defined in ma...
env_vars: null  # Environment variables to set for the agent process.
add_dir: null  # Additional directories to allow tool access to.
builtin_subagents: null  # Built-in subagents configuration.
builtin_tools: null  # Available tools from Claude Code's built-in set.
fallback_model: null  # Fallback model when default is overloaded.
setting_sources: null  # Setting sources to load configuration from.
use_subscription: false  # Force usage of Claude subscription instead of API key.
prompt_suggestions: false  # Predict the next user prompt after each turn.
max_processes: 8  # Most Claude Code processes kept running for sessions (one per session served).
enable_tool_search: null  # Control Claude Code's MCP tool search (deferred tool loading).
idle_compaction: true  # Compact an idle session shortly before its prompt cache expires.
sdk_options: {}  # Options of the Claude Code SDK (ClaudeAgentOptions) passed through as they are.
tools: []  # Tools and toolsets to expose to this Claude Code agent via MCP bridge.
requires_tool_confirmation: per_tool  # How to handle tool confirmation:
hooks:  # Hooks for intercepting and customizing agent behavior at key lifecycle points.
  pre_run: []  # Hooks executed before agent.run() processes a prompt.
  post_run: []  # Hooks executed after agent.run() completes.
  pre_tool_use: []  # Hooks executed before a tool is called. Can block or modify the call.
  post_tool_use: []  # Hooks executed after a tool completes.
environment: null  # Execution environment config for the agent's own toolsets.
name: null  # Identifier for the node. Set from dict key, not from YAML.
display_name: null  # Human-readable display name for the node.
description: null  # Optional description of the agent / team.
triggers: []  # Event sources that activate this agent / team
connections: []  # Targets to forward results to.
mcp_servers: []  # List of MCP server configurations:
input_provider: null  # Provider for human-input-handling.
event_handlers: []  # Event handlers for processing agent stream events.

Examples

Basic Configuration

A minimal Claude Code agent for coding tasks:

agents:
  coder:
    type: claude_code
    model: sonnet

Custom System Prompt

Add custom instructions while keeping Claude Code's built-in system prompt:

agents:
  python_dev:
    type: claude_code
    model: sonnet
    system_prompt:
      - "You are a Python expert focused on clean, maintainable code."
      - "Always include type hints and docstrings."
      - "Prefer pytest for testing."

To replace the built-in prompt entirely:

agents:
  minimal_agent:
    type: claude_code
    include_builtin_system_prompt: false
    system_prompt: "You are a focused code reviewer. Only suggest improvements."

Tool Restrictions

Control which tools the agent can use:

agents:
  reader:
    type: claude_code
    allowed_tools:
      - Read
      - Grep
      - Glob
    disallowed_tools:
      - Bash
      - Write
      - Edit

Reasoning Effort

Claude thinks adaptively; the effort sets how deeply (low, medium, high, xhigh, max):

agents:
  architect:
    type: claude_code
    model: opus
    reasoning_effort: max
    system_prompt: "You are a software architect. Think deeply about design decisions."

Clients can change the effort (and fast mode, on models that have it) while the agent runs.

Toolset Integration

Expose AgentPool's internal toolsets to Claude Code via MCP:

agents:
  coordinator:
    type: claude_code
    tools:
      - type: subagent  # delegate to the pool's other agents
      - type: vfs  # the manifest's resources

This allows Claude Code to delegate tasks to other AgentPool agents.

Structured Output

Define typed responses:

responses:
  code_review:
    response_schema:
      type: inline
      fields:
        issues:
          type: list[str]
          description: "Issues found, one per entry (file:line: message)"
        summary:
          type: str
        approved:
          type: bool

agents:
  reviewer:
    type: claude_code
    output_type: code_review
    system_prompt: "Review the code and provide structured feedback."

Environment Variables

Set environment variables for the agent:

agents:
  secure_agent:
    type: claude_code
    env_vars:
      ANTHROPIC_API_KEY: ""  # Empty forces subscription usage
      DEBUG: "1"
      CUSTOM_VAR: "value"

Permission Modes

Claude Code agents support different permission handling modes:

Mode Description
default Ask for permission on each tool use
acceptEdits Auto-accept file edits, ask for other operations
plan Plan-only mode, no execution (safe for exploration)
bypassPermissions Skip all permission checks (use with caution)

Example:

agents:
  planner:
    type: claude_code
    permission_mode: plan
    system_prompt: "Analyze the codebase and create an implementation plan."

Toolset Integration

One of the key features of Claude Code agents is the ability to expose AgentPool's internal toolsets via MCP. When you configure toolsets, they are:

  1. Started as an in-process MCP server
  2. Connected to Claude Code using the SDK's native MCP support
  3. Available as tools within Claude Code's tool palette

This enables powerful workflows:

agents:
  smart_coder:
    type: claude_code
    tools:
      # Delegate to the pool's other agents (task, list_available_nodes)
      - type: subagent

      # Access the manifest's resources
      - type: vfs

      # A function as a tool
      - type: import
        import_path: webbrowser.open

The toolsets communicate directly with Claude Code without HTTP overhead.

Comparison with ACP Agents

Feature Claude Code Agent ACP Agent (Claude Code)
Protocol overhead None (direct SDK) ACP protocol layer
Toolset integration Native MCP bridge Limited
Streaming Full native support Via ACP transport
Error handling Native exceptions Protocol-wrapped
Configuration Full control Limited to ACP options
Use case Primary integration Interop with other ACP clients

Choose Claude Code agents for:

  • Maximum performance and integration depth
  • When you need toolset bridging
  • Primary AgentPool deployments

Choose ACP agents when:

  • Interoperating with other ACP clients (Zed, Toad)
  • Using Claude Code alongside other ACP-compatible agents
  • Building ACP-first architectures