Token Cost Without Guessing: What the Numbers Actually Prove, and a .NET Harness to Prove Your Own
From the publisher’s feed, collected in the ZeroLabs newsroom.
Every few days a new article tells me I can cut my agent’s token bill by 70, 80, 90 percent. I used to skim the headline number and move on. Lately I started doing something more annoying: I open the article, find the number, and ask one question. Was this measured, and if so, measured on what?Most of the time the honest answer is “not really”. This post is about that question. I read four recent pieces on token reduction carefully, checked what their numbers are made of, looked at the actual source code of two of the tools, pointed one of them at a real .NET codebase, and then wrote the small harness I now use to decide whether a technique earns a place in my agent setup.No invented percentages in here. Where a number comes from someone else, I say whose it is and what it rests on.Two articles, two very different kinds of numberThe first piece is Dharmaraj Dhanapal’s “How to Reduce Token Consumption in Agentic AI: 12 Practical Techniques”. The techniques themselves are sensible: short system prompts, right-sized models, compact state between agents, compressed tool outputs, caching, capped loops, per-workflow cost tracking. I agree with nearly all of them.The headline example is an invoice workflow that drops from 24,000 to 5,000 tokens per invoice, about 79.2 percent. And to the author’s credit, the article says it right there: the figures are illustrative assumptions, not measured results or universal benchmarks. That label is honest. It also means the 79.2 percent is not evidence of anything. It is arithmetic on numbers someone chose. I have seen that figure quoted elsewhere without the label, which is how an assumption quietly becomes a “fact”.The second piece is Ishank Choudhary’s graphify test. This one is different in kind. He installed the tool, cloned httpx (about 17,750 lines of Python, 101 files parsed), built the graph (2,233 nodes, 4,453 edges, 2.1 seconds), and then compared one lookup. graphify explain on Client cost 628 tokens. Reading _client.py directly cost 13,659 tokens. Both counted with tiktoken's cl100k encoding. Roughly 20x.He is also clear about the limits: one lookup, on one repo, not an agent session. He notes that names collide (a class and a docs heading both called Client), that the graph points at lines but does not contain the code, so you still read files to change anything, and that his local 1.7B Ollama model ran for over 11 minutes on CPU without finishing the labeling step.That is what a useful number looks like. Small, specific, reproducible, with its tokenizer named and its scope admitted. The 20x is real for that one question. It tells me nothing yet about my sessions.Two more ideas worth stealingRTK. rtk-ai/rtk is a Rust CLI that sits between your agent and noisy commands like git diff, cargo test or pytest, and hands the agent a compressed version. I cloned the repo to see what is actually there. Version 0.49.0 is Apache-2.0, and it does have a .NET path: rtk dotnet build, rtk dotnet test, rtk dotnet restore and rtk dotnet format are real subcommands, and the build and test filters work from an MSBuild binlog rather than scraping console text. The repo even has test fixtures captured from a tiny .NET 10 smoke project.The savings numbers on the project’s own pages are vendor claims (the README says bash output gets “up to 90% smaller”). What surprised me is how candid the README is about what that number means. It says, in plain terms, that RTK reduces the bash output your agent reads, that this is only one part of input tokens next to the system prompt and history, that input is only part of the bill, and that the reduction dilutes at each step. It also says RTK ships no tokenizer and estimates tokens as bytes divided by four.I also read JIN System Architect’s piece on RTK. The framing is good (raw terminal output in context is an architectural smell). But I could not find any sign the author ran the tool, and the only numbers are a hypothetical test run. So I treat it as an opinion piece, and I don’t reuse its figures. For what it is worth, the pipeline.toml config and the rtk-proxy component do exist in the current source; I just did not exercise them.Memoization. Realinho’s ITNEXT article on caching agent results is written for OutSystems, but three rules from it travel well. Hash a canonicalized form of the input, so whitespace noise does not cause misses. Put a version in the key, so changing the prompt or model invalidates old results. And never cache an agent step that has side effects. Those three rules are most of what matters.A deterministic layer. The Analytics at Meta post on AI-native analytics patterns is not about token cost at all, but it gave me the frame for everything below. Their agents don’t write SQL. The model interprets the question and picks parameters; a deterministic query generator writes the SQL. A code graph lookup, an output filter and a cache are the same idea in a coding agent: move work out of the model and into something boring and repeatable.Where every number standsHere is the honest state of the evidence, as a table I can paste anywhere:+----------------------+-------------------+---------------+----------------+------------------+-----------------------+| Technique / source | Tokens before | Tokens after | Task success | Session cost | Kind of number |+----------------------+-------------------+---------------+----------------+------------------+-----------------------+| 12 techniques | 24,000 / invoice | 5,000 | not reported | not reported | illustrative, author || (Dharmaraj) | | | | | labels it unmeasured |+----------------------+-------------------+---------------+----------------+------------------+-----------------------+| graphify explain | 13,659 (read | 628 | not reported | not reported | measured, cl100k, || (Ishank, httpx) | _client.py) | | | | one lookup, one repo |+----------------------+-------------------+---------------+----------------+------------------+-----------------------+| RTK output filter | not given | "up to 90% | not reported | README says it | vendor claim, || (rtk-ai README) | | smaller" | | dilutes | bytes/4 estimate |+----------------------+-------------------+---------------+----------------+------------------+-----------------------+| RTK article (JIN) | none | none | none | none | opinion, no run shown |+----------------------+-------------------+---------------+----------------+------------------+-----------------------+| Memoization | none | none | none | none | design rules only || (Realinho) | | | | | |+----------------------+-------------------+---------------+----------------+------------------+-----------------------+Look at the “Task success” and “Session cost” columns. Nobody reports them. Every number in circulation is a per-step number. That gap is the whole reason I built the harness below.Why a per-command cut is not a session cutThis is the part I wish more posts spelled out, because it explains the RTK README caveat precisely.An agent turn sends the whole history every time. If a dotnet test output of T tokens lands at turn t in a session of N model calls, you pay for those T tokens again at every model call after it. So the input cost of a session is:session_input = sum over model calls k of ( system + history before call k )A filter that shrinks one tool output from T to T' saves (T - T') x (number of model calls after it). Two consequences fall out of that:The same filter is worth more early in a session than late. A noisy build at turn 2 of a 30-turn session costs far more than the same build at turn 28.The session cut is always smaller than the per-command cut, because the system prompt, your files, and the model’s own replies are untouched. If tool output is a small share of the history, a huge per-command cut becomes a modest session cut.So “90% smaller output” and “90% cheaper session” are different statements, and only the first one is ever measured. Prompt caching muddies this further: cached history is billed at a discount but still counts, so the cut in dollars and the cut in tokens also diverge. I report tokens and say which.What I saw pointing graphify at a real .NET repoBefore writing any harness, I wanted to know whether a graph tool even understands C#. Ishank tested Python. I picked Polly, the resilience library, because it is real, well-maintained, and has the kind of C# that trips tools up: partial classes, generics everywhere, extension methods, and strategies created inside lambdas.python3 -m venv .venv.venv/bin/pip install graphifyy # note the double y on PyPIgit clone https://github.com/App-vNext/Pollycd Polly../.venv/bin/graphify update .On commit e762964, with graphifyy 0.9.95, on a 2-core cloud box, the code-only build processed 945 files and produced 8,848 nodes, 29,034 edges and 290 communities in about 9.8 seconds. graph.json came out at 16.9 MB, so this is not something you paste into a prompt.Three things from that first run shaped how I read every lookup afterwards:The C# grammar lags the language. graphify warned that src/Polly.Core/Retry/RetryHelper.cs had a syntax error at line 134 and only 10 symbols were extracted from it. Polly compiles fine, so this is the tree-sitter grammar not keeping up with newer C# syntax. That file is where retry delays are computed. A question about backoff would get a partial graph and nobody would tell the agent.Ambiguity is the default, not the edge case. graphify explain "ResiliencePipeline" did not explain anything. It answered "Ambiguous" and listed three candidate nodes. An agent has to pay for that miss and then retry with path::symbol. Ishank saw the same thing with Client.Partial classes were handled better than I expected. ResiliencePipeline is split across five files. Once disambiguated, graphify merged it into one node with 112 connections, and its Execute, ExecuteAsync and ExecuteOutcomeAsync methods pointed at the right partial files.About the repo facts I was asked to check: the package is graphifyy with two y's. pyproject.toml declares Apache-2.0, but the repo also ships a LICENSE-MIT file next to the Apache one, which explains why you will see both licenses mentioned. The "126k stars" figure I could not verify, so I am not repeating it.The harnessThe rule I set for myself: a technique only goes into my agent setup if it lowers whole-session input tokens and the agent still finishes the task. Per-command savings alone don’t count.Setup, all local:python3 -m venv .venv.venv/bin/pip install graphifyy tiktoken requestsbrew install rtk # or see the rtk-ai/rtk README for Linuxrtk --version # another crate called "rtk" exists, check it's this one# local model as the cheap baselinebrew install ollamaollama serve &ollama pull qwen2.5-coder:7bI count every token with one stated tokenizer, tiktoken’s cl100k_base, the same one Ishank used. It is not the tokenizer of Claude or of Qwen, so absolute numbers are approximate for any given model, but the comparisons between before and after are fair because both sides go through the same encoder.# count_tokens.pyimport sysimport tiktokenENC = tiktoken.get_encoding("cl100k_base")def count(text: str) -> int: return len(ENC.encode(text))if __name__ == "__main__": if len(sys.argv) > 1: for path in sys.argv[1:]: with open(path, encoding="utf-8", errors="replace") as f: print(f"{count(f.read())}\t{path}") else: print(count(sys.stdin.read()))Experiment 1: graph lookup versus file readsTen navigation questions about Polly, each paired with the graph commands an agent would run and the files it would have to open to answer from source. The file list is the minimal correct set, which is generous to the file-reading side: a real agent usually opens more.# graph_vs_read.py (run from the Polly repo root, after `graphify update .`)import csvimport subprocessfrom count_tokens import countGRAPHIFY = "../.venv/bin/graphify"QUESTIONS = [ ("q1", "Which execute methods does ResiliencePipeline expose, and where?", [["explain", "ResiliencePipeline"], ["explain", "src/Polly.Core/ResiliencePipeline.Async.cs::ResiliencePipeline"]], ["src/Polly.Core/ResiliencePipeline.cs", "src/Polly.Core/ResiliencePipeline.Sync.cs", "src/Polly.Core/ResiliencePipeline.SyncT.cs", "src/Polly.Core/ResiliencePipeline.Async.cs", "src/Polly.Core/ResiliencePipeline.AsyncT.cs"]), ("q2", "Which concrete strategies derive from ResilienceStrategy?", [["explain", "ResilienceStrategy", "--all"]], ["src/Polly.Core/ResilienceStrategy.cs", "src/Polly.Core/ResilienceStrategy.TResult.cs"]), ("q3", "Where is AddRetry defined and what does it construct?", [["explain", "AddRetry"]], ["src/Polly.Core/Retry/RetryResiliencePipelineBuilderExtensions.cs"]), ("q4", "What does CircuitBreakerResilienceStrategy depend on?", [["explain", "CircuitBreakerResilienceStrategy"]], ["src/Polly.Core/CircuitBreaker/CircuitBreakerResilienceStrategy.cs"]), ("q5", "How does a builder end up creating a RetryResilienceStrategy?", [["path", "ResiliencePipelineBuilder", "RetryResilienceStrategy"]], ["src/Polly.Core/Retry/RetryResiliencePipelineBuilderExtensions.cs", "src/Polly.Core/ResiliencePipelineBuilderBase.cs", "src/Polly.Core/ResiliencePipelineBuilder.cs"]), ("q6", "How is the retry delay computed for exponential backoff with jitter?", [["explain", "GetRetryDelay"]], ["src/Polly.Core/Retry/RetryHelper.cs"]), ("q7", "Which strategies take a TimeProvider?", [["explain", "TimeProvider"]], ["src/Polly.Core/Retry/RetryResilienceStrategy.cs", "src/Polly.Core/Timeout/TimeoutResilienceStrategy.cs"]), ("q8", "Where is Outcome defined and how are outcomes created?", [["explain", "Outcome"]], ["src/Polly.Core/Outcome.cs", "src/Polly.Core/Outcome.TResult.cs"]), ("q9", "What does ResiliencePipelineRegistry depend on?", [["explain", "ResiliencePipelineRegistry"]], ["src/Polly.Core/Registry/ResiliencePipelineRegistry.cs"]), ("q10", "What does AddResiliencePipeline register in DI?", [["explain", "AddResiliencePipeline"]], ["src/Polly.Extensions/DependencyInjection/PollyServiceCollectionExtensions.cs"]),]def run_graph(cmds): out = [] for args in cmds: res = subprocess.run([GRAPHIFY, *args], capture_output=True, text=True) out.append(f"$ graphify {' '.join(args)}\n{res.stdout}{res.stderr}") return "\n".join(out)with open("exp1_results.csv", "w", newline="") as f: w = csv.writer(f) w.writerow(["id", "question", "graph_tokens", "read_tokens", "graph_output_file"]) for qid, question, cmds, files in QUESTIONS: graph_text = run_graph(cmds) out_file = f"exp1_{qid}.txt" with open(out_file, "w") as g: g.write(graph_text) read_text = "".join(open(p, encoding="utf-8").read() for p in files) w.writerow([qid, question, count(graph_text), count(read_text), out_file]) print(qid, count(graph_text), count(read_text))The script deliberately keeps the first, ambiguous command in q1. The miss is part of the cost.Scoring is manual and I think it has to be. For each question I read the saved graph output and mark it as one of three outcomes:+-------------------+-------------------------------------------------------------+-------------------------------+| Outcome | Meaning | Cost counted |+-------------------+-------------------------------------------------------------+-------------------------------+| answered | graph output alone answers the question correctly | graph tokens || graph + read | graph found the right file, agent still had to open it | graph tokens + file tokens || wrong / missing | graph pointed nowhere useful or at the wrong thing | graph tokens + full baseline |+-------------------+-------------------------------------------------------------+-------------------------------+That last row is the one per-lookup comparisons always leave out. A wrong lookup is not free; it is an extra cost on top of the reads you were going to do anyway. Several of these questions are chosen to poke the weak spots I saw in the build: q5 goes through a lambda (context => new RetryResilienceStrategy(...)), q6 lands on the half-parsed RetryHelper.cs, q7 asks about a BCL type that lives outside the repo, and q6 asks how something is computed, which a graph of names and edges cannot answer without the method body.Experiment 2: filtering dotnet build and dotnet test outputTwo filters side by side. RTK, using its own .NET support:rtk dotnet buildrtk dotnet testrtk gain # RTK's own savings report (bytes/4 estimate)And a small filter of my own, for anyone who would rather not add a binary to the loop. It keeps compiler errors (deduplicated, because MSBuild prints each one twice), failed test names, the error message, Expected and Actual lines, the first stack frame that points at a file, and the summary lines. Everything else goes.#!/usr/bin/env python3# dotnet_filter.py# Usage: dotnet test 2>&1 | python3 dotnet_filter.pyimport reimport sysERROR = re.compile(r"(error|warning) [A-Z]+\d+:")FAILED_TEST = re.compile(r"^\s*Failed [\w.`<>\[\],]+ \[")FRAME_WITH_FILE = re.compile(r"^\s*at .+ in .+:line \d+")SUMMARY = re.compile(r"^(Build (FAILED|succeeded)|\s*\d+ (Warning|Error)\(s\)|(Failed|Passed)!\s+-)")def compress(lines): out, seen = [], set() in_failure = False frame_taken = False for raw in lines: line = raw.rstrip("\n") if ERROR.search(line): key = re.sub(r"\s*\[[^\]]+\.csproj\]\s*$", "", line).strip() if key not in seen: seen.add(key) out.append(key) continue if FAILED_TEST.match(line): in_failure, frame_taken = True, False out.append(line.strip()) continue if in_failure: stripped = line.strip() if stripped.startswith(("Error Message:", "Expected:", "Actual:", "Assert.")): out.append(" " + stripped) continue if not frame_taken and FRAME_WITH_FILE.match(line): out.append(" " + stripped) frame_taken = True continue if SUMMARY.match(line): in_failure = False out.append(line.strip()) return outif __name__ == "__main__": result = compress(sys.stdin) print("\n".join(result) if result else "(no errors, failures or summary lines found)")I checked it against the real dotnet test capture that ships in RTK's own test fixtures (a one-test xUnit project on .NET 10). The output keeps exactly what a fixer needs:Failed RtkDotnetSmoke.UnitTest1.Test1 [4 ms] Error Message: Assert.Equal() Failure: Values differ Expected: 2 Actual: 3 at RtkDotnetSmoke.UnitTest1.Test1() in /private/tmp/RtkDotnetSmoke/UnitTest1.cs:line 8Failed! - Failed: 1, Passed: 0, Skipped: 0, Total: 1, Duration: 13 ms - RtkDotnetSmoke.dll (net10.0)A filter can be too aggressive, and that is the quality risk here. It drops warnings, it drops every stack frame after the first, and it drops output from tests that write to the console. If the real bug is three frames down, or hiding in a warning, the agent loses it. That is why the success check in this experiment is not “fewer tokens” but “did the agent still fix the failing test”.The per-command number is easy. The session number needs a transcript. I record the agent’s session as JSONL (one message per line) and replay it twice, once raw and once with the filter applied to every dotnet tool output:#!/usr/bin/env python3# session_cost.py# Transcript format, one JSON object per line:# {"role": "system|user|assistant|tool", "content": "...", "command": "dotnet test"}import jsonimport sysimport tiktokenfrom dotnet_filter import compressENC = tiktoken.get_encoding("cl100k_base")def tokens(text: str) -> int: return len(ENC.encode(text))def filtered(msg): if msg["role"] == "tool" and msg.get("command", "").startswith("dotnet "): return "\n".join(compress(msg["content"].splitlines(keepends=True))) return msg["content"]def session_input_tokens(messages, use_filter=False): history, total, calls = 0, 0, 0 for msg in messages: content = filtered(msg) if use_filter else msg["content"] if msg["role"] == "assistant": total += history # the model reads everything before it answers calls += 1 history += tokens(content) return total, callsif __name__ == "__main__": with open(sys.argv[1], encoding="utf-8") as f: msgs = [json.loads(line) for line in f if line.strip()] dotnet_msgs = [m for m in msgs if m.get("command", "").startswith("dotnet ")] tool_raw = sum(tokens(m["content"]) for m in dotnet_msgs) tool_flt = sum(tokens(filtered(m)) for m in dotnet_msgs) raw, calls = session_input_tokens(msgs) flt, _ = session_input_tokens(msgs, use_filter=True) print(f"model calls: {calls}") print(f"dotnet output tokens: {tool_raw} -> {tool_flt}") print(f"session input tokens: {raw} -> {flt}") if tool_raw and raw: print(f"per-command cut: {100 * (1 - tool_flt / tool_raw):.1f}%") print(f"whole-session cut: {100 * (1 - flt / raw):.1f}%")Replay is not the same as a live run, and I want to be clear about why I use both. Replay answers “how many tokens would this exact session have cost with filtered output”. It cannot tell you whether the agent would have made the same decisions after seeing less. Only a live run with the filter turned on answers that, so the success column always comes from live runs.For the live runs I use a local model as the cheap baseline, so I can repeat a failing-test task many times without watching a bill. Ollama reports its own token counts per call, and I log them next to my cl100k counts:# ollama_ledger.pyimport jsonimport requestsOLLAMA = "http://localhost:11434/api/chat"MODEL = "qwen2.5-coder:7b"def chat(messages, ledger, num_ctx=32768): resp = requests.post(OLLAMA, json={ "model": MODEL, "messages": messages, "stream": False, "options": {"num_ctx": num_ctx}, }, timeout=900) resp.raise_for_status() data = resp.json() ledger.append({ "prompt_eval_count": data.get("prompt_eval_count", 0), "eval_count": data.get("eval_count", 0), }) return data["message"]["content"]def save(ledger, path="ollama_ledger.jsonl"): with open(path, "w", encoding="utf-8") as f: for row in ledger: f.write(json.dumps(row) + "\n")Two Ollama gotchas I would have lost a day to. First, set num_ctx explicitly. Ollama's default context window is small, and when a long build log overflows it the oldest content is dropped without an error, which makes an unfiltered session look cheaper and dumber than it really is. Second, prompt_eval_count is Ollama's view through Qwen's tokenizer and can be affected by prompt-prefix caching between calls, so I treat it as a cross-check, not the number I report.Experiment 3: memoizing a repeated analysis stepThe step I memoize is one my agent repeats constantly: “summarize the public API of this file”. Realinho’s three rules go straight into code:# memo.pyimport hashlibimport jsonimport pathlibimport reCACHE_DIR = pathlib.Path(".agent-cache")ANALYZER_VERSION = "api-summary-v3" # bump when the prompt, model or parser changesdef canonicalize(source: str) -> str: """Remove differences that cannot change the analysis result.""" source = source.replace("\r\n", "\n") source = re.sub(r"[ \t]+$", "", source, flags=re.MULTILINE) source = re.sub(r"\n{3,}", "\n\n", source) return source.strip() + "\n"def cache_key(inputs: dict) -> str: payload = json.dumps({"version": ANALYZER_VERSION, "inputs": inputs}, sort_keys=True, ensure_ascii=False) return hashlib.sha256(payload.encode("utf-8")).hexdigest()def memoized(step_name, inputs: dict, compute, *, has_side_effects=False, stats=None): """Return (result, hit). Steps with side effects are never cached.""" if has_side_effects: return compute(), False key = cache_key({"step": step_name, **inputs}) path = CACHE_DIR / f"{key}.json" if path.exists(): if stats is not None: stats["hits"] += 1 return json.loads(path.read_text(encoding="utf-8")), True result = compute() CACHE_DIR.mkdir(exist_ok=True) path.write_text(json.dumps(result, ensure_ascii=False), encoding="utf-8") if stats is not None: stats["misses"] += 1 return result, FalseA quick sanity run: the same file with Windows line endings and trailing blank lines hits the cache, a real code change misses, and a step flagged with side effects is computed every time. That behaves the way the rules say it should.The hard part is not hits and misses. It is stale results, and writing the code is what made me see the trap. A key built from one file’s content is wrong whenever the answer depends on another file. Change a base class, or an interface the file implements, and the summary of the derived class is now stale, but its content hash has not moved. The cache will happily serve the old answer, and nothing in the hit and miss counts will show it.The fix I settled on uses the graph from experiment 1: put the hashes of the file’s direct dependencies into the key.# memo_deps.pyimport hashlibimport pathlibfrom memo import canonicalize, memoizeddef file_hash(path: str) -> str: text = canonicalize(pathlib.Path(path).read_text(encoding="utf-8")) return hashlib.sha256(text.encode("utf-8")).hexdigest()def summarize_api(path: str, dependency_paths: list[str], compute, stats): inputs = { "file": path, "content": file_hash(path), "deps": {p: file_hash(p) for p in sorted(dependency_paths)}, } return memoized("api-summary", inputs, compute, stats=stats)Here dependency_paths comes from the graph (the files the symbol's outgoing edges point at). This trades hit rate for correctness, and the right amount of trade is exactly what I want to measure: replay the step across consecutive commits of the repo, count hits and misses for the file-only key and for the dependency key, and count a result as stale when the file-only key hit while one of its dependencies had changed. That stale count is the number nobody publishes for caches, and it is the one that decides whether the hit rate is worth anything.And the side-effect rule stays absolute. Anything that writes files, runs tests, calls an API with effects or sends a message is never memoized, whatever the hit rate would be.How I read the results tableThe final table I fill in for each technique looks like this, and the columns are the point:+------------------------+----------------+---------------+------------------------+------------------------+| Technique | Tokens before | Tokens after | Task success | Session input tokens |+------------------------+----------------+---------------+------------------------+------------------------+| Graph lookup | file reads | graph output | answered / graph+read | replayed transcript || | (cl100k) | (cl100k) | / wrong, per question | raw vs with lookups |+------------------------+----------------+---------------+------------------------+------------------------+| Output filter | raw dotnet | filtered | live run: failing | replayed transcript || (RTK / dotnet_filter) | output | output | test fixed, yes or no | raw vs filtered |+------------------------+----------------+---------------+------------------------+------------------------+| Memoization | tokens per | tokens on a | stale results counted | hits x tokens per run, || (file key / dep key) | analysis run | hit (zero) | against commit history | minus stale reruns |+------------------------+----------------+---------------+------------------------+------------------------+If a technique moves the “Tokens” columns but not the session column, it is a curiosity. If it moves the session column but the success column drops, it is a cost cut that I pay for later in reruns and review time. I only adopt the ones that move the session column with success unchanged.ScopeAll counts are input tokens through cl100k. Output tokens, prompt-cache discounts and dollar prices are separate questions, and they change the ranking: a technique that saves mostly cached history saves less money than its token count suggests. The harness also stays inside one repository. Cross-repo lookups and Graphify Cloud, with its own “80% token savings” pitch, are a different setup, and that number is a vendor claim like any other.What I’m taking awayThe two articles I started with are a good pair. One gives a clean number that is honestly labelled as made up. The other gives an ugly, narrow number that is real. I would rather build on the second kind every time, and I have stopped quoting the first kind, even with the label attached, because the label never survives the second retelling.The tools themselves look promising for .NET. graphify built a usable graph of Polly in seconds and handled partial classes better than I feared, but its C# grammar silently half-parsed one of the most important files. RTK has real .NET support and an unusually honest README about what its percentages mean. Memoization is easy to write and easy to get subtly wrong.None of them get to claim a session-level saving until a session has been measured. That is the bar I’m holding my own setup to, and I’d suggest it for anyone reading the next “cut your tokens by 90%” headline.Tags: ai-agents, llm, dotnet, csharp, token-optimization, developer-tools, ollama, software-engineering, code-graph, cachingToken Cost Without Guessing: What the Numbers Actually Prove, and a .NET Harness to Prove Your Own was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.