by severity1
Unofficial Go SDK for Claude Code CLI integration. See the Claude Agent SDK documentation for more information. This project has been renamed from claude-code-sdk-go.
# Add to your Claude Code skills
git clone https://github.com/severity1/claude-agent-sdk-goUnofficial Go SDK for Claude Code CLI integration. Build production-ready applications that leverage Claude's advanced code understanding, secure file operations, and external tool integrations through a clean, idiomatic Go API with comprehensive error handling and automatic resource management.
Two powerful APIs for different use cases:

go get github.com/severity1/claude-agent-sdk-go
Prerequisites: Go 1.18+, Node.js, Claude Code ()
No comments yet. Be the first to share your thoughts!
npm install -g @anthropic-ai/claude-codeTwo APIs for different needs - Query for automation, Client for interaction
100% Python SDK compatibility - Same functionality, Go-native design
Automatic resource management - WithClient provides Go-idiomatic context manager pattern
Session management - Isolated conversation contexts with Query() and QueryWithSession()
Built-in tool integration - File operations, AWS, GitHub, databases, and more
Production ready - Comprehensive error handling, timeouts, resource cleanup
Security focused - Granular tool permissions and access controls
Context-aware - Maintain conversation state across multiple interactions
Advanced capabilities - Permission callbacks, lifecycle hooks, file checkpointing
Best for automation, scripting, and tasks with clear completion criteria:
package main
import (
"context"
"errors"
"fmt"
"log"
"github.com/severity1/claude-agent-sdk-go"
)
func main() {
fmt.Println("Claude Agent SDK - Query API Example")
fmt.Println("Asking: What is 2+2?")
ctx := context.Background()
// Create and execute query
iterator, err := claudecode.Query(ctx, "What is 2+2?")
if err != nil {
// Use error type helpers for specifi...