Build with an AI coding agent
The context-managed-agents skill teaches an AI coding agent, such as Claude Code, which Managed Agents calls Context
serves and which it refuses. The agent picks one of two modes from your request:
- Implement writes new code against Context. The agent uses only the calls Context serves, with the client settings Context needs.
- Migrate ports an app written for Anthropic’s Managed Agents. It scans the code and flags every call Context refuses, with the exact error Context returns. It also notes calls that work but answer differently. It rewrites what can move automatically and lists the rest for you.
An unsupported call is an endpoint Context doesn’t serve, or a field, header, query parameter or value that Context refuses. The Not supported list explains each one.
Install the skill
Download context-managed-agents.zip
and unzip it. You get a context-managed-agents folder.
- Claude Code: Copy the folder into
~/.claude/skills/to use it in every project, or into your project’s.claude/skills/to share it with your team through the repository. Claude Code loads the skill when a request names Context together with Managed Agents or sessions, or names the skill. - Other agents: Put the folder in your project. In your project’s agent instructions file, tell the agent to read
context-managed-agents/SKILL.mdbefore it writes code for Context.
The migrate scanner, scripts/scan.py, needs Python 3.9 or later and uses only the standard library.
Implement: write new code
Ask for what you want and name the skill, as in this example:
Using the context-managed-agents skill, write a Python script that uploads sales.csv to our Context deployment, asks agent agt_01 for the three largest regions, and saves the files the session produces.Before it writes a call, the agent checks it against the skill’s support matrix, the list of every SDK method and
whether Context serves it. It turns off SDK retries, because sending an event isn’t idempotent. When the session
stops to wait for a tool approval, the agent answers each event ID in the idle event’s stop_reason.event_ids. If you
ask for something Context doesn’t serve, it says so and suggests what Context offers instead.
Migrate: port an app
Point the agent at the code, as in this example:
Using the context-managed-agents skill, migrate ./report-bot from Anthropic's Managed Agents to our Context deployment.The agent runs the scanner, shows you the migration plan, then writes a migrated copy for you to review. The scanner
reads .py, .ts, .mts, .tsx, .js and .mjs files and never edits them in place. To run the scanner
yourself, run these commands from the folder that contains context-managed-agents:
python3 -I context-managed-agents/scripts/scan.py ./report-bot # one finding per refused callpython3 -I context-managed-agents/scripts/scan.py ./report-bot --plan # the findings as a Markdown migration planpython3 -I context-managed-agents/scripts/scan.py ./report-bot --rewrite ./report-bot-context--rewrite writes the migrated copy to the folder you name, prints a diff, then scans the copy again and lists what
still needs a person. In every mode, the scanner exits with 1 if it reports at least one ERROR finding.
What the report looks like
Each finding gives the file and line, the catalogue ID in brackets (such as [session.budget]), the error Context
returns and the fix. An ERROR finding marks a call that Context refuses. A note finding marks a call that Context
accepts but answers differently, so check the code that reads its response. This excerpt comes from a sample app
written the way Anthropic’s docs show it:
ERROR sample-anthropic-app/report-bot.ts:7 [agent.model] const MODEL = process.env.MA_TEST_MODEL ?? "claude-haiku-5-5" Context: model: ${model} is not a model sessions run on in this deployment; send "default" or one of: ${available} rewrite (auto-fixable): Send "default" or a model id from your deployment, as a string or {id}. (docs: api-reference/managed-agents/agents/create.mdx:152)ERROR sample-anthropic-app/report-bot.ts:39 [session.budget] budget: { type: "limit", max_list_cost: { amount: "50", currency: "USD" } }, Context: Session budgets are not supported in this deployment remove (auto-fixable): Drop budget. Context does not cap a session's spend. (docs: api-reference/managed-agents/coming-from-anthropic.mdx:85)note sample-anthropic-app/report-bot.ts:50 [evaluated-permission] else if (event.type === "agent.tool_use" && event.evaluated_permission === "ask") Context: agent.tool_use carries name and input only; evaluated_permission is absent. Approvals come from stop_reason.event_ids. manual: Answer the ids in the idle event's stop_reason.event_ids instead of testing evaluated_permission. (docs: api-reference/managed-agents/coming-from-anthropic.mdx:36)ERROR sample-anthropic-app/report-bot.ts:64 [not-served.agents.archive] await client.beta.agents.archive(agent.id) Context: POST /v1/agents/{agent_id}/archive is not supported by this deployment remove (auto-fixable): Delete the call. Agents can't be archived over this API; stop creating sessions for it, or delete it in the app. (docs: api-reference/managed-agents/coming-from-anthropic.mdx:70)
12 error(s), 13 advisory note(s) in 2 file(s)auto-fixable means --rewrite makes the change. manual means a person decides, because Context has no matching feature
or the change alters what the app does.
How the skill stays accurate
A generator builds the skill’s support matrix (references/support-matrix.md) and its catalogue of unsupported calls
(references/unsupported-catalogue.md) from Context’s code, its docs and two pinned SDK releases. No one edits these
files by hand. Each starts with a stamp: the Context commit it describes and the @anthropic-ai/sdk versions it
compares.
Every pull request to Context runs the generator in check mode. The check fails if the code refuses a call that the catalogue has no entry for, so every refusal in the code has an entry. It also fails if the references differ from a fresh generation, or if the downloadable zip differs from a fresh build of the skill folder.
If your deployment runs a newer Context release than the stamp names, download the zip again. When the skill and your deployment disagree, the error the deployment returns is the final word.