Work with sessions in the console
A session runs an agent on a task. It runs in a sandbox: an AgentCore Runtime in your account, or compute that you manage (self-hosted). You choose the sandbox, the skills, and the memory stores when you create the session, and you can't change them later. The session runs as its agent's session role.
To send messages to a session, stream its events, approve tool calls, and get results, see Work with Claude Managed Agents sessions, events, and results.
Create a session
To create a session
Do one of the following:
On the Sessions tab, choose Create session.
On an agent's page, choose Create session. The agent is selected for you.
Fill in the sections that are described in the following table.
Choose Create session.
The console opens the new session's page. Its success message links to turn on traces for the project, so that you can follow the session in Amazon CloudWatch. See Monitor agents with Amazon CloudWatch and AWS CloudTrail.
Section | What you set |
|---|---|
Session details | Session name (optional, up to 500 characters; the console suggests one). Agent (required): an active agent in the project. To create an agent in a new tab, choose Create agent. Initial message in session (optional): the agent's first task. With an initial message, the agent starts working as soon as the session is created. Without one, the session waits until a message is sent. |
Environment | Under Hosting, choose AgentCore Runtime or Self-host. For details, see Choose the session's environment. |
Memory stores (optional) | Up to 8 memory stores to attach to the session. For details, see Attach memory stores. |
Tags (optional) | Up to 50 tags for the session. For how tags work, see Resource tags. |
If the agent doesn't have a session role, the console tells you to edit the agent and choose one before you create the session.
Choose the session's environment
Under Environment, Hosting, choose one of the following:
AgentCore Runtime – Each session runs in its own isolated microVM on AgentCore Runtime. Under AgentCore Runtime, choose a Runtime in your account and Region. The list shows Runtimes that are ready. If you don't have one, choose Quick create runtime. For details, see Quick create an AgentCore Runtime. A session on AgentCore Runtime can also use files and skills from Amazon S3. See Use S3 folders and files.
Self-host – The session runs on compute that you manage, which connects to the session to run its tools. To set up that compute, see Run the tool runner in a self-hosted environment.
For a self-hosted session, you can also add skills. Skills are folders on your self-hosted machine. At the start of each session, the agent is told about the skills in those folders.
To add skills to a self-hosted session
Under Skills, choose Add skills. The Add skill side panel opens with one empty Skill path.
Enter the absolute path of a folder, such as
/home/ec2-user/skills. To add another, choose Add skill path. You can add up to 20 skill paths.Choose Save.
A skill path must start with /, can be up to 1,024 bytes, and can contain only printable ASCII characters. It can't be /mnt/memory or a folder in it, can't contain a .. folder or {session_id}, and can't contain the working folder /mnt/workspace, so / and /mnt are refused. The agent needs the read tool to load skills. If the tool is off, the console tells you to turn it on in the agent's tools.
Quick create an AgentCore Runtime
Quick create makes an AgentCore Runtime that runs the Claude Managed Agents tool runner, without leaving the session form. It opens in a side panel, so the session form keeps what you entered.
Before you start, push the tool runner image to a private Amazon ECR repository in the same Region. The image must be a Linux ARM64 image, with cma-tool-runner agentcore as its entry point.
To quick create an AgentCore Runtime
Under Environment, choose AgentCore Runtime, and then choose Quick create runtime. The Quick create AgentCore Runtime side panel opens.
Under Runtime details, enter a Name, or keep the default,
cma_tool_runner. The name must begin with a letter and can contain only letters, numbers, and underscores.ImportantIf your sessions use the session role from Set up permissions and prerequisites, that role can invoke only a Runtime named exactly
cma_tool_runner.Under Agent source, for ECR container image URI, enter the image URI with a tag or digest. You can also choose Browse images to pick an image.
Under Permission, choose the role that AgentCore runs the Runtime as. Choose Create default role to create one, or Use another role to choose a role that AgentCore can assume.
Under Security, choose a VPC, or keep the default of no VPC. If you choose a VPC, choose its Subnets and Security group.
(Optional) Under Filesystem configuration, select Session storage to keep the files in the session's working folder in storage that AgentCore manages. You can also choose Add filesystem to mount an Amazon EFS or Amazon S3 Files access point. File systems require a VPC.
Choose Save.
The panel shows its progress while it creates the role and the Runtime, and while it waits for the Runtime to be ready. This can take a few minutes. When the Runtime is ready, the panel closes and the session form selects the new Runtime.
Quick create uses Runtime platform version V2 and the microVMs compute type. You can't change the compute type after the Runtime is created. For other settings, choose Create runtime to create the Runtime in the AgentCore console.
Attach memory stores
A memory store is a collection of text files that the agent carries from one session to the next. Without one, each session starts from scratch.
To attach a memory store to a session
Under Memory stores, choose Add memory store.
For Memory store, choose an active memory store in the project.
For Access, choose Read and write or Read only.
(Optional) For Instructions, tell the agent what the store is for and when to use it, in up to 4,096 characters.
To create a memory store without leaving the form, choose Quick create memory store. The side panel asks for the store's name and description, and for its Access and Instructions in this session.
The agent needs memory tools to use a memory store: memory_read for Read only, and memory_read and memory_write for Read and write. If the agent doesn't have them, the console shows Agent doesn't have permissions. In guided setup, choose Turn on memory tools. On Create session, choose Update and create new agent version to save a new agent version with its memory tools on.
View a session
To open a session's page, choose its name on the Sessions tab or on an agent's Sessions tab. The page shows the following:
Details – The session's name, status, ID, its agent's name, ID, and ARN, the environment ARN, the initial message, and dates.
Environment – The hosting choice, and for AgentCore Runtime, the Runtime's name and its latest version.
Skills – The skill paths of a self-hosted session.
Memory stores – The attached memory stores, with the access and instructions for each.
Permission – The session role that the session runs as: by default, its agent's role. A session created with the API can run as another role.
Tags – The session's tags. To change them, choose Manage tags. You can't change the tags of an archived session.
To follow the session in Amazon CloudWatch, choose View metrics in CloudWatch. It opens the session's page in CloudWatch GenAI Observability. See Monitor agents with Amazon CloudWatch and AWS CloudTrail.
A session's status is one of the following:
Status | Meaning |
|---|---|
Idle | The session is waiting for a message. |
Running | The agent is working on a task. |
Rescheduling | The session is waiting to run again. |
Terminated | The session has ended. |
Archived | The session is archived. |
Edit a session
You can change a session's name. To change its tags, choose Manage tags in the session's Tags section. You can't change its environment, skills, memory stores, or permission. You can't edit an archived or terminated session.
To edit a session
Open the session's page, and then choose Edit. You can also select the session on the Sessions tab, and then choose Actions, Edit.
Change the Session name.
Choose Save.
Archive a session
An archived session can still be viewed, but it can't be changed or sent new messages. You can't archive a running or terminated session.
To archive a session
Open the session's page, and then choose Archive. You can also select the session on the Sessions tab, and then choose Actions, Archive.
In Archive session?, type confirm.
Choose Archive.
Delete a session
Deleting a session also deletes all of its events. You can't undo this action. You can't delete a running session.
To delete a session
Open the session's page, and then choose Delete. You can also select the session on the Sessions tab, and then choose Actions, Delete.
In Delete session, type confirm.
Choose Delete.