Open Agent Sdk Rust banner
codeany-ai codeany-ai

Open Agent Sdk Rust

AI community

Description

Open Agent SDK - A Rust framework for building autonomous AI agents

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Open Agent SDK (Rust)

A lightweight, open-source Rust SDK for building AI agents. Run the full agent loop in-process — no CLI or subprocess required. Deploy anywhere: cloud, serverless, Docker, CI/CD.

Also available in [TypeScript](https://github.com/codeany-ai/open-agent-sdk-typescript) and [Go](https://github.com/codeany-ai/open-agent-sdk-go).

Features

  • Multi-Provider — Supports both Anthropic Messages API and OpenAI Chat Completions API, with auto-detection by model name
  • Agent Loop — Streaming agentic loop with tool execution, multi-turn conversations, and cost tracking
  • 25+ Built-in Tools — Bash, Read, Write, Edit, Glob, Grep, WebFetch, WebSearch, Agent (subagents), AskUser, Tasks, Teams, Plans, Worktrees, Todos, Cron, LSP, Config, MCP Resources, ToolSearch
  • Session Persistence — Save, load, fork, and resume conversations across sessions
  • MCP Support — Connect to MCP servers via stdio, HTTP, and SSE transports
  • Permission System — Configurable tool approval with allow/deny rules and filesystem path validation
  • Hook System — 20+ hook events: PreToolUse, PostToolUse, SessionStart/End, SubagentStart/Stop, TaskCreated/Completed, FileChanged, PreCompact/PostCompact, and more
  • Extended Thinking — Support for extended thinking with budget tokens
  • Cost Tracking — Per-model token usage and pricing for Anthropic, OpenAI, and DeepSeek models
  • Custom Tools — Implement the Tool trait to add your own tools
  • Auto-Compaction — Multi-tier context compression (micro-compact, LLM summarization, image stripping)
  • Sandbox Config — Network and filesystem restrictions for tool execution
  • File State Cache — LRU cache for file state tracking and staleness detection

Quick Start

[dependencies]
open-agent-sdk = "0.1.0"
tokio = { version = "1", features = ["full"] }
use open_agent_sdk::{Agent, AgentOptions, SDKMessage};
use open_agent_sdk::types;

#[tokio::main]
async fn main() {
    let m