Class: Ralph::Agents::ClaudeCode

Inherits:
Base
  • Object
show all
Defined in:
lib/ralph/agents/claude_code.rb

Instance Method Summary collapse

Methods inherited from Base

#build_env, #collect_tool_counts, #detect_fatal_error, #execute, #extract_errors, #validate!

Methods included from Helpers

#check_completion, #escape_regex, #format_duration, #format_duration_long, #format_tool_summary, #now_ms, #strip_ansi, #which

Instance Method Details

#build_args(prompt, model, options) ⇒ Object



11
12
13
14
15
16
# File 'lib/ralph/agents/claude_code.rb', line 11

def build_args(prompt, model, options)
  args = ["-p", prompt]
  args.push("--model", model) if model && !model.empty?
  args.push("--dangerously-skip-permissions") if options && options[:allow_all_permissions]
  args
end

#commandObject



8
# File 'lib/ralph/agents/claude_code.rb', line 8

def command = "claude"

#config_nameObject



9
# File 'lib/ralph/agents/claude_code.rb', line 9

def config_name = "Claude Code"

#parse_tool_output(line) ⇒ Object



18
19
20
21
# File 'lib/ralph/agents/claude_code.rb', line 18

def parse_tool_output(line)
  match = strip_ansi(line).match(/(?:Using|Called|Tool:)\s+([A-Za-z0-9_-]+)/i)
  match ? match[1] : nil
end

#typeObject



7
# File 'lib/ralph/agents/claude_code.rb', line 7

def type = :claude_code