Skip to main content

Overview

This example demonstrates how to use the Claude Code CLI integration to execute simple prompts. The AgentCtrl facade provides a clean API for invoking the claude CLI in headless mode with full event observability via AgentCtrlConsoleLogger. Key concepts:
  • AgentCtrl::claudeCode(): Factory for Claude Code agent builder
  • withMaxTurns(): Limit agentic loop iterations
  • AgentCtrlConsoleLogger: Shows execution lifecycle with color-coded labels

Example

Expected Output

Key Points

  • Simple execution: One method call handles the entire interaction
  • Full observability: Console logger shows request building, sandbox setup, and response parsing
  • Pipeline visibility: Enable showPipeline to see request/response internals