Back to catalog / Agent workflows
Compare context and tool-cost optimization on benchmark cases
Compare lean context, selective retrieval, subagents, and batching under the same quality threshold.
Goal
Goal: Compare lean context, selective retrieval, subagents, and batching under the same quality threshold.
Steps
- Use the cookbook’s synthetic claims and labeled expected outcomes as a fixed set; run a full-context baseline first. [cost-opt]
- Measure deferred
tool_search, on-demand manual reads, isolated subagents, and Message Batches; change one cost lever at a time. [cost-opt] - Record accuracy, calls, input tokens, and API cost; adopt a cheaper design only if accuracy meets baseline. [cost-opt]
How to verify
Each design is compared on the same cases; cost falls while accuracy stays above the chosen threshold.
Troubleshooting
Review disagreements as possible regressions; do not claim savings or unchanged quality from a single sample.
Permissions
Prerequisites
- Python 3.11+, Anthropic API key, cookbook synthetic fixtures, billing visibility, and fixed tasks.
Permissions
- Use synthetic data only; do not send real claims/customer data; run within an approved API budget.
Limitations
The optimizations are specific to synthetic insurance tasks; prices, caching, models, and tools change, so rerun on your own workload.
Pinned upstream source
- Repository
- anthropics/anthropic-cookbook
- File path
- cost_optimization/cost_optimization.ipynb
- Pinned commit
9c1e493ddd2b82df399d2a61b9c806c539e18be6- Source checked
- 2026-10-14 · Reviewed against the pinned upstream source
Repository metrics
These values describe the upstream repository, not popularity or likes for an individual skill or playbook.
- Stars
- Not collected
- Forks
- Not collected
- Observed at
- Not collected
No metrics snapshot is available yet.
License: MIT
Main topic
Turn ecommerce campaign materials into a reviewable weekly brief