AI ShortsOpen the app
Case Studies · Software ·

New Relic cut Claude Code unit costs 71%

New Relic's engineers saw AI spend grow about 275% in three months, so they added tracking and changed five settings. Cost per unit of AI text fell 71% and daily cost fell 51%, while usage volume rose 72%. The comparison covers two ten-day windows, not a controlled test, and New Relic reported the numbers.

Problem: After Claude Code became part of daily engineering work, New Relic's AI spend rose about 275% in just over three months. They had only a monthly cloud invoice and could not say which team, repository, model or session drove the cost.

What they built: They sent Claude Code's built-in OpenTelemetry data to New Relic, rolled out through managed settings, and added logging at their internal LLM gateway with prompts and responses stripped. Dashboards and alerts cover cache hit rate, response delay and errors. Then they made five changes: stopped cross-account calls so caches hit, raised cache lifetime from 5 minutes to 1 hour, enforced caching, set a mid-tier model as the default, and added tool search so tool definitions load only when needed.

Result: Reported by New Relic over two matched 10-weekday windows: cost per million tokens down 71%, daily cost down 51%, token volume up 72%, cache read rate up from 79% to 97%, MCP overhead per session down 57%, code edit acceptance above 98%.

Lesson: Measure cost per active hour, not total spend, to find misconfigurations such as disabled caching. The quality claim rests mostly on edit accept rates, and the post says its setup is not a supported New Relic product.

New to this? The key idea

A 'prompt cache' lets an AI service reuse text it has already read instead of re-reading it, like keeping a book open to the right page. Cheaper cache reads mean the same work costs far less.

Use it at work

Copy this: turn on Claude Code's OpenTelemetry export with CLAUDE_CODE_ENABLE_TELEMETRY, point OTEL_EXPORTER_OTLP_ENDPOINT at your collector, and set OTEL_LOG_USER_PROMPTS to 0 so prompts stay out. Then chart cache hit rate as cacheRead / (cacheRead + cacheWrite + input). New Relic aims for about 95% and investigates below 90%.

Watch out: the 71% is cost per million tokens; daily spend fell 51%. Two before-and-after windows are not an experiment. If your gateway spans several cloud accounts, caches are scoped per account, so check whether routing is splitting them.

Summaries are written by AI from the linked source. Always check the original.

Get AI Shorts by email

Every morning, the day's stories in one short email. Unsubscribe in one tap.