Free · Daily brief + weekly playbookDaily 60-sec AI Voice Brief + Weekly Production AI Agent PlaybookGet the brief →
ReleaseInsight · On RadarHabr AI→ original

AI Council cut its share of the Claude Code token bill in half, and the total bill by 15%

AI Council stores project rules and history for an AI agent, but in the previous Keycloak run, working with it came out 30% more expensive. You don't pay for the volume of text, but for how many times it gets re-read: the model re-reads the entire context on every request. After the trimming, AI Council's own share of the bill fell by more than half, and the bill for the three large tasks as a whole fell 15%. Knowledge is cheaper to supply selectively, not as a bulk dump at the start.

AI-processed from Habr AI; edited by Hamidun News
AI Council cut its share of the Claude Code token bill in half, and the total bill by 15%
Source: Habr AI. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceHabr AI ↗
Editor-in-Chief
99% of tokens are cheap cache reads347 of 351 million without AI Council
Key metric #2Agent tests with AI Council missed no more than 1 of 14 errors in all 6 runs
Key metric #3On the largest task (GNAP), the AI Council variant is still more expensive

If you give an AI agent memory about a project, sooner or later you run into the bill: the knowledge seems small, yet the payments keep growing. The AI Council team, which makes a product that supplies agents like Claude Code with team decisions, its rules, and code history, published the second part of its measurement on Habr. In the first part, on Keycloak (an open-source authorization server), the agent with AI Council wrote code that was easier to accept in review, but the work cost 30% more.

Now the authors broke the price down into parts and tried to lower it. The result: their own share of the bill fell by more than half, while the full cost of working with AI Council fell 15%.

What you are actually paying for

The agent works in a loop: it sends a request to the model, gets a response with a tool call, executes it, appends the result to the context, and sends the next request. The model remembers nothing, so each time it receives the entire accumulated context: the system prompt, the task, the files it has read, tool responses, and its own earlier reasoning. To keep this from ruining the budget, the provider caches the beginning of the context: the part already seen is read at a low rate, the new part is written at a higher rate, and the model's response costs the most.

In the runs, 99% of tokens turned out to be cache reads. Without AI Council, the three large tasks consumed about 351 million tokens, of which 347 million were cache reads and only 1.3 million were output. From this follows a simple rule: the cost of a piece of text is roughly its size multiplied by the number of requests after it. In a large task the agent makes 180 to 360 requests, and the context grows to 0.7 to 0.96 million tokens. A thousand characters from the first request of a long session will be read more than three hundred times, while the same thousand characters ten requests before the end will be read only ten times.

For AI Council this is awkward arithmetic: it delivered the most value at the start of a session. That is where the full texts of project rules, notes about the first opened files, and answers to the first knowledge-base queries landed. Some of the material went through MCP tools, some through Claude Code hooks. If the text exceeds a single hook's limit (about 10,000 characters), it hands the remainder over on the next tool call, attaching it to a refusal.

What the measurement showed

The testbed: Keycloak with an AI Council database of just over three thousand entries, mostly analyses of ticket history, and 37 to 39 rules, 17 of which are Keycloak development rules. Three large tasks: two parts of OpenID Federation 1.0 and the GNAP authorization server (RFC 9635). Each was run three times in three groups: without AI Council, with it before the changes, and with it after. The agent was the same everywhere: Claude Code on the Opus 5.5 model with xhigh reasoning effort.

On these three tasks, before the changes, the AI Council variant was 23% more expensive. Now the authors split the cost into two parts: what AI Council contributes, and the agent's own work. The first shrank by more than half, but the second depends on how the agent handles a long session, and cutting the delivery barely affects it. That is why the full cost fell only 15%, and on the largest task, GNAP, the AI Council variant is still more expensive.

Meanwhile, quality did not slip. In the GNAP task the authors planted 14 deliberate bugs in the agent's code, for example disabling request signature verification or turning token revocation into a no-op, and checked whether the agent's own tests would catch them. A run that missed more than one bug counted as weak. With AI Council there were no weak runs out of six; without it, two out of three. The Keycloak rule "every behavior change ships with a test that fails without the change" reached the agent in all six runs. A blind reviewer, shown two diffs without labels, chose the AI Council agent's code all six times.

There is no advantage where the needed knowledge was absent: in the hidden tests on GNAP requirements, which nothing in the database covered, and in the vulnerabilities, where a relevant rule almost never reached the agent.

What to do in practice

Count not the size of the hints but how many requests they live through in the context. Anything placed at the start of a session is paid for at every subsequent step. Rules and notes needed for a specific file are cheaper to supply when that file is accessed, not as a bulk dump at the start.

Break the bill down by context parts: without this it is hard to tell where the money goes to your additions and where to the agent's own work.

The caveats are honest ones. The measurement was done by the vendor itself on one project, with three runs per group, and the product changed during the measurement: the first run in each AI Council group ran on one version, the second and third on the next. Scoring against Keycloak rules partly favors AI Council, since those are exactly the rules it delivers. Treat the numbers as a benchmark for your own experiments, not as a universal law.

Story

Key Questions Answered

What you are actually paying for?

The agent works in a loop: it sends a request to the model, gets a response with a tool call, executes it, appends the result to the context, and sends the next request. The model remembers nothing, so each time it receives the entire accumulated context: the system prompt, the task, the files it has read, tool responses, and its own earlier reasoning.

What the measurement showed?

The testbed: Keycloak with an AI Council database of just over three thousand entries, mostly analyses of ticket history, and 37 to 39 rules, 17 of which are Keycloak development rules. Three large tasks: two parts of OpenID Federation 1.0 and the GNAP authorization server (RFC 9635). Each was run three times in three groups: without AI Council, with it before the changes, and with it after. The agent was the same everywhere: Claude Code on the Opus 5.5 model with xhigh reasoning effort.

What to do in practice?

Count not the size of the hints but how many requests they live through in the context. Anything placed at the start of a session is paid for at every subsequent step. Rules and notes needed for a specific file are cheaper to supply when that file is accessed, not as a bulk dump at the start. Break the bill down by context parts: without this it is hard to tell where the money goes to your additions and where to the agent's own work. The caveats are honest ones.

ZK
Zhemal Khamidun — Head of AI at Alpina Digital · MIPT (academic supervisor of the Tech Entrepreneurship department). Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Free · Waitlist · Hermes + DeepSeek

Free 2-Day Vibecoding & AI Agents Intensive

Day 1: the autonomous Hermes + DeepSeek AI agent — vibecoding and development on par with Claude Code / Codex / Gemini. Led by Jemal Hamidun, Head of AI at Alpina Digital and academic supervisor at MIPT. Right after you register with our bot Nika: the recording + 11 materials from the previous intensive.

Join the waitlist →Nomad AI Workspace
Jemal Hamidun

Editor-in-chief · Cite this analysis

Jemal Hamidun

Head of AI at Alpina Digital · Academic Supervisor of the Tech Entrepreneurship Department at MIPT

Head of AI & CPO of AlpinaGPT at Alpina Digital, Academic Lead of Tech Entrepreneurship at MIPT. Founder of Hamidun News and Vibe Academy.

Ready-to-paste citation for journalists, blogs and Telegram channels

Source: Hamidun News — AI Council cut its share of the Claude Code token bill in half, and the total bill by 15% https://news.hamidun.com/en/news/18842/ai-council-cut-its-share-of-the-claude-code-token-bill-in-ha

What do you think?
Loading comments…