| Surprised that "controlling cost" isn't a section in this post. Here's my attempt. --- If you get a hang of controlling costs, it's much cheaper. If you're exhausting the context window, I would not be surprised if you're seeing high cost. Be aware of the "cache". Tell it to read specific files (and only those!), if you don't, it'll read unnecessary files, or repeatedly read sections of files or even search through files. Avoid letting it search - even halt it. Find / rg can have a thousands of tokens of output depending on the search. Never edit files manually during a session (that'll bust cache). THIS INCLUDES LINT. The cache also goes away after 5-15 minutes or so (not sure) - so avoid leaving sessions open and coming back later. Never use /compact (that'll bust cache, if you need to, you're going back and forth too much or using too many files at once). Don't let files get too big (it's good hygiene too) to keep the context window sizes smaller. Have a clear goal in mind and keep sessions to as few messages as possible. Write / generate markdown files with needed documentation using claude.ai, and save those as files in the repo and tell it to read that file as part of a question.
I'm at about ~$0.5-0.75 for most "tasks" I give it. I'm not a super heavy user, but it definitely helps me (it's like having a super focused smart intern that makes dumb mistakes). If i need to feed it a ton of docs etc. for some task, it'll be more in the few $, rather than < $1. But I really only do this to try some prototype with a library claude doesn't know about (or is outdated).
For hobby stuff, it adds up - totally. For a company, massively worth it. Insanely cheap productivity boost (if developers are responsible / don't get lazy / don't misuse it). |