The Claude Code Changelog
All Episodes
Claude Code 2.1.247 Adds API Cost Optimization

Claude Code 2.1.247 Adds API Cost Optimization

0:00|0:00

We break down Claude Code 2.1.247’s new /claude-api cost optimize command, which profiles API spend and helps cut costs through caching, token hygiene, batching, effort tuning, and model selection. The episode also covers the new SendFeedback tool, cleaner subagent message previews, and a speed boost for the prompt footer PR badge.


Chapter 1

Chapter 1: Profiling API Spend with cost optimize in Version 2.1.247

James Turner

So, um, brought to you by Jellypod AI, today we are jumping straight into the fresh Claude Code version 2.1.247 release. And man, Anthropic just dropped a really clever tool inside it!

Lachlan Reed

Oh yeah? What did they, uh, what did they roll out this time, mate?

James Turner

It is a new command called /claude-api cost optimize. Basically, if you have an existing codebase using the Anthropic SDK, Claude will literally profile your API spend and work through five specific levers to bring your bill down.

Lachlan Reed

Fair dinkum. Lord knows back in my early dev days I nearly melted a client budget by pushing un-cached script loops at midnight. So what are the five levers it actually looks at?

James Turner

It checks prompt caching, token hygiene, batch processing, effort level tuning, and model selection. You just run /claude-api cost optimize right inside your terminal with your code open.

Lachlan Reed

Right, so it inspects the actual code where you call the API?

James Turner

Exactly! It scans your API call sites, detects redundant un-cached context blocks, flags places where you are routing simple tasks to expensive models, and helps you make measured, one by one changes.

Lachlan Reed

Ah, measured changes, that is key! Because, you know, if you just go nuclear with aggressive prompt caching without checking your prompt structure compatibility first, stuff breaks. Or if you drop the effort level down, you might see benchmark regressions on complex tasks.

James Turner

Totally. And with batch processing, it makes sure you only shift tasks over if they do not need realtime responses. You test each change against your output quality before moving to the next one.

Lachlan Reed

That is proper smart. What else landed in 2.1.247 besides the cost profiler?

James Turner

There is a new SendFeedback tool! When something goes sideways in a session, Claude can automatically draft a feedback report for you to review and send using /feedback slash command.

Lachlan Reed

Oh, that saves you typing out a whole bug report from scratch! Can you turn it off if you do not want drafts?

James Turner

Yep, you can toggle it off with the feedbackDrafts setting. Also, cross session peer messages from subagents now collapse by default into a clean one line preview, and you just hit Control O to expand the full body.

Lachlan Reed

Thank goodness for that! My terminal transcript used to get so cluttered with background chatter. What about that little pull request badge in the footer?

James Turner

Ah, right! The prompt footer PR badge now skips its GitHub re-check on terminal refocus whenever the last check was done less than sixty seconds ago. So no more lag spikes every time you tab back into your terminal.

Lachlan Reed

Small tweaks, big difference. Beautiful stuff!