Feature Parity: Go vs Python SDK
~95% Feature Parity · Production Ready
v0.7.1
Go SDK Version
v0.1.18+
Python SDK Version
~95%
Feature Parity
19+
Features at 100%
Both SDKs are fully functional and production-ready. This document provides a comprehensive comparison.
Core API & Session Management
| Feature | Python | Go | Notes |
| Query (one-shot) | ✓ | ✓ | Simple one-off requests |
| Client (interactive) | ✓ | ✓ | Full bidirectional communication |
| Message streaming | ✓ | ✓ | Python: async generators, Go: channels |
| Session resumption | ✓ | ✓ | Continue previous conversations |
| Session forking | ✓ | ✓ | Branch from existing sessions |
| Message history | ✓ | ✓ | Access and replay messages |
| Model selection | ✓ | ✓ | Switch between models |
| Max turns control | ✓ | ✓ | Limit conversation length |
Message Types & Content Blocks
| Feature | Python | Go | Notes |
| User messages | ✓ | ✓ | User input handling |
| Assistant messages | ✓ | ✓ | Claude responses |
| System messages | ✓ | ✓ | System notifications |
| Result messages | ✓ | ✓ | Final cost/token info |
| Text content blocks | ✓ | ✓ | Plain text responses |
| Tool use blocks | ✓ | ✓ | Tool invocation requests |
| Tool result blocks | ✓ | ✓ | Tool execution results |
| Thinking blocks | ✓ | ✓ | Extended thinking output |
| Feature | Python | Go | Notes |
| Tool permissions | ✓ | ✓ | Permission callbacks |
| Permission modes | ✓ | ✓ | default, acceptEdits, plan, bypass |
| Tool filtering | ✓ | ✓ | AllowedTools, DisallowedTools |
| Updated input support | ✓ | ✓ | Callbacks can modify tool inputs |
MCP (Model Context Protocol) Support
| Feature | Python | Go | Notes |
| SDK MCP servers | ✓ | ✓ | Create tools in-process |
| External MCP servers | ✓ | ✓ | stdio, SSE, HTTP connections |
| Custom MCP servers | ✓ | ✓ | Implement MCPServer interface |
| MCP factory function | - | ✓ | Go-exclusive convenience API |
Hook System
| Feature | Python | Go | Notes |
| Pre-tool hooks | ✓ | ✓ | Before tool execution |
| Post-tool hooks | ✓ | ✓ | After tool execution |
| User prompt hooks | ✓ | ✓ | Before user input processing |
| Regex matching | ✓ | ✓ | Filter by tool name pattern |
| Hook continuation | ✓ | ✓ | Control execution flow |
Extended Thinking
| Feature | Python | Go | Notes |
| Extended thinking | ✓ | ✓ | Long-form reasoning |
| Max thinking tokens | ✓ | ✓ | Limit thinking output |
| Thinking blocks | ✓ | ✓ | Access reasoning process |
| Thinking control | ✓ | ✓ | Enable/disable/adaptive |
Cost Management
| Feature | Python | Go | Notes |
| Token counting | ✓ | ✓ | Input/output token counts |
| Cost summary | ✓ | ✓ | Usage statistics per message |
| Budget limiting | ✓ | ✓ | Max budget in USD |
| Cost estimation | ✓ | ✓ | Predict costs |
When to Use Each SDK
Choose Go SDK When:
- You need concurrent request handling (1M+ goroutines)
- You want strong compile-time type safety
- You need high-performance, low-latency responses
- You want single-binary deployment
- You're building microservices or cloud-native apps
Choose Python SDK When:
- You prefer Python's syntax and ecosystem
- You need rapid prototyping capabilities
- You're working with Jupyter notebooks
- You have an existing Python codebase
- You prefer async/await patterns
Both SDKs use the same control protocol, so migrating code between them is straightforward. They are also interoperable in microservice architectures.
Compatibility
Both SDKs use the same control protocol and are forward-compatible. Install the Claude Code CLI once and use both SDKs on the same machine.
| Go SDK Version | Python SDK Version | Compatible |
| v0.2.0+ | v0.1.0+ | ✓ Yes |
| v0.1.0+ | v0.1.0+ | ✓ Yes |
Further reading: Architecture Differences | Migration Guide
Found a missing feature? Open an issue