Brandon Redmond's Claude SDK for Rust
Table of content

Brandon Redmond taught high school math and computer science for five years before teaching himself programming and transitioning into AI engineering. He built claude-sdk-rs, a type-safe Rust SDK that wraps the Claude Code CLI, letting Rust developers build AI agents with compile-time guarantees.
Background
- Master’s degree in Mathematics
- Former high school math and computer science teacher (5 years)
- Self-taught developer, now leading AI engineering teams
- Based in New York, NY (previously Sao Paulo, Brazil)
- Runs learn-agentic-ai.com teaching practical AI implementation
The Rust SDK Problem
When Anthropic released the Claude Code CLI, official SDKs existed for Python and TypeScript. Rust developers had to shell out to the CLI or build their own wrappers. Redmond saw this gap and filled it.
From his DEV.to announcement:
“The Rust ecosystem lacked a comprehensive, type-safe SDK for Claude AI. I discovered that while the technology was incredibly powerful, the tooling often created unnecessary barriers for developers who just wanted to build useful things.”
SDK Architecture
claude-sdk-rs wraps the Claude Code CLI with idiomatic Rust patterns:
use claude_sdk_rs::{Client, Config};
#[tokio::main]
async fn main() -> Result<(), claude_sdk_rs::Error> {
let client = Client::new(Config::default());
let response = client.query("Explain Rust ownership").send().await?;
println!("{}", response);
Ok(())
}
The builder pattern allows custom configuration:
let client = Client::builder()
.model("claude-3-sonnet-20240229")
.system_prompt("You are a Rust programming assistant")
.timeout_secs(60)
.build();
Core Features
| Feature | Description |
|---|---|
| Type-safe responses | Compile-time guarantees on response structures |
| Async-first | Built on Tokio for concurrent operations |
| Streaming | Real-time response chunks via stream().await |
| Session management | Automatic context preservation across queries |
| MCP support | Model Context Protocol tool integration |
| Security levels | Configurable permission controls (Strict/Balanced/Relaxed) |
Feature Flags
The SDK uses Cargo feature flags for modularity:
[dependencies]
claude-sdk-rs = { version = "1.0", features = ["full"] }
tokio = { version = "1.40", features = ["full"] }
| Flag | Purpose |
|---|---|
cli | Command-line interface |
analytics | Usage metrics tracking |
mcp | Model Context Protocol support |
sqlite | Persistent session storage |
full | All features enabled |
Installation
Requires Claude Code CLI:
npm install -g @anthropic-ai/claude-code
claude auth
Then add to your project:
[dependencies]
claude-sdk-rs = "1.0"
tokio = { version = "1.40", features = ["full"] }
Streaming Example
let mut stream = client.query("Write a story about robots").stream().await?;
while let Some(chunk) = stream.next().await {
match chunk {
Ok(text) => print!("{}", text),
Err(e) => eprintln!("Error: {}", e),
}
}
Key Takeaways
| Principle | Implementation |
|---|---|
| Fill ecosystem gaps | Rust had no Claude SDK, so he built one |
| Type safety matters | Compile-time checks catch integration errors |
| Modularity via features | Only include what you need |
| Open source by default | MIT license, publicly available |
Links
Next: Jesse Vincent’s Superpowers Framework
Get updates
New guides, workflows, and AI patterns. No spam.
Thank you! You're on the list.