An open-source alternative to Claude Agent SDK — lightweight, customizable, and provider-agnostic.
Open Agent SDK is a TypeScript framework for building AI agents. It provides a developer experience similar to Claude Agent SDK but with full transparency and no vendor lock-in.
Drop-in replacement with feature parity — same Agent loop, tools, sessions, permissions, and hooks. Minimal learning curve for existing Claude Agent SDK users.
Full MIT-licensed source code. Easily customize and extend with custom tools, providers, and hooks.
Pure TypeScript implementation that runs independently. No need to install or run Claude Code — works with any LLM provider directly.
Key features:
- Agent Loop — Observation-thought-action cycle for autonomous agents
- Built-in Tools — File operations (read/write/edit), shell execution, code search (glob/grep), web search
- Streaming Support — Real-time response streaming with token usage tracking
- Multi-Provider — Works with OpenAI, Google Gemini, and Anthropic
- Provider Extensibility — Add custom providers with a simple interface
- Session Management — Persistent conversations with InMemory and File storage
- Permission System — 4 permission modes (default/acceptEdits/bypassPermissions/plan)
- Hooks Framework — Event-driven extensibility (10 hook events)
- Subagent System — Delegate tasks to specialized agents
- Type Safety — Full TypeScript support with strict type constraints
- Cancellation — AbortController support for interrupting long-running operations
npm install open-agent-sdk@alphaOr with specific package manager:
# npm
npm install open-agent-sdk@alpha
# yarn
yarn add open-agent-sdk@alpha
# pnpm
pnpm add open-agent-sdk@alpha
# bun
bun add open-agent-sdk@alphaNote: Currently in alpha. Use
@alphatag to install the latest alpha version.
Requirements:
- Bun >= 1.0.0 (primary runtime)
- Node.js >= 20 (with peer dependencies)
- TypeScript >= 5.0
import { prompt } from 'open-agent-sdk';
const result = await prompt("What files are in the current directory?", {
model: 'your-model',
apiKey: process.env.OPENAI_API_KEY,
});
console.log(result.result);
console.log(`Duration: ${result.duration_ms}ms`);
console.log(`Tokens: ${result.usage.input_tokens} in / ${result.usage.output_tokens} out`);import { createSession } from 'open-agent-sdk';
const session = createSession({
model: 'your-model',
apiKey: process.env.OPENAI_API_KEY,
});
// Send message
await session.send("What is 5 + 3?");
// Stream the response
for await (const message of session.stream()) {
if (message.type === 'assistant') {
console.log(message.content);
}
}
// Continue conversation (context preserved)
await session.send("Multiply that by 2");
for await (const message of session.stream()) {
console.log(message.content);
}
session.close();See the full API Reference for detailed documentation on:
prompt()- Execute single prompts with the agentcreateSession()/resumeSession()- Manage persistent conversations- All configuration options and types
- Built-in Tools - File operations, shell execution, code search, web access
- Provider Support - OpenAI, Google Gemini, Anthropic
- Permissions - Permission modes and management
- Hooks - Event-driven extensibility
┌─────────────────────────────────────────────────────────────────────────────┐
│ Open Agent SDK │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ User Code Core SDK External │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ prompt()│──────────►│ Agent │──────────────────►│ OpenAI │ │
│ └─────────┘ │ Loop │ │ Google │ │
│ ┌─────────┐ │ │ │Anthropic│ │
│ │ Session │──────────►│ ┌─────┐ │ └─────────┘ │
│ └─────────┘ │ │Tools│ │ │
│ │ │(14) │ │ ┌─────────┐ │
│ │ └─────┘ │──────────────────►│ File │ │
│ │ ┌─────┐ │ │ Edit │ │
│ │ │Hooks│ │ │ Search │ │
│ │ │(10) │ │ │ Web │ │
│ │ └─────┘ │ │ Tasks │ │
│ └────┬────┘ └─────────┘ │
│ │ │
│ ┌────┴────┐ ┌─────────┐ │
│ │ Session │◄───────►│Storage │ │
│ │ Manager │ │Memory/ │ │
│ └─────────┘ │File │ │
│ └─────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘
Current Version: v0.1.0-alpha.0
This project is being developed in public. Follow our progress:
- Twitter: @octane0411
- Discussions: GitHub Discussions
| Version | Features | Status |
|---|---|---|
| v0.1.0-alpha | Core Agent loop, 14 tools, 3 providers, Session, Hooks, Permissions | ✅ Released |
| v0.1.0-beta | Structured outputs, File checkpointing, Session forking enhancements | 🚧 In Progress |
| v0.1.0 | Stable release | 📋 Planned |
| v0.2.0 | Browser automation, Skill system, Query class | 📋 Planned |
| v1.0.0 | Full Claude Agent SDK compatibility, Python SDK | 📋 Planned |
We're preparing comprehensive benchmarks comparing Open Agent SDK with Claude Agent SDK across various real-world scenarios:
- Code Understanding - Analyze and explain complex codebases
- File Operations - Read, write, and edit files efficiently
- Task Completion - Multi-step task execution and reasoning
- Tool Usage - Effectiveness in using built-in tools
- Performance - Response time, token usage, and accuracy
Status: 📋 Coming Soon
Results will be published in the docs/benchmarks/ directory with full methodology and reproducible test cases.
# Clone the repository
git clone https://github.com/Octane0411/open-agent-sdk.git
cd open-agent-sdk
# Install dependencies
bun install
# Run tests
bun test
# Run with coverage
bun test --coverage
# Type checking
cd packages/core && npx tsc --noEmit
# Run demo
GEMINI_API_KEY=your-key bun examples/demo.tsClaude Agent SDK is excellent but closed-source. We wanted:
- Full transparency — Open code, free to customize
- Provider independence — No lock-in to a single vendor
- Lightweight core — Focused, understandable architecture
- No Claude Code dependency — Pure TypeScript, runs independently
Contributions welcome. Please read CONTRIBUTING.md.
MIT © 2026 Octane0411