You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 471cd5e
Browse filesBrowse the repository at this point in the historyBrowse files
description: Build a shopping agent and a merchant agent on Claude using Claude for commerce, an open-source blueprint with working implementations on the Messages API, the Claude Agent SDK, and Claude Managed Agents.
5
5
---
6
6
7
-
This guide shows how to build commerce agents on Claude: a shopping agent that customers use inside your app, and a merchant agent for the people running the store, whether that is the business's own operations staff or the sellers on its platform. It does that through Claude for commerce, an open-source blueprint with a working implementation of each agent on the [Messages API](https://platform.claude.com/docs/en/build-with-claude/working-with-messages), the [Claude Agent SDK](https://code.claude.com/docs/en/agent-sdk/overview), and [Claude Managed Agents](https://platform.claude.com/docs/en/managed-agents/overview), runnable examples for retail, travel, telecom, and entertainment, and a Claude Code plugin that scaffolds the same design against your own systems.
7
+
This guide shows how to build commerce agents on Claude: a shopping agent that customers use inside your app, and a merchant agent for the people running the store, whether that is the business's own operations staff or the sellers on its platform. It does that through Claude for commerce, an open-source blueprint that includes the following:
8
+
9
+
* A working implementation of each agent on the [Messages API](https://platform.claude.com/docs/en/build-with-claude/working-with-messages), the [Claude Agent SDK](https://code.claude.com/docs/en/agent-sdk/overview), and [Claude Managed Agents](https://platform.claude.com/docs/en/managed-agents/overview)
10
+
* Runnable examples for retail, travel, telecom, and entertainment
11
+
* A Claude Code plugin that scaffolds the same design against your own systems
8
12
9
13
The code, setup instructions, and safety documentation are in the [Claude for commerce repository on GitHub](https://github.com/anthropics/commerce-agents). For how the agents are built and why, including the single-agent-with-skills design, UI components as tools, harness-enforced safety, prompt caching, memory, and evals, read the engineering post [A guide to the anatomy of effective commerce agents](https://claude.com/blog/the-anatomy-of-effective-commerce-agents).
You will be acting as a customer support ticket classification system.
@@ -1411,7 +1411,7 @@ A proper evaluation requires clear thresholds and benchmarks to determine what i
1411
1411
***Accuracy:** 95% (out of 100 tests)
1412
1412
***Cost per classification:** 50% reduction on average (across 100 tests) from current routing method
1413
1413
1414
-
Having these thresholds allows you to tell at scale, and with impartial empiricism, what method is best for you and what changes might need to be made to better fit your requirements.
1414
+
Having these thresholds allows you to tell at scale, and with impartial empiricism, what method is best for you and what changes you might need to make to better fit your requirements.
Copy file name to clipboardExpand all lines: content/en/agents-and-tools/agent-skills/best-practices.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -909,7 +909,7 @@ def process_file(path):
909
909
returnopen(path).read()
910
910
```
911
911
912
-
Configuration parameters should also be justified and documented to avoid "voodoo constants" (Ousterhout's law). If you don't know the right value, how will Claude determine it?
912
+
Also justify and document configuration parameters to avoid "voodoo constants" (Ousterhout's law). If you don't know the right value, how will Claude determine it?
Copy file name to clipboardExpand all lines: content/en/agents-and-tools/agent-skills/claude-api-skill.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -183,7 +183,7 @@ Let Claude Code set up your agent for you
183
183
/claude-api managed-agents-onboard
184
184
```
185
185
186
-
The skill runs an interview that walks you through the Managed Agents mental model (Agent configs versus Sessions), templates an agent config, configures environments and tools, sets up the session loop, and emits runnable code for your language. The skill also covers the mandatory **Agent (once) → Session (every run)** flow: `model`, `system`, and `tools` live on the agent, never on the session, and agents should be created once and referenced by ID.
186
+
The skill runs an interview that walks you through the Managed Agents mental model (Agent configs versus Sessions), templates an agent config, configures environments and tools, sets up the session loop, and emits runnable code for your language. The skill also covers the mandatory **Agent (once) → Session (every run)** flow: `model`, `system`, and `tools` live on the agent, never on the session, and you create each agent once and reference it by ID.
187
187
188
188
Managed Agents requires the `managed-agents-2026-04-01` beta header, which the SDK sets automatically for all `client.beta.agents.*`, `client.beta.environments.*`, `client.beta.sessions.*`, and `client.beta.vaults.*` calls.
Copy file name to clipboardExpand all lines: content/en/agents-and-tools/agent-skills/enterprise.md
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,19 @@ Before deploying any Skill from a third party or internal contributor, complete
46
46
47
47
### Skill content scanning
48
48
49
-
Claude Enterprise organizations can turn on automated security scanning for custom Skills in claude.ai and Claude Cowork. After you turn on **Skill and plugin security scanning** at [claude.ai > Organization settings > Skills](https://claude.ai/admin-settings/skills), Skills that members then upload or edit in claude.ai or Cowork are scanned for signs of malicious behavior, such as hidden code execution, sending your data to an outside service, or instructions that tamper with Claude's safeguards. A Skill that fails the scan, or whose scan hasn't completed, is blocked from use. An administrator can allow some Skills that failed the scan. A Skill that passes with a warning stays usable behind a caution notice. If scanning is available to your organization, turn it on. It complements, but doesn't replace, the [review checklist](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/enterprise#review-checklist).
49
+
Claude Enterprise organizations can turn on automated security scanning for custom Skills in claude.ai and Claude Cowork. The setting is **Skill and plugin security scanning** at [claude.ai > Organization settings > Skills](https://claude.ai/admin-settings/skills).
50
+
51
+
After you turn on the setting, scanning applies to Skills that members then upload or edit in claude.ai or Cowork. Each scan checks for signs of malicious behavior. These signs include hidden code execution, transfer of your data to an outside service, and instructions that tamper with Claude's safeguards.
52
+
53
+
Whether a Skill is usable depends on its scan:
54
+
55
+
* A Skill that fails the scan is blocked from use.
56
+
* A Skill whose scan hasn't completed is blocked from use.
57
+
* A Skill that passes with a warning stays usable behind a caution notice.
58
+
59
+
Organization owners can allow some Skills that failed the scan. So can members whose [custom role](https://platform.claude.com/docs/en/manage-claude/user-management#custom-roles) can manage **Libraries**.
60
+
61
+
If scanning is available to your organization, turn it on. Scanning complements, but doesn't replace, the [review checklist](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/enterprise#review-checklist).
50
62
51
63
Scanning doesn't cover the Claude API. Skills you upload through the Skills API (`/v1/skills`), including from the Claude Console, aren't scanned, so for API deployments, rely on the review checklist and [version pinning](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/enterprise#versioning-strategy). Scanning also doesn't apply to Skills that were already in your organization when you turned it on, or to organizations with certain data handling configurations, such as customer-managed encryption keys (CMEK), zero data retention (ZDR), or HIPAA readiness. For setup steps, exclusions, and result types, see [Get started with skill and plugin scanning](https://support.claude.com/en/articles/15927065-get-started-with-skill-and-plugin-scanning) in the Claude Help Center.
@@ -530,7 +530,7 @@ An MCP server can change its tools at any time. The `mcp-client-2026-09-15` beta
530
530
531
531
When the API asks an MCP server for its tools while producing a response, the response starts with an `mcp_tool_listing` block for that server, one block for each server it asked:
Copy file name to clipboardExpand all lines: content/en/agents-and-tools/mcp-tunnels/deploy-compose.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -383,7 +383,7 @@ This guide provides one reference approach using Docker Compose. You are respons
383
383
</Tab>
384
384
</Tabs>
385
385
386
-
The compose file reads `TUNNEL_TOKEN` from the host environment with no default, so the export must be repeated in every fresh shell and after a reboot.
386
+
The compose file reads `TUNNEL_TOKEN` from the host environment with no default, so you must repeat the export in every fresh shell and after a reboot.
387
387
388
388
For a multi-VM deployment, copy the `mcp-tunnel/` directory to each host, set `TUNNEL_TOKEN`, and run `docker compose up -d`. In the programmatic flow `TUNNEL_TOKEN` is `$(sudo cat data/tunnel-token)`; in the manual flow it's the value you copied from the Console. The same tunnel token and certificates work across all replicas.
Copy file name to clipboardExpand all lines: content/en/agents-and-tools/tool-use/advisor-tool.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -300,7 +300,7 @@ The advisor tool also accepts the generic properties available on any tool defin
300
300
301
301
When the advisor is called, a `server_tool_use` block is followed by an `advisor_tool_result` block in the assistant's content. The following example shows the plaintext `advisor_result` variant returned by a Claude Opus 4.8 advisor. The [Quick start](https://platform.claude.com/docs/en/agents-and-tools/tool-use/advisor-tool#quick-start) uses Claude Opus 5.5, which returns the encrypted `advisor_redacted_result` variant instead; see [Result variants](https://platform.claude.com/docs/en/agents-and-tools/tool-use/advisor-tool#result-variants) for both shapes side by side.
302
302
303
-
```text
303
+
```json
304
304
{
305
305
"role": "assistant",
306
306
"content": [
@@ -349,7 +349,7 @@ Here is the same request sent twice, identical except for the advisor `model` in
349
349
350
350
With `"model": "claude-opus-4-8"`, the advice is plaintext:
351
351
352
-
```text
352
+
```json
353
353
{
354
354
"type": "advisor_tool_result",
355
355
"tool_use_id": "srvtoolu_abc123",
@@ -362,7 +362,7 @@ With `"model": "claude-opus-4-8"`, the advice is plaintext:
362
362
363
363
With `"model": "claude-opus-5-5"`, the advice is encrypted:
364
364
365
-
```text
365
+
```json
366
366
{
367
367
"type": "advisor_tool_result",
368
368
"tool_use_id": "srvtoolu_abc123",
@@ -383,7 +383,7 @@ In both cases, round-trip the content verbatim on subsequent turns. If you switc
383
383
384
384
If the advisor call fails, the result carries an error:
385
385
386
-
```text wrap
386
+
```json
387
387
{
388
388
"type": "advisor_tool_result",
389
389
"tool_use_id": "srvtoolu_abc123",
@@ -1250,7 +1250,7 @@ A `message_delta` event follows with the updated `usage.iterations` array reflec
1250
1250
1251
1251
Advisor calls run as a separate sub-inference billed at the advisor model's rates. Usage is reported in the `usage.iterations[]` array:
1252
1252
1253
-
```text wrap
1253
+
```json
1254
1254
{
1255
1255
"usage": {
1256
1256
"input_tokens": 1760,
@@ -1777,7 +1777,7 @@ Hard reasoning tasks elicit substantially longer advisor output than the [typica
1777
1777
1778
1778
When the advisor does hit the cap, the result block carries `stop_reason: "max_tokens"` on both [result variants](https://platform.claude.com/docs/en/agents-and-tools/tool-use/advisor-tool#result-variants), whichever advisor model you use. Use `stop_reason` to detect truncated advice and decide whether to raise the cap or let the executor proceed with partial guidance. The API also appends `[Advisor output truncated at max_tokens=2048.]` (naming your cap) to the advice text, so the executor receives the truncation notice in its own context; with a plaintext `advisor_result` advisor that marker is visible to your client as well. Both signals appear only when you set `max_tokens` on the tool definition.
0 commit comments