Source code for pyralph.agents.claude

"""Claude CLI Agent implementation."""
import shutil
from typing import List, Optional
from .base import BaseAgent


[docs] class ClaudeAgent(BaseAgent): """Interface to the Claude CLI agent."""
[docs] def get_name(self) -> str: """Get the display name of this agent.""" return "Claude"
[docs] def check_dependencies(self) -> bool: """Check if Claude CLI is available.""" return shutil.which("claude") is not None
def _build_command(self, prompt: str) -> List[str]: cmd = [shutil.which("claude"), "-p", "--dangerously-skip-permissions"] if self.model: cmd.extend(["--model", self.model]) if self.max_tokens is not None: cmd.extend(["--max-tokens", str(self.max_tokens)]) return cmd def _prepare_input(self, prompt: str) -> Optional[str]: return prompt