A specialized AgentDriver for the Anthropic claude (Claude Code)
CLI. Optimized for terminal-based engineering tasks.
Details
Setup: Requires claude (Anthropic CLI) to be installed and
authenticated. Configure the path via options(HydraR.claude_path = "...")
or in your .Renviron.
Super class
HydraR::AgentDriver -> AnthropicCLIDriver
Methods
Method new()
Initialize AnthropicCLIDriver
Usage
AnthropicCLIDriver$new(
id = "claude_cli",
model = "sonnet",
validation_mode = "warning",
working_dir = NULL
)Method call()
Usage
AnthropicCLIDriver$call(
prompt,
model = NULL,
system_prompt = NULL,
cli_opts = list(),
...
)Examples
if (FALSE) { # \dontrun{
# 1. Initialize the Claude Code CLI driver
driver <- AnthropicCLIDriver$new(model = "sonnet")
# 2. Execute a complex engineering task with budget constraints
# and permission skipping for non-interactive automation.
response <- driver$call(
prompt = "Refactor R/dag.R to use R6 private methods.",
cli_opts = list(
dangerously_skip_permissions = TRUE,
max_budget_usd = 5.0,
verbose = TRUE
)
)
} # }