{"slug": "reducing-cost-and-improving-performance-with-claude-platform", "title": "Reducing cost and improving performance with Claude Platform", "summary": "Anthropic reported that running the `/claude-api prompt-audit` command in Claude Code removed prompting anti-patterns and cut costs by 14.6% while raising accuracy by 5.3% on average across six legacy prompts in a customer support benchmark migrating from Opus 4.8 to Opus 5. The company said the gains came from eliminating extra tool calls and duplicated reasoning, and it updated the `claude-api` skill with the audit command, which covers application code and Claude Code configuration such as CLAUDE.md. Anthropic also advised maximizing prompt cache hit rates, removing anti-patterns when upgrading to frontier Claude models, and calibrating effort to the task.", "body_md": "# Reducing cost and improving performance with Claude Platform\n\nTuning prompt caching, instructions, and effort can reduce Claude's cost without sacrificing application performance.\n\nPerformance and cost are often viewed as a trade-off: to spend less, you accept worse results. In practice, we've found that many applications using Claude Platform can cut costs without giving up performance with three fixes: maximize the prompt cache hit rate, remove anti-patterns from your prompts when upgrading to frontier Claude models, and calibrate effort to the task. We've put this guidance into the [`claude-api` skill](https://github.com/anthropics/skills/tree/main/skills/claude-api). In this article, we show how Claude Code with the `claude-api` can often find ways to reduce cost while maintaining or improving performance.\n\nBefore Claude generates a response, it first processes your prompt into an internal working state. This step, called *prefill*, is the expensive part of handling input. Prompt caching saves that state (the key–value, or KV, cache): when a request starts with the same prefix, Claude reads it back instead of recomputing it. Cache reads are [billed at a fraction](https://platform.claude.com/docs/en/about-claude/pricing) of the full input price.\n\nThere are a few practical considerations to ensure effective use of the prompt cache. First, the prompt cache is pinned to a specific model. Second, prompt cache reads must be *byte-exact* across the full span of the prompt. Finally, the prompt cache has a [limited time-to-live](https://platform.claude.com/docs/en/build-with-claude/prompt-caching#ttl-support) (TTL).\n\nWith these points in mind, there are a few practical tips:\n\nWe’ve [accumulated](https://claude.com/blog/lessons-from-building-claude-code-prompt-caching-is-everything) a few lessons for prompt cache management: \n\n`max_tokens: 0` and an explicit cache breakpoint. This processes the prompt and writes it to the cache without generating anything. If you run it at session start (for example, while a user is typing), the first real request hits a warm cache.\nPrompts can accumulate instructions that patch model weaknesses. These instructions can drift relative to the capabilities of the [latest Claude models](https://x.com/trq212/status/2080710971228918066). Here are common prompting “anti-patterns” that hobble frontier Claude model and can inadvertently increase costs:\n\nWe've updated the `claude-api` skill with a new command that watches out for these anti-patterns. In Claude Code, run `/claude-api prompt-audit` against your prompts, skills, or tool descriptions. The audit covers anything in your working directory, including application code that calls the Claude API and Claude Code's own configuration (e.g., [CLAUDE.md](http://claude.md) or skills).\n\nFor example, we tested a model migration from Opus 4.8 to Opus 5 on a customer support benchmark. We started from a clean prompt and planted one anti-pattern at a time (a retired thinking setting, a pair of contradictory refund rules, a manual scratchpad, \"verify twice\", \"be maximally thorough\", and a mandatory six-step procedure), giving six legacy prompts.\n\nWe ran each on Opus 4.8, on Opus 5 with only the model ID changed, and on Opus 5 after running `/claude-api prompt-audit` once per prompt (Figure 3 shows the average across the six).\n\nWith Opus 5, verification rituals (\"*verify twice*\") use unnecessary tokens by duplicating order lookup on every refund. Emphasis boosters (\"*be maximally thorough*\") became dozens of unneeded knowledge-base searches. \n\nRunning `/claude-api prompt-audit` removed the anti-patterns, decreasing costs by 14.6% and increasing accuracy by 5.3% on average. Cost dropped because extra tool calls and duplicated reasoning were eliminated. Accuracy rose for three reasons. The retired thinking setting made the API reject every routing request outright. The contradictory refund rules led Opus 5 to withhold four refunds it owed while it asked the customer to confirm. And the manual scratchpad collided with Opus 5's built-in thinking: on three tickets it wrote the tool call inside its reasoning and never executed it.\n\n[Effort](https://platform.claude.com/docs/en/build-with-claude/effort) tells Claude “how hard to work.” At low effort Claude generally reaches conclusions faster. At high effort, Claude deliberates, verifies, and explores alternatives before answering. \n\nCost-versus-performance across effort levels on a single model can vary. For example, Claude Fable 5 scores 11.5% at low effort for $5.35 per task on FrontierCode Diamond (the hardest 50 tasks). At max effort, Fable 5 gets 30.9% for $19.00 per task; changing effort raises the score about 2.7x (+19 points) for about 3.5x the cost (Figure 4).\n\nOn Claude Fable 5.1, Humanity's Last Exam (without tools) shows a steep curve with a diminishing last step. It scores about 53% at low effort for about $0.30 per question and about 61% at max effort for about $2.23; the last step up to max adds about half a point for 46% more cost. The gain inside the benchmark's run-to-run noise, so you pay more for no measurable gain.\n\nEffort can be miscalibrated in either direction:\n\nThere are some useful ways to calibrate effort:\n\nThis calibration often involves running an evaluation across models and effort levels. In Claude Code, `/claude-api hillclimb` performs this search for you: it splits your evaluation into train and test sets, proposes configuration changes, and reads failing train examples to fix what it finds.\n\nWe ran it on a customer support benchmark, starting from Opus 4.8 at its default (high) effort. The hillclimber first tried Opus 5 at low effort, applying prompt-audit to remove mandatory tool-call rituals, scratchpad steps, and contradictory rules. That cleared the Opus 4.8 baseline at 98.9% train accuracy and cut cost to 2.6 cents per ticket.\n\nIt then stepped down to Sonnet 5 at low effort, which was cheaper still at 1 cent per ticket, but accuracy fell to 88.9%. Reading the failing train tickets, Claude added routing rules and a refund-cap cross-reference to the prompt, bringing Sonnet 5 back to 98.9% at the same cost.\n\nOn the 14 held-out tickets the search never saw, the final configuration scored 90.5% against the original setup's 78.6%, at about one fifth the cost.\n\nPrompt caching, instructions, and effort are common levers for reducing cost. Our [documentation](https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence#cut-spend-without-losing-quality) covers even more. To run a holistic cost audit of application code that uses the Claude API, we've added `/claude-api cost-optimize`: it profiles where your spend goes, applies cost reductions, and, if you provide an evaluation, shows how savings trade off with performance.\n\n`cost-optimize` starts by finding where your tokens go: from your organization's [usage and cost reports](https://platform.claude.com/docs/en/manage-claude/usage-cost-api) if you have a Claude Admin API key, from the usage object on each API response if your application logs it, or, failing both, by reading your request-building code and estimating.\n\nIt then ranks the available savings, starting with prompt caching, trimming what each request carries (including a prompt-audit), bounding output, and [batching](https://platform.claude.com/docs/en/build-with-claude/batch-processing) unattended work. If you supply an evaluation, it goes further and computes cost and performance across effort levels and model choices. \n\nWe ran this on four public benchmarks, starting with Sonnet 5 as a baseline (Figure 7):\n\n`cost-optimize` proposed caching a shared prefix across tasks, setting low effort, and processing tasks via the Batch API. Thinking tokens fell from 102,779 to 8,284, but pass rate stayed within noise and cost dropped by ~58%.\n\nStart with `/claude-api prompt-audit` when you've migrated to a frontier Claude model and want to check your existing prompts against it. It scans the prompts, skills, and tool descriptions in your working directory. This can be application code that calls the Claude API or Claude Code's configuration (CLAUDE.md, skills). It removes common anti-patterns that hobble frontier models.\n\nReach for `/claude-api cost-optimize` when your application uses the Claude API and you want a cost audit. It profiles token spend and then tests different levers: it applies prompt-audit, but also checks for ways to lower cost via prompt caching, batching unattended work, or bounding output. If you provide an evaluation, it measures the effort and model selection trade-offs.\n\nFinally, use `/claude-api hillclimb` for an iterative search over cost and performance. Given an evaluation, Claude splits it into train and test sets, then proposes updates to your application that aim to reduce cost while maintaining baseline performance. Claude reads the failing train cases to guide the search, and the final configuration is scored on the held-out test set.\n\nTo learn more:\n\nGet the developer newsletter\n\nProduct updates, how-tos, community spotlights, and more. Delivered monthly to your inbox.", "url": "https://wpnews.pro/news/reducing-cost-and-improving-performance-with-claude-platform", "canonical_source": "https://claude.com/blog/reducing-cost-and-improving-performance-with-claude-platform", "published_at": "2026-09-10 09:09:11+00:00", "updated_at": "2026-09-10 09:24:15.877098+00:00", "lang": "en", "topics": ["ai-products", "ai-tools", "large-language-models", "developer-tools", "ai-agents"], "entities": ["Anthropic", "Claude Platform", "Claude Code", "claude-api", "Opus 4.8", "Opus 5"], "alternates": {"html": "https://wpnews.pro/news/reducing-cost-and-improving-performance-with-claude-platform", "markdown": "https://wpnews.pro/news/reducing-cost-and-improving-performance-with-claude-platform.md", "text": "https://wpnews.pro/news/reducing-cost-and-improving-performance-with-claude-platform.txt", "jsonld": "https://wpnews.pro/news/reducing-cost-and-improving-performance-with-claude-platform.jsonld"}}