# Claude Agent SDK Hosting

> Running Agent SDK agents on your own servers. Each session is its own process.

**Field:** Artificial Intelligence  
**Category:** Claude Agent SDK  
**Also known as:** Agent SDK Hosting, Hosting the Agent SDK, Agent SDK deployment

## Think of it like

It is like giving each helper a room. Each room has a desk for its papers.

## Definition

Agent SDK hosting is how you run Agent SDK agents on your own servers. Each session starts a Claude Code process that owns a shell, a folder and its chat files on disk. So it is not like a simple web API. Each agent is a process that lives a long time and keeps files. Most teams run it in a container, starting with about 1 GiB of memory, 5 GiB of disk and one CPU per agent.

## Example

A team puts its agent in a Docker container. Each user gets a session. The chat files are copied out to a store, so a restart loses nothing.

## Why it matters

Files on a container's disk vanish when it restarts. Planning for that early saves lost sessions later.

## Common mistake

Treating it like a stateless API. Each session is a process with files, and a restart wipes them.

## Three principles

- **One process per session.** Claude Code runs inside.
- **State on disk.** Lost on restart.
- **A container each.** About 1 GiB to start.

## Related terms

- [Claude Agent SDK](https://learn.benibix.com/term/ai/claude-agent-sdk)
- [Claude Agent SDK Session Pattern](https://learn.benibix.com/term/ai/agent-sdk-session-pattern)
- [SessionStore](https://learn.benibix.com/term/ai/session-store)
- [cwd Option](https://learn.benibix.com/term/ai/cwd-option)
- [Container](https://learn.benibix.com/term/infrastructure/container)
- [Claude Agent SDK Cost Tracking](https://learn.benibix.com/term/ai/agent-sdk-cost-tracking)

![A container holds your app, which starts a Claude Code process. The process has its own shell, folder and session files on the container's disk, and it calls Claude over the internet. An arrow copies the session files out to a SessionStore so they survive a restart.](https://learn.benibix.com/diagrams/ai9-sdk-hosting.svg)

---

Source: https://learn.benibix.com/term/ai/agent-sdk-hosting
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-20
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
