Files
sherlock/internal/agent/claude.go
T
Alexandru Macocian 84958c7ef3
Release / release (push) Successful in 17s
Support for local agents
2026-06-15 19:03:56 +02:00

24 lines
917 B
Go

package agent
func init() { Register(&claude{}) }
// claude integrates Anthropic's Claude Code CLI (npm package
// `@anthropic-ai/claude-code` → `claude` on PATH). MCP config is
// passed via --mcp-config <path> in the canonical `.mcp.json` shape
// (`{"mcpServers": ...}`) — same shape Copilot uses.
//
// We also forbid ANTHROPIC_API_KEY in the child env so an
// inadvertently-set personal key can't override the broker-managed
// session. (Phase 2 will surface a proper Anthropic auth grant.)
//
// The per-CLI quirks (flag shape, env scrubbing) live in the shared
// "claude" backend; this type is just the built-in registration.
type claude struct{}
func (claude) Name() string { return "claude" }
func (claude) Description() string { return "Anthropic Claude Code CLI" }
func (c claude) Spawn(ctx Context, args []string) error {
return backends["claude"].spawn(c.Name(), "claude", ctx, args)
}