Build your first Claude Managed Agent from Claude Code
Update Claude Code, sign in to the Claude Console and add an API key. Then ask Claude Code to build a Managed Agent from the Deep Researcher template, send it a question and see the result in the Console.
What you'll learn
- How to get Claude Code to build your first Managed Agent for you, using Anthropic's ready-made Deep Researcher template
- How to send that agent a research question, get a report back, and find the run in the Claude Console
What you need
- Claude Code, updated to the latest version. The Managed Agents setup arrived in version 2.1.290, so anything older will not have it. If you have not installed it yet, follow Anthropic's setup page.
- A Claude Console account. The Console is Anthropic's website for developers. It is where you manage billing, keys and your agents. Sign in, and add a little credit if your account has none, because agents are paid for by usage.
- An API key. This is a long secret password that lets software (here, Claude Code) use your Console account. Create one in the Console's API keys area and keep it somewhere safe. Treat it like a bank card PIN.
That is the only manual setup. Claude Code does the building.
The idea
A Managed Agent is an AI agent that Anthropic hosts and runs for you on its own computers, so nothing has to stay running on your laptop. If you want the bigger picture first, read our explainer, Claude Managed Agents, Explained. In this guide you will not design an agent from scratch. You start from a template: a ready-made agent recipe that Anthropic offers in the Console's quickstart. Claude Code reads the recipe, asks you a few simple questions and sets everything up.
Steps
1. Update Claude Code and sign in
Update Claude Code to the latest version, then open it in a new, empty folder (for example one called "my first agent"). Sign in to the Console in your browser and make sure your API key is ready to hand.
2. Ask Claude Code to build the agent
Claude Code now includes a Claude API onboarding command for Managed Agents. You can give it the name of a Console quickstart template and it builds that agent for you. You do not need to remember how to type it. Just ask in plain words:
Set up my first Managed Agent using the Deep Researcher quickstart template from the Console. I'm a beginner, so explain each choice simply.
Claude Code will show you what the template does (it researches a question across the web and writes a report with sources), then ask you a few questions. Pick the recommended option when you are unsure. If it asks to install Anthropic's command line helper, or asks for your API key, say yes and follow its instructions. Only ever paste your key where Claude Code tells you to, never into a public file or a chat with someone else.
Nothing is created until you say yes, so read its summary before you approve it.
3. Send your first research question
When the agent is ready, Claude Code offers to run a test session. A session is one run of your agent: you send it a message and it gets to work. Claude Code suggests a first question, and you can swap in your own, for example:
What are the three biggest changes to UK electric car grants in the last two years? Cite your sources.
Claude Code tells you the test run has a small spending cap, then starts the session. The agent breaks your question into smaller ones, reads sources and writes a report organised by those smaller questions, ending with a short note on how confident it is and where the gaps are. This can take a few minutes.
4. See it in the Console
Claude Code gives you a link to the session in the Console. Open it to watch the agent's steps and read the finished report. Your new agent and its runs stay in your Console account, so you can come back to them later without Claude Code.
That is your first success: an agent that Anthropic runs for you, built without writing anything yourself.
Common mistakes
- Old Claude Code. If Claude Code does not seem to know about Managed Agents templates, update it and start a fresh session.
- No credit on the account. The agent cannot run on an empty balance. Add a small amount in the Console first.
- Sharing your API key. Never post it in a screenshot, a chat or a public project. If it leaks, delete it in the Console and create a new one.
Going further
- Start from your own page. You can also point the same command at a web page that describes an agent pattern, and Claude Code will build that pattern instead of a template. Just give it the link and ask.
- Try the other templates. There are nine quickstart templates in total, including a Data analyst, a Field monitor that writes a weekly what-changed brief, a Support agent and a Structured extractor. Ask Claude Code to list them and build one that fits your project.
- Only switch on web tools when needed. Anthropic's own examples now keep web search and web page reading turned off unless the job really needs them. Deep Researcher needs them, but a Structured extractor working on text you give it does not. Fewer tools means fewer surprises.
- Other coding agents. Cursor or Codex can also help you work with Managed Agents, but the guided template setup in this guide is a Claude Code feature.
Learn more in Anthropic's Managed Agents overview.