Varto
Хочете будувати кар’єру в Data Science та AI? Vodafone Big Data Lab відкриває новий набір —>

"The most expensive thing is the "tail" you drag behind you": AI Architect told how not to overpay for long-term sessions in Claude

Working with modern large language models requires not only competent prompting, but also an understanding of the economics of the context window. AI Architect and Software Engineer Denis Klymenko shared his experience in systematically optimizing the costs of using artificial intelligence tools.

Leave a comment
"The most expensive thing is the "tail" you drag behind you": AI Architect told how not to overpay for long-term sessions in Claude

Working with modern large language models requires not only competent prompting, but also an understanding of the economics of the context window. AI Architect and Software Engineer Denis Klymenko shared his experience in systematically optimizing the costs of using artificial intelligence tools.

According to IT specialists, the main reason for high bills for using the Claude model line lies in the specifics of data processing: the model does not have its own internal memory, so with each new message, the user sends the entire previous dialogue again.

"The most expensive thing about working with Claude is not the answers themselves. It's the "tail" that you drag behind you. The context grows linearly, and the bill grows quadratically: the fiftieth request drags behind the forty-nine previous ones. 98% of all tokens are a rereading of what has already been said, that is, a cache. Two-thirds of the bill goes there," explains Denis Klymenko in his post on LinkedIn.

Figures and cost statistics

Based on an analysis of his own work program (30 sessions, 857 million tokens with a total check of $582), the engineer makes the following observations:

  • The Opus model costs $0.121 per request in a long session and $0.078 in a short session. The difference is 36% for the same quality of work;

  • sessions with a context volume of over 300,000 tokens accounted for 58% of the total cache read bill;

  • The most resources are consumed by command outputs in the terminal (36–42%) and read project files (another 28%).

"A session starts with 40,000 tokens (global and local rules, skills, memory), and peaks reached 405,000. Once you dumped a long log into the chat - and you pay for it on every subsequent request until the end of the session. There is no "remove this from here" button, the only way to get rid of the excess is to close the session," notes AI Architect.

Practical tips for budget optimization

  1. A new window for a new topic: for questions not on the main topic, it is worth opening a separate session, because Claude sees all parallel windows.

  2. Control of /clear and /compact commands: use /clear after completing a task, and /compact only during long conversations of the same type. Since compression resets the cache, it is not advisable to use it every five minutes.
  3. Point context: Don't send full logs of hundreds of lines or the entire project if the issue only concerns one specific feature.

The specialist concludes that a working session in which the total context volume does not exceed 200,000 tokens is ideal.

“Half a day instead of two hours”: how a Fullstack developer resisted token costs when creating an AI bot
“Half a day instead of two hours”: how a Fullstack developer resisted token costs when creating an AI bot
On the topic
“Half a day instead of two hours”: how a Fullstack developer resisted token costs when creating an AI bot
Microsoft employee spent $28,000 on AI in one month. Now the company is imposing token limits
Microsoft employee spent $28,000 on AI in one month. Now the company is imposing token limits
On the topic
Microsoft employee spent $28,000 on AI in one month. Now the company is imposing token limits
“We should tax AI and robot tokens.” Bill Gates reveals his vision for changes in the job market in the AI ​​era
“We should tax AI and robot tokens.” Bill Gates reveals his vision for changes in the job market in the AI ​​era
On the topic
“We should tax AI and robot tokens.” Bill Gates reveals his vision for changes in the job market in the AI ​​era
Ukrainian IT guy created a CLI tool that simplifies front-end development with AI and saves tokens
Ukrainian IT guy created a CLI tool that simplifies front-end development with AI and saves tokens
On the topic
Ukrainian IT guy created a CLI tool that simplifies front-end development with AI and saves tokens
Read the country's main IT news in our Telegram
Read the country's main IT news in our Telegram
On the topic
Read the country's main IT news in our Telegram
Also Read
Roosh запускає нову освітню платформу AI HOUSE CLUB для ML/AI-спеціалістів та дата сайнтистів. Розповідаємо, як подати заявку та чому навчатимуть
Roosh запускає нову освітню платформу AI HOUSE CLUB для ML/AI-спеціалістів та дата сайнтистів. Розповідаємо, як подати заявку та чому навчатимуть
Roosh запускає нову освітню платформу AI HOUSE CLUB для ML/AI-спеціалістів та дата сайнтистів. Розповідаємо, як подати заявку та чому навчатимуть
Як нейромережі бачать вільну та незалежну Україну? Тест dev.ua
Як нейромережі бачать вільну та незалежну Україну? Тест dev.ua
Як нейромережі бачать вільну та незалежну Україну? Тест dev.ua
Нейронні мережі для генерації зображень бачать світ по-своєму, їхню логіку зрозуміти часом зовсім неможливо. Але таки хочеться. На честь Дня Незалежності України редакція dev.ua вирішила провести невеликий експеримент. Ми задали чотирьом різним нейронним мережам п’ять однакових запитів: «прапор України», «День Незалежності України», «український Крим», «перемога України» та «українці». Отриманими результатами ми ділимося з вами нижче.
У TikTok тепер можна генерувати фон за допомогою нейромережі. Ми протестували її та ділимося результатами
У TikTok тепер можна генерувати фон за допомогою нейромережі. Ми протестували її та ділимося результатами
У TikTok тепер можна генерувати фон за допомогою нейромережі. Ми протестували її та ділимося результатами
У TikTok з’явилася нова функція «Розумний фон». З її допомогою як фон для тіктоків можна підставляти згенеровані нейромережею зображення. Редакція dev.ua протестувала цю технологію і ділиться своїми враженнями.
1 comment
Які IT-спеціальності будуть потрібні в найближчі п'ять років? Ми з'ясували у голови американського стартапу ADAM Дениса Гурака
Які IT-спеціальності будуть потрібні в найближчі п'ять років? Ми з'ясували у голови американського стартапу ADAM Дениса Гурака
Які IT-спеціальності будуть потрібні в найближчі п'ять років? Ми з'ясували у голови американського стартапу ADAM Дениса Гурака

Have important news to share? Message our Telegram bot

Key events and useful links in our Telegram channel

Discussion
No comments yet.