Skip to content

Releases: marvai-dev/claude-code-go

Release v0.3.1

30 Jul 16:13

Choose a tag to compare

Changes

  • Support prompt input streaming

Full Changelog

See all changes at: v0.3.0...v0.3.1

v0.2.0: Python SDK Alignment & Enhanced Buffer Management

23 Jul 08:39

Choose a tag to compare

🎉 Major Release: Python SDK Alignment & Enhanced Buffer Management

This release addresses buffer size issues and aligns the Go SDK with the official Python SDK for better cross-language consistency.

✨ What's New

🐍 Python SDK Alignment

  • New Query() method - Matches Python SDK's query() function for consistency
  • QueryOptions struct - Aligned with Python ClaudeCodeOptions
  • Streaming via channels - Go's equivalent to Python's async for iteration
  • Exact field names - max_turns, system_prompt, cwd, etc. match Python SDK
  • Permission modes - Support for "acceptEdits", "rejectAll", and "ask"

💾 Enhanced Buffer Management

  • Configurable limits - Default 10MB stdout / 1MB stderr with full customization
  • Automatic truncation - Graceful handling when buffer limits are exceeded
  • Timeout protection - 30-second default with context cancellation support
  • Health monitoring - Real-time buffer system health checks and metrics
  • Recovery mechanisms - Automatic fallback buffers and retry logic
  • No more OOM - Prevents unbounded memory growth from large Claude outputs

📝 Example: Python SDK Aligned Usage

// Python-style API in Go
messageCh, err := client.Query(ctx, "Write a hello world program", 
    claude.QueryOptions{
        MaxTurns:       3,
        SystemPrompt:   "You're a helpful coding assistant",
        AllowedTools:   []string{"Write", "Read", "Bash"},
        PermissionMode: "acceptEdits",
    })

for message := range messageCh {
    fmt.Println(message.Content)
}

📊 Buffer Configuration

opts := &claude.QueryOptions{
    BufferConfig: &buffer.Config{
        MaxStdoutSize:    5 * 1024 * 1024,  // 5MB
        MaxStderrSize:    1 * 1024 * 1024,  // 1MB
        BufferTimeout:    60 * time.Second,
        EnableTruncation: true,
    },
}

🔄 Backward Compatibility

All existing APIs are maintained:

  • RunPrompt(), RunPromptCtx() continue to work
  • StreamPrompt() remains unchanged
  • Existing code requires no modifications

📚 Documentation

🔧 Installation

go get github.com/marvai-dev/claude-code-go@v0.2.0

🚀 Migration Guide

  1. New users: Start with the Query() method for Python SDK alignment
  2. Existing users: Your code continues to work; migrate at your convenience
  3. Buffer issues: Configure BufferConfig in QueryOptions or RunOptions

📈 Performance

  • Memory usage capped by configurable limits
  • Streaming performance improved with buffered readers
  • Health monitoring prevents cascade failures
  • Automatic recovery reduces error rates

🙏 Acknowledgments

This release was developed to address community feedback about memory issues and maintain alignment with Anthropic's official SDKs.


Full Changelog: v0.1.15...v0.2.0

v0.1.14

23 Jul 07:14

Choose a tag to compare

Fix module path from github.com/lancekrogers/claude-code-go to github.com/marvai-dev/claude-code-go

v0.1.13

23 Jul 05:58
352503c

Choose a tag to compare

Fork of claude-code-go