--- url: "https://platform.claude.com/docs/en/managed-agents/sessions" titulek: "Start a session - Claude Platform Docs" h1: "Start a session" popis: "Create a session to run your agent and begin executing tasks." jazyk: "en" kanonicka: "https://platform.claude.com/docs/en/managed-agents/sessions" drobecky: ["Managed Agents", "Start a session"] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-14 12:01:11" znaku: 11460 slov: 1712 kodovani: "utf-8" sha256: "b012777f374b483ec3d441128d00c02b22a09aec3490291e20ad245928b968ff" --- A session is an agent instance within an environment. Each session references an [agent](/docs/en/managed-agents/agent-setup) and an [environment](/docs/en/managed-agents/environments) (both created separately), and maintains conversation history across multiple interactions. Sessions follow a two-step lifecycle: first create the session, then send a user event to start work. You can also collapse both steps into one call with `initial_events`. ## Creating a session A session requires an `agent` ID and an `environment` ID. Agents are versioned resources; passing in the `agent` ID as a string creates the session with the latest agent version. ``` ant beta:sessions create \ --agent "$AGENT_ID" \ --environment-id "$ENVIRONMENT_ID" ``` To pin a session to a specific agent version, pass an object. This lets you control exactly which version runs and stage rollouts of new versions independently. ``` ant beta:sessions create <