Skip to content

feat: Claude Agent SDK adapter (claude-sdk)#58

Merged
etylsarin merged 2 commits intomainfrom
feat/claude-agent-sdk-adapter
Mar 9, 2026
Merged

feat: Claude Agent SDK adapter (claude-sdk)#58
etylsarin merged 2 commits intomainfrom
feat/claude-agent-sdk-adapter

Conversation

@etylsarin
Copy link
Owner

Summary

Adds a new claude-sdk runtime adapter using @anthropic-ai/agent-sdk (optional peer dep) instead of spawning the CLI.

Changes

  • claude-sdk.ts: SDK adapter with lazy-init client, per-session cwd, structured responses
  • vendor.d.ts: Ambient type declarations
  • index.ts: Registered in detection order (copilot > claude-sdk > claude-code > cursor > opencode)
  • package.json: Optional peer dependency

Verification

  • tsc: zero errors
  • vitest: 569 tests passing

- New claude-sdk adapter using @anthropic-ai/agent-sdk (optional peer dep)
- SDK-based: lazy-init shared client, per-task sessions, structured responses
- Supports per-session cwd for worktree isolation (unlike copilot adapter)
- Registered in detection order: copilot > claude-sdk > claude-code > cursor > opencode
- Falls back to claude-code CLI adapter when SDK package not installed
…LI fallback

- Merge claude-code.ts + claude-sdk.ts into unified claude.ts (SDK first, CLI fallback)
- Add CLI fallback to copilot.ts (SDK first, CLI fallback)
- Delete claude-code.ts and claude-sdk.ts
- Update index.ts: 4 adapters (claude, copilot, cursor, opencode)
- Detection order: copilot > claude > cursor > opencode
- Update run.ts references from 'claude-code' to 'claude'
@etylsarin etylsarin merged commit 2b5bb3f into main Mar 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant