Documentation
¶
Index ¶
- type ClaudeAgent
- func (c *ClaudeAgent) Execute(ctx context.Context, task agent.TaskSpec, opts agent.ExecOptions) (*agent.ExecResult, error)
- func (c *ClaudeAgent) Plan(ctx context.Context, initialPrompt string, opts agent.PlanOptions) (*agent.Plan, error)
- func (c *ClaudeAgent) Review(ctx context.Context, diff string, opts agent.ReviewOptions) (*agent.ReviewResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClaudeAgent ¶
type ClaudeAgent struct {
BinaryPath string // Path to `claude` CLI (default: "claude")
Model string // Model override (optional)
}
ClaudeAgent implements agent.Agent using the Claude Code CLI.
func New ¶
func New(binaryPath, model string) *ClaudeAgent
New creates a new ClaudeAgent with the given binary path and model. If binaryPath is empty, defaults to "claude".
func (*ClaudeAgent) Execute ¶
func (c *ClaudeAgent) Execute(ctx context.Context, task agent.TaskSpec, opts agent.ExecOptions) (*agent.ExecResult, error)
Execute runs the configured agent in headless mode to complete a task. The task body is passed as the prompt (-p), and the system prompt provides worker instructions. The agent commits as it works in the repo. If the agent returns suspicious output (empty, "Execution error", or very short), Execute retries once after a 5s delay before returning an error.
func (*ClaudeAgent) Plan ¶
func (c *ClaudeAgent) Plan(ctx context.Context, initialPrompt string, opts agent.PlanOptions) (*agent.Plan, error)
Plan launches Claude Code in interactive mode for a planning session. After the agent exits, it reads and parses the plan JSON from opts.OutputPath.
func (*ClaudeAgent) Review ¶
func (c *ClaudeAgent) Review(ctx context.Context, diff string, opts agent.ReviewOptions) (*agent.ReviewResult, error)
Review runs the configured agent in headless mode to review a diff. The agent checks acceptance criteria and looks for issues. Returns a structured review result parsed from the agent's JSON output.