@go-hare/claude-agent-sdk
v0.3.178
Published
SDK for building AI agents with Claude Code's capabilities. Programmatically interact with Claude to build autonomous agents that can understand codebases, edit files, and execute workflows.
Downloads
300
Maintainers
Readme
Claude Agent SDK
The Claude Agent SDK enables you to programmatically build AI agents with Claude Code's capabilities. Create autonomous agents that can understand codebases, edit files, run commands, and execute complex workflows.
Learn more in the official documentation.
Get started
Install the Claude Agent SDK:
npm install @go-hare/claude-agent-sdkCompiled binaries (bun build --compile)
When bundling your application into a single executable with bun build --compile, the SDK cannot resolve the native CLI binary at runtime — require.resolve doesn't work from inside the compiled $bunfs (or B:\~BUN\... on Windows) virtual filesystem.
Embed the platform-specific binary as a file asset, extract it to a real path, and pass it explicitly:
import binPath from '@go-hare/claude-code-darwin-arm64/claude' with { type: 'file' }
import { extractFromBunfs } from '@go-hare/claude-agent-sdk/extract'
import { query } from '@go-hare/claude-agent-sdk'
const cliPath = extractFromBunfs(binPath)
for await (const message of query({
prompt: '…',
options: { pathToClaudeCodeExecutable: cliPath },
})) { /* … */ }Each compiled executable embeds one platform's binary, matching your --target. Cross-compiling requires installing the non-matching platform package (e.g. npm install @go-hare/claude-code-linux-x64 --force). On Windows the binary subpath is /claude.exe (e.g. @go-hare/claude-code-win32-x64/claude.exe).
Migrating from the Claude Code SDK
The Claude Code SDK is now the Claude Agent SDK. Please check out the migration guide for details on breaking changes.
Reporting Bugs
We welcome your feedback. File a GitHub issue to report bugs or request features.
Connect on Discord
Join the Claude Developers Discord to connect with other developers building with the Claude Agent SDK. Get help, share feedback, and discuss your projects with the community.
Data collection, usage, and retention
When you use the Claude Agent SDK, we collect feedback, which includes usage data (such as code acceptance or rejections), associated conversation data, and user feedback submitted via the /bug command.
How we use your data
See our data usage policies.
Privacy safeguards
We have implemented several safeguards to protect your data, including limited retention periods for sensitive information and restricted access to user session data.
For full details, please review our Commercial Terms of Service and Privacy Policy.
