Settings

Theme

Claude Agent SDK vs. Messages API for a Production AI Assistant?

2 points by makeavish a month ago · 4 comments · 1 min read


We're building a chat assistant into our B2B developer tool. It needs to call domain-specific tools (MCP), stream responses (SSE), and persist conversation history.

The Claude Agent SDK looks like it would save us a lot of work — agent loop, compaction, hooks, session management all built in. But the more we look at it, the more the architecture feels oriented toward single-user CLI use. The subprocess spawn overhead (~12s per call), filesystem-based sessions, memory issues in long-running processes, and the Node.js subprocess dependency inside our Python backend all makes look like not fit.

The other path is building the agent loop ourselves on the Messages API. Cleaner fit for a web backend, but obviously more work upfront.

Has anyone here gone through this decision? Would especially love to hear from folks who tried the SDK in a multi-tenant setting and can share what worked and what didn't. Also curious about anyone who started with the SDK and migrated away, or vice versa.

SerafimKorablev a month ago

we went through this exact thing. started on vercel ai sdk, migrated to claude code sdk hoping to get the full agent loop out of the box. same conclusion - it's built for single-user cli, not multi-tenant web backends. so we ended up building everything ourselves on top of it. e2b sandboxing per session, env var isolation so credentials can't be exfiltrated from the sandbox, sse streaming, persistent threads, cost tracking, logs and session replay. then the ui side - claude code has plan mode, ask user, permission prompts as native cli tools but none of that translates to a web app, so we had to rebuild all of it as react components. after a few months of this we realized every team shipping agents on claude code or codex is solving the same problems, so we turned our infra into a separate product. docs here if useful - https://21st.dev/agents/docs

makeavishOP a month ago

Claude launched Managed Agents which fulfills our usecase! https://platform.claude.com/docs/en/managed-agents/overview

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection