1. Conduid
  2. Developer Tools
  3. Claude Agent SDK Go
MCP server · Developer Tools

Claude Agent SDK Go

Go SDK for Claude Code – build AI agents with tool use, MCP integration, and streaming

Unclaimed MIT last commit 6 months ago devtools
61Good

Scored yesterday · breakdown

About Claude Agent SDK Go

Claude Agent SDK Go is an MCP server published by Roasbeef in the Developer Tools category: go SDK for Claude Code – build AI agents with tool use, MCP integration, and streaming. It has been installed 0 times through Conduid.

The repository has 13 stars and 5 forks, with the last commit 6 months ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues (0) before depending on it in production.

Install

Install
npx claude-agent-sdk-go

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

Ask AI about Claude Agent SDK Go

Powered by Claude · Grounded in docs

I know everything about Claude Agent SDK Go. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

  • ·README presentNot checked yet.
  • ·License declaredNot checked yet.
  • ·Tests presentNot checked yet.
  • ·Dependencies pinnedNot checked yet.
  • ·No dynamic code executionNot checked yet.
  • !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.

Releases

v1.1.0v1.1.0 · 8 Jun 2026In this release, we bring the Go SDK to full parity with the v0.3.150 TypeScript Agent SDK, by way of the complete v0.2.119 catchup series. This is the largest release since v1.0.0: roughly 70 commits spanning new options, an expanded hook…
v1.0.9v1.0.9 · 24 Apr 2026What's Changed transport: wire Betas and ExcludeDynamicSystemPromptSections to CLI by @erickcestari in https://github.com/Roasbeef/claude-agent-sdk-go/pull/21 transport: wire ForkFrom to --resume <id> --fork-session args by @erickcestari…
v1.0.7v1.0.7 · 13 Feb 2026What's Changed protocol: omit continue field from Stop hook responses by @Roasbeef in https://github.com/Roasbeef/claude-agent-sdk-go/pull/17 Full Changelog**: https://github.com/Roasbeef/claude-agent-sdk-go/compare/v1.0.6...v1.0.7
v1.0.5v1.0.5 · 5 Feb 2026What's Changed Fix transport bugs: stderr callback, add-dir flags, scanner buffer, permission responses by @Roasbeef in https://github.com/Roasbeef/claude-agent-sdk-go/pull/15 Full Changelog**:…
v1.0.4v1.0.4 · 1 Feb 2026What's Changed feat: add Task List CRUD system for multi-agent coordination by @Roasbeef in https://github.com/Roasbeef/claude-agent-sdk-go/pull/14 Full Changelog**: https://github.com/Roasbeef/claude-agent-sdk-go/compare/v1.0.3...v1.0.4

README

claude-agent-sdk-go

A pure Go SDK for Claude's agentic capabilities.

Overview

claude-agent-sdk-go provides a native Go interface to Claude Code by managing the CLI as a subprocess. It communicates via line-delimited JSON over stdin/stdout, giving you access to Claude's tool use, extended thinking, session management, and hook system.

This repository tracks the official TypeScript Agent SDK surface through the v0.2.119 catchup work, using Go idioms where the API shape differs.

flowchart TB
    subgraph SDK[Go SDK]
        Client --> Protocol --> Transport
        MCP[SDK MCP] <-.->|tool calls| Protocol
    end
    Transport <-->|stream-json| CLI[Claude CLI]
    CLI <--> API[Claude API]

When you call Query() or Stream(), the SDK spawns the CLI, sends your prompt, and yields messages as they arrive. For MCP tools, the flow includes bidirectional control messages:

sequenceDiagram
    participant App as Go App
    participant CLI as Claude CLI
    participant API as Claude API

    App->>CLI: prompt (stdin)
    CLI->>API: API request
    API-->>CLI: response stream
    CLI-->>App: messages (stdout)
    CLI->>App: mcp_message (tool call)
    App-->>CLI: mcp_response
    CLI-->>App: result

Installation

go get github.com/roasbeef/claude-agent-sdk-go

Requirements:

  • Go 1.23+ (for iter.Seq)
  • Claude Code CLI: npm install -g @anthropic-ai/claude-code
  • ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN in your environment

Quick Start

package main

import (
    "context"
    "fmt"
    "log"

    "github.com/roasbeef/claude-agent-sdk-go"
)

func main() {
    client, err := claudeagent.NewClient(
        claudeagent.WithSystemPrompt("You are a helpful assistant."),
    )
    if err != nil {
        log.Fatal(err)
    }
    defer client.Close()

    ctx := context.Background()
    for msg := range client.Query(ctx, "What is the capital of France?") {
        switch m := msg.(type) {
        case claudeagent.AssistantMessage:
            fmt.Println(m.ContentText())
        case claudeagent.ResultMessage:
            fmt.Printf("Cost: $%.4f\n", m.TotalCostUSD)
        }
    }
}

Streaming

For multi-turn conversations:

stream, _ := client.Stream(ctx)
defer stream.Close()

stream.Send(ctx, "Let's plan a trip to Japan.")

for msg := range stream.Messages() {
    if m, ok := msg.(claudeagent.AssistantMessage); ok {
        fmt.Println(m.ContentText())
    }
}

// Continue the conversation
stream.Send(ctx, "What about Kyoto?")

Configuration

client, _ := claudeagent.NewClient(
    claudeagent.WithModel("claude-sonnet-4-5-20250929"),
    claudeagent.WithSystemPrompt("You are an expert Go developer."),
    claudeagent.WithPermissionMode(claudeagent.PermissionModeAcceptEdits),
    claudeagent.WithMaxTurns(20),
)

Settings can be supplied either as a settings file path or as inline JSON:

client, _ := claudeagent.NewClient(
    claudeagent.WithSettingsPath("/path/to/settings.json"),
)

client, _ = claudeagent.NewClient(
    claudeagent.WithSettings(claudeagent.Settings{
        Model: "claude-sonnet-4-5-20250929",
        Permissions: &claudeagent.SettingsPermissions{
            Allow: []string{"Bash(git status)"},
        },
    }),
)

Custom Tools (MCP)

Define tools that Claude can use during conversations:

type AddArgs struct {
    A int `json:"a"`
    B int `json:"b"`
}

server := claudeagent.CreateMcpServer(claudeagent.McpServerOptions{
    Name: "calculator",
    Tools: []claudeagent.ToolRegistrar{
        claudeagent.Tool("add", "Add two numbers",
            func(ctx context.Context, args AddArgs) (claudeagent.ToolResult, error) {
                return claudeagent.TextResult(fmt.Sprintf("%d", args.A+args.B)), nil
            },
        ),
    },
})

client, _ := claudeagent.NewClient(
    claudeagent.WithMcpServer("calculator", server),
)

See MCP Tools for typed responses, binary servers, and more.

Ralph Wiggum Loop

For complex iterative tasks, use the Ralph Wiggum loop. Claude works on a task repeatedly, seeing its previous work each iteration, until it outputs a completion signal:

loop := claudeagent.NewRalphLoop(claudeagent.RalphConfig{
    Task:              "Implement a Redis cache layer with tests",
    CompletionPromise: "TASK COMPLETE",
    MaxIterations:     10,
})

for iter := range loop.Run(ctx, claudeagent.WithModel("claude-sonnet-4-5-20250929")) {
    fmt.Printf("Iteration %d\n", iter.Number)
    if iter.Complete {
        fmt.Println("Task completed!")
        break
    }
}

fmt.Printf("Total cost: $%.4f\n", loop.TotalCost())

The loop intercepts session exit via a Stop hook and reinjects the task prompt if the completion promise (<promise>TASK COMPLETE</promise>) hasn't been detected. See Ralph Loop for details.

Documentation

For detailed guides and examples, see docs/examples/:

  • MCP Tools - Integrate custom tools via Model Context Protocol
  • Hooks - Intercept and modify Claude's execution
  • Subagents - Define and monitor specialized agents
  • Questions - Handle interactive questions from Claude
  • Sessions - Persist and resume conversations
  • Permissions - Control what Claude can do
  • Streaming - Real-time response handling
  • Skills - Filesystem-based capability extensions
  • Ralph Loop - Iterative task completion pattern
  • Task Lists - Multi-agent task coordination system

TypeScript SDK Parity

The v0.2.119 catchup adds coverage for recent Agent SDK and Claude Code CLI surfaces, including:

  • thinking effort, task budgets, debug files, extra CLI args, agent selection, and prompt/agent progress toggles
  • programmatic subagents, richer hook inputs/outputs, permission updates, and MCP HTTP/SSE configuration
  • stream control and introspection helpers, runtime MCP server updates, file/read-state/plugin control, and local JSONL session helpers
  • explicit settings support via WithSettingsPath, WithSettings, and WithManagedSettings

Some areas remain intentionally limited by the CLI or integration harness: desktop/IDE-only settings are not modeled exhaustively, several runtime control paths have unit coverage plus skipped integration slots until stable live CLI fixtures exist, and alpha task/agent behavior should still be checked against the installed Claude Code CLI version.

For internal architecture, see DESIGN.md. For CLI protocol details (how this and the official Typescript SDK actually work), see cli-protocol.md.

Testing

go test ./...

License

MIT

README mirrored from the source repository yesterday. The original is authoritative.

Questions

About Claude Agent SDK Go

How do I install Claude Agent SDK Go?

Run npx claude-agent-sdk-go, then add the server to your MCP client's configuration. Conduid has recorded 0 installs, so the command is known to work with current clients.

Is Claude Agent SDK Go safe to use with an AI agent?

Its trust score is 61 out of 100 (good). It passes 0 of 1 static security checks; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Claude Agent SDK Go still maintained?

Yes — the latest release is v1.1.0 (8 Jun 2026), and the last commit was 6 months ago. The repository has 13 stars and 0 open issues.