Anthropic's Apache 2.0 Commerce Agents Blueprint: Skills Over Subagents
In this article
Anthropic published anthropics/commerce-agents on September 2, 2026, releasing production-grade scaffolding for shopping and merchant agents under an Apache 2.0 license. The repository ships a shopping agent and a merchant agent, four runnable verticals (retail, travel, telecom, and entertainment), and a Claude Code plugin called commerce-builder that either scaffolds a new agent via /scaffold-commerce-agent or audits an existing one via /review-commerce-agent. The runtime requires Python 3.11+ and Node 22 with an ANTHROPIC_API_KEY, and accepts any Anthropic client, so the same codebase deploys against the Claude API, Amazon Bedrock, Microsoft Foundry, or Google Cloud Vertex AI without modification.
Two Agents, One Architectural Stance
The shopping agent embeds inside a merchant's own application and covers five declared skills: search-discovery, purchase-research, planning-goals, customer-care, and memory-personalization, wired to a StorefrontBackend that surfaces catalog, cart, order, and policy systems. The merchant agent targets store staff, handling sales-performance queries, inventory alerts, pricing and promotion recommendations, and campaign drafts through five parallel skills: performance-insights, catalog-listings, inventory-operations, pricing-promotions, and marketing-campaigns, backed by a MerchantBackend. Both run across three execution modes from a single definition of prompts, skills, tool contracts, and gates: the Messages API, the Claude Agent SDK, and Claude Managed Agents (beta).
The repository explicitly argues against both the single-big-prompt design and the subagent-per-domain pattern. A commerce session is a tightly coupled conversation: the orchestrator holds the cart, preferences, and history simultaneously, and a returns flow needs order history, the current cart, and the catalog at the same time. Each handoff to a subagent is state-lossy and, across several enterprise deployments, was measured to cost several times the tokens and add seconds of latency. Skills solve the modularity problem without that tax because skill instructions load into the agent that already holds the full context. Across those same deployments, a single agent with skills beat both competing designs on quality, often at lower cost and latency. Subagents still apply for narrow, self-contained work such as deep research. This pattern aligns with the broader finding that architectural specificity now outperforms GPU scaling alone — the gains here come from loop design, not model capacity.
The prompt-versus-skill split is governed by traffic frequency: capabilities that appear in roughly a third or more of sessions belong in the system prompt. The rest go into skills, keeping context lean for the long tail. Safety rules, brand constraints, and key user facts — including allergy data — always live in the system prompt regardless of frequency.
UI as Typed Tools and the Latency Stack
Rather than instructing the model to emit custom markup, the blueprint models each UI component as a tool: present_products, present_itinerary, and present_plan_comparison each carry typed arguments that the server validates before the client renders. Because these calls appear natively in the messages array, reloading conversation history requires no custom parser, and the agent can resolve references like "the first hotel" directly from the last presentation call.
A rendered commerce response typically runs 500–700 output tokens; without streaming that translates to multiple seconds of spinner before any content appears. Setting eager_input_streaming: true — the Agent SDK default — executes each tool call as its argument stream completes rather than waiting for the full response, which Anthropic reports cuts multi-second gaps to a few hundred milliseconds.
Prompt caching is the primary cost lever. Requests must be ordered global → session → volatile, since caching is prefix-based and placing a timestamp anywhere but the tail of the request breaks every cache entry after it. Cached reads cost one-tenth of fresh tokens, and cache writes carry approximately a 1.25x premium — meaning a prefix pays for itself on its second use. Anthropic reports that cached reads run approximately 1.5–2x faster at around 100k tokens, and that the best commerce deployments sustain 90–99% cache hit rates. Memory extraction runs asynchronously in a separate process; Anthropic measured 13% higher fact recall compared to an in-turn save tool.
Enforcement Architecture and the Gate Layer
| Action category | Examples | Enforcement point | Model role |
|---|---|---|---|
| Payments | Card charge, refund | Harness gate → existing maker-checker flow | Propose only |
| Order mutations | Order placement, cancellation | Harness gate → existing maker-checker flow | Propose only |
| Pricing & promotions | Price change, campaign launch | Harness gate → existing maker-checker flow | Propose only |
| Catalog writes | Pasted product IDs, injected reviews | Input validation in harness | No direct access |
| Cart limits | Stacking past the item cap | Server-side rule, not prompt instruction | No override |
Every write action routes through the harness, not through prompt instructions. The model proposes; the harness applies or rejects. This mirrors the infrastructure governance framing for safe agent deployment, where enforcement lives in code the model cannot inspect or influence, rather than in prompt text it can reason around.
The release of a fully gated, multi-vertical, Apache 2.0 reference implementation positions Anthropic as treating agent scaffolding as a commodity it can give away to drive Claude API adoption at the production layer. Combined with Anthropic's earlier acquisition of Stainless to strengthen SDK infrastructure, the pattern is consistent: control the defaults that practitioners reach for first, and upstream inference spend follows. Teams evaluating commerce agent stacks now have a concrete baseline to fork, instrument, and benchmark against rather than starting from a whiteboard.
Related Reading
Claude Cowork Now Shares Memory With Chat in Real Time
Anthropic merges Claude's chat and Cowork memory systems, eliminating manual re-briefing and writing context incrementally mid-session.
Anthropic Launches Claude Sonnet 5 as Lower-Cost Model for AI Agents
Claude Sonnet 5 brings stronger agentic coding, tool use, and knowledge-work performance to Anthropic's mid-tier model line while launching at a temporary lower API price.
zg Unifies ripgrep, BM25, and Vector Search in Two MCP Tools
Qwen developers release zg (zvec-grep), an Apache 2.0 npm tool that puts ripgrep, BM25, and on-device vector search behind two MCP tools — no GPU required.