saoudrizwan / claude-dev

Autonomous coding agent right in your IDE, capable of creating/editing files, executing commands, and more with your permission every step of the way.
https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev
MIT License
4.04k stars 381 forks source link

Prompt Caching in Claude Enabled #167

Closed arwpc closed 2 weeks ago

arwpc commented 2 weeks ago

Such an amazing tool! Thanks SO much for accelerating my little development project. There will be many scary animatronics on Halloween if I can get this done!

I'm constantly running up against Claude.ai's limits - I'm a clumsy programmer with big, dumb requests of claude that chew through a lot of tokens. I'd like to enable Prompt Caching (if it isn't already) as described here:

https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching

It looks like I need to append the following to all API calls. anthropic-beta: prompt-caching-2024-07-31

How could I make this happen?

saoudrizwan commented 2 weeks ago

This is already available if you select Anthropic as your API provider!

arwpc commented 2 weeks ago

Thats great! How do you enable it, or does it already have the appropriate lines in the API key?

saoudrizwan commented 2 weeks ago

Yes it's already enabled, just select anthropic and make sure to use claude 3.5 sonnet or haiku as the model and you'll see a new 'Cache' row in the task header that shows cache reads/writes