Skip to main content

Overview

This example demonstrates the agentic capabilities of Claude Code CLI by having it search through the codebase to find and explain validation examples. The AgentCtrlConsoleLogger provides full visibility into tool calls, streaming, and the agent’s decision-making process. Key concepts:
  • AgentCtrl::claudeCode(): Factory for Claude Code agent builder
  • withMaxTurns(): Allow multiple turns for exploration
  • onText() / onToolUse(): Real-time streaming callbacks
  • AgentCtrlConsoleLogger: Shows execution lifecycle alongside streaming output

Example

Expected Output

Key Points

  • Agentic search: Agent autonomously explores files and synthesizes answers
  • Full visibility: Console logger shows every tool call alongside streaming output
  • Sandbox awareness: Enable showSandbox to see sandbox initialization details
  • Multi-turn: withMaxTurns(10) allows the agent to explore iteratively