Skip to contents

A specialized AgentDriver for the Anthropic claude (Claude Code) CLI. Optimized for terminal-based engineering tasks.

Value

An AnthropicCLIDriver object.

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

Public fields

model

String. Default model.

Methods

Inherited methods


Method new()

Initialize AnthropicCLIDriver

Usage

AnthropicCLIDriver$new(
  id = "claude_cli",
  model = "sonnet",
  validation_mode = "warning",
  working_dir = NULL
)

Arguments

id

Unique identifier.

model

String. Default model.

validation_mode

String. "warning" or "strict".

working_dir

String. Optional. Path to isolated Git worktree.

Returns

A new `AnthropicCLIDriver` object. Call the LLM


Method call()

Usage

AnthropicCLIDriver$call(
  prompt,
  model = NULL,
  system_prompt = NULL,
  cli_opts = list(),
  ...
)

Arguments

prompt

String.

model

String override.

system_prompt

String. Optional system prompt.

cli_opts

List.

...

Additional arguments.

Returns

String. Cleaned result.


Method clone()

The objects of this class are cloneable with this method.

Usage

AnthropicCLIDriver$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

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
  )
)
} # }