Finance

The 98.6% Cache Arsenal: How ZCode, an Unknown Chinese ADE, Is Quietly Crushing Claude Code on DeepSeek Costs

0xHasu
From the outside, the numbers look like a typo. Two unnamed tools sharing a ranking table, one with 98.60%, the other with 97.86%, and a third, the industry darling, stuck at 89.31%. The table came from Dax Raad, co-founder of the open-source coding agent OpenCode, who tracked client-side cache hit rates on DeepSeek traffic over the past 48 hours. The top performer was ZCode. Raad said, "I don't know what ZCode is, but it's doing a really good job." I have watched similar tables in trading. When a low-level exchange posts a volume spike that tops the chart, no one knows its name, and then everyone rushes to find it. The difference is that this table does not distort the truth, it reveals it. The truth is that ZCode's cache hit rate translates to about 27% of Claude Code's input cost. That is not a market anomaly. That is an economic weapon. The numbers didn't lie, but my trust did. I trust that the market prices in quality. For a long time, I believed that the best AI agent tools, with the most reputable backers, would also be the most efficient. This data says otherwise. It says that a tool you've never heard of, from a Chinese AI company you may have dismissed, is using the same model, the same API, and the same cache, but is getting paid a third of the cost. This is not a speed test. It's a hidden subsidy. Let's set the stage. DeepSeek has become a favorite for developers who need low-cost inference. The company's pricing structure is peculiar. A cache hit is nearly free. A cache miss is fifty times more expensive. This delta is intended to reward deterministic, long-lived conversations. If you work with an agentic coding tool, you are constantly sending the same context back to the model. Every time you ask the agent to modify a function, it needs the entire file, the previous changes, and the conversation history. The vast majority of those tokens are identical to the previous request. If the tool structures the context correctly, the API can serve them from cache, eliminating 98% of the computation. If the tool is sloppy, you pay for every token again. That's the essence of client-side cache hit rate. The client, in this case, is the tool. The cache hit rate is the fraction of input tokens that find their precomputed state. ZCode achieves 98.60%, OpenCode V2 achieves 97.86%, and Claude Code/CLI lags at 89.31%. To an untrained eye, the difference between 98.6% and 89.3% seems small. But because the penalty for a miss is so large, the effective input cost difference is enormous. As calculated, ZCode's input cost is about 27% of Claude Code's. This is not an incremental gain; it's a tripling of efficiency. ZCode is an agentic development environment (ADE) built by Zhipu, a company whose name might not ring the same bells as OpenAI or Anthropic. Zhipu created GLM-5.2, a foundation model, and ZCode is its integrated coding cockpit. The tool supports GLM-5.2 as the default model but also lets users connect to other backends, including DeepSeek, OpenAI, and Anthropic. It is exactly that flexibility that makes the discovery so piquant. Here is a tool that was not designed for DeepSeek, and yet it reduces DeepSeek's cost burden better than any other client in the field. Why does this matter for the crypto world? Because the current AI agent boom is becoming a token economy. Every action taken by an agent costs tokens. Every token has a price. The projects that survive the upcoming consolidation phase are the ones with the lowest burn rate. In blockchain terms, the cache hit rate is the transaction fee efficiency of an agent. ZCode is the equivalent of a protocol that uses 75% less gas for the same operations. In a world where sustainability determines survival, this is the metric that matters. Let me break down the arithmetic to the dust. Assume a workload of 100,000 input tokens per agent interaction. With a 98.60% hit rate, ZCode has 1,400 cache-miss tokens. With an 89.31% hit rate, Claude Code has 10,690 cache-miss tokens. Multiplying the miss tokens by 50, ZCode's total cost index is 1,400 miss tokens times 50, plus 98,600 hit tokens times 1, giving 70,000 plus 98,600 equals 168,600. Claude Code's is 10,690 times 50 plus 89,310, giving 534,500 plus 89,310 equals 623,810. The ratio is 0.270. This is not a trick. It follows directly from the 50x penalty. The 50x multiplier is an enormous cliff. Imagine if, in Ethereum, the gas cost for a cache miss, such as reading a non-cached storage slot, were 50 times the cost of a cached read. All smart contract developers would be obsessed with storage layouts, and they are already obsessed, but the obsession would multiply. This is what we are seeing now in the AI agent ecosystem. Optimizing for cache hit rate is the new gas optimization. It requires the same kind of discipline: use constants, avoid dynamic data in your prefix, and keep the variable components at the tail. The key insight is that context length is not the primary driver of cost. A 10,000-token request with a stable prefix can be cheaper than a 1,000-token request with a changing prefix. The cache is a prefix cache. If your tool injects a timestamp at the beginning of the system prompt, then the entire cached state is invalidated. This is a classic bug. Claude Code appears to be a victim of this class of bugs. Its architecture, which is optimized for Anthropic's own prompt caching, is not designed for a different provider's prefix cache. Anthropic's caching has a different granularity, and Claude Code may not respect the need for byte-identical prefix. OpenCode V2's near-win at 97.86% is commendable. It likely uses a "stable context window" approach: it separates file scopes and conversation history into a "working context" that is padded and maintained consistently. But it still loses to ZCode by a narrow but economically significant margin. At this level, the marginal difference of 0.74 percentage points is worth 2.3% in input cost. That may not seem like a lot, but for a high-volume user, it accumulates. Now, how does ZCode manage to be so good? I can only infer from the surface. But I have audited protocols for years, and I recognize the fingerprints of "state channel" design. ZCode likely maintains a local state channel, a "context ledger," if you will. Every action within a session updates only the tail of the context. The header is frozen. When it sends a request, it first checks locally whether the prefix has been modified. If not, it sends the exact same prefix, relying on the server-side cache. This is the equivalent of a light client in blockchain, which does not re-download the entire chain, but only the new block headers. Light clients understand the state; heavy clients carry the whole world. ZCode is a light client for context. There is also a possible explanation rooted in the Chinese AI ecosystem. Zhipu and DeepSeek may interoperate on similar "thought token" patterns or use compatible tokenizers. But tuning for a specific model is not a sustainable long-term advantage, because DeepSeek can change its tokenization. The more durable explanation is that ZCode's internal design is built around a "cache-first" philosophy. The tool was launched at a time when cost efficiency was Zhipu's biggest differentiator. The company could not afford to burn money on its own model, and so it designed ZCode to be extremely mindful of repetitive generation. I recall a similar situation in 2020 when I was building arbitrage strategies for Curve. Many bots focused on finding the best swap route. But the most profitable bots were the ones that minimized the number of state changes on-chain. They batched operations, used static calls, and avoided code paths that would invalidate the storage slot. The market thought it was about math; it was actually about gas. ZCode is doing the same thing for AI agents: it is winning on the gas layer, not the model layer. Let's talk about the "client-side" aspect more deeply. When Dax Raad says "client-side cache hit rate," he means the fraction of tokens in outgoing requests that are served from the API's cache. This is distinct from the server-side "self-consistency" or the raw model capability. It is entirely a product of how the client formats the request. Consider two clients that send the same model the same task. Client A sends the system prompt as a fixed constant. Client B adds a "current time" line at the very top. Over the course of a conversation, Client A will hit the cache for all prompt tokens, while Client B will be forced to recompute from the first token every time. The model is identical; the cost is not. This is the hidden variable in AI development. There is an undeniable parallel with the "ordering" problem in blockchain. In a blockchain, the way you order transactions in a block affects the state transitions and the gas costs. In an AI agent, the way you order tokens in the context affects the cache and therefore the compute cost. The most efficient protocols are the ones that design for state continuity from the very beginning. They don't append random metadata into the middle of the state. They broadcast the state root, and then only the delta. A deeper layer: DeepSeek's pricing is essentially a "storage rent" model. A cache hit is like reading from a hot slot in the EVM. A cache miss is like reading from cold storage. But the key is that the cache is persistent across requests from the same application for a certain period, often a few minutes or hours. If you send a request that is 98.6% identical to the previous one, the cost is minimal. If you send a request that is only 89.3% identical, the cost is more than three times higher. This validates the idea that the market is rewarding strong "intention preservation." The most efficient agents are those that keep their intent unchanged, and only change the delta. But there is a potential trap: a high cache hit rate might indicate that the agent is not learning. In a true coding agent, the agent makes tool calls, receives outputs, and those outputs often need to be appended to the context. If you append tool outputs to the tail, the stable prefix remains. If you attempt to insert tool outputs into the middle because you want to maintain a chronological order, you invalidate the cache. The best cache-optimized tools will therefore enforce a specific order: the system prompt first, the conversation history second, then the last user request, and finally the last tool output. This may feel unnatural for software engineers who want to see the latest file changes in the middle. But it is the price of cache efficiency. We can see the effect in the "tools" that Claude Code invokes. Claude Code tends to execute many small commands and then summarize the outputs. Each summary modifies the conversation history. Because the model is generating the summary, the exact tokenization of the summary is unknown until it is generated. When the summary is inserted into the context, it becomes part of the prefix for the next request. If the summary differs from what was predicted, the cache is broken. The key is to move generated summaries to the tail and never to the middle. This forces the agent to treat the conversation history as an immutable chain, rather than as mutable memory. In my copy trading community, I constantly remind my traders that the biggest drawdown comes from "changing the strategy mid-trade." Once you enter a position, you should not alter your stop-loss based on every noise. The same applies here. A cache-optimized agent is a strategy-optimized agent. It does not re-decode the entire world every time. It knows what it knows and only processes the new information. That is a philosophical foundation as much as a technical one. Let's examine the numbers from another perspective: What if the hit rate difference is due to the distribution of conversations? Claude Code might be used by developers who are exploring new codebases, touching many different files, and generating a high volume of unique context. ZCode, being a less-known tool, might be used by a niche group of early adopters who are already familiar with Zhipu's environment and who run long, stable tutoring sessions. If the user base is different, the hit rates are not directly comparable. But Dax's observation is still valuable because he is comparing agents operating on his own traffic. Wait, the data is "DeepSeek traffic over the past 48 hours" according to monitoring. It's likely an aggregate of client-side cache hit rates across all users, not a single benchmark. This is a crucial detail. The numbers represent real-world usage across many developers, not a controlled benchmark. If the aggregate shows ZCode at 98.60%, that means across all ZCode sessions, the average hit rate is 98.6%. That includes cold starts, new sessions, and short conversations. That is incredibly high. It suggests that ZCode's context management is uniformly disciplined across its entire user base. That's not a niche artifact; that's a fundamental architecture. Meanwhile, Claude Code's 89.31% aggregate hit rate across all users shows that it suffers from a structural flaw when pointed at DeepSeek. There are likely thousands of developers using Claude Code, with diverse workflows, and they all generate about 10.69% miss tokens. The 0.74% point gap between ZCode and OpenCode is smaller, but still measurable. It could be due to the model default: OpenCode might have a default system prompt that includes a timestamp, while ZCode does not. We do not know. What we do know: The cache-aware engineering is a new form of product moat. The tool that controls the context format controls the user's cost structure. This is a fast-moving advantage. It cannot be faked with clever marketing. It is embedded in the code. This is where blockchain enters. In a decentralized world, we would expect to see a "cache market" emerging. Imagine a protocol where users exchange context prefixes, like a shared pool of cached states. This is essentially what the "prompt cache" already is, but it is centralized within a single API provider. A decentralized alternative could let different tools share cache prefixes across providers, but the tokenization would need to be identical. The likelihood of that happening is low, but the economic incentive is enormous. The 50x penalty is essentially a tax on every developer that does not align with the provider's cache design. This tax could be distributed back to users in a decentralized protocol, but that's a story for another day. For now, the practical takeaway for any serious agent developer is to measure your own cache hit rate. Are you using Claude Code on DeepSeek? You are leaving money on the table. Are you using OpenCode V2? You are close to the optimum. Are you using ZCode? You might be part of the silent group that is laughing at the rest. Let's also consider the scalability of this advantage. As the context length grows, the absolute number of cached tokens grows. A high hit rate becomes more valuable. For a 200,000-token context with a 50x penalty, a 1% miss-rate improvement translates to enormous savings. The table from Dax shows a snapshot. But the trajectory is clear: context windows are expanding, and cache management will determine who can afford to use them. We should not ignore the potential for "cache poisoning." In a shared cache, one tool's context prefix can be relevant to another tool if they use the same system prompt. If ZCode and OpenCode both use a standard system prompt, they could benefit from cross-tool cache hits. This would be a kind of "shared memory." But it also raises privacy questions. The same prefix that provides cache benefit could also leak information through timing side-channels. The AI industry will have to deal with these trade-offs. Let me return to the human element. As a founder of a copy trading community, I have to worry about the "herd effect." When a tool appears from nowhere and top hits, the herd rushes in. This rush can be destructive: the tool becomes overcongested, its API rates change, or the provider itself is not prepared for the influx. ZCode's 98.60% might degrade under heavier load. But the more important message is not to chase the tool, but to absorb the principle: cache discipline is king. I have seen this pattern before. In the early DeFi days, there were "yield aggregators" that posted high APYs. People flocked to them, but the yields were not sustainable. The ones who survived were those who built their own strategies and did not rely on external subsidies. Similarly, your agentic codebase should build cache discipline into its own core, rather than relying on the specific tool vendor. But before you rename your startup ZCode and sell everything for GLM tokens, let's apply the skeptical idealism that has kept me alive in this industry. The cache hit rate is a single metric, and it is not a measure of quality. A tool can achieve a high hit rate by being intentionally repetitive or by limiting the variability of its context. Suppose ZCode only works perfectly with a narrow set of tasks, say, standard CRUD operations, and fails on complex multi-step code refactoring. Its hit rate would be high because it never needs to change the context. But the developer would spend more time manually editing code, and the overall cost would be higher. So the hit rate must be viewed in conjunction with task completion rate and time to completion. This is the same problem as looking at a DEX's TVL without looking at its slippage. A high TVL can be artificially maintained by liquidity mining, but a user's actual execution is poor. ZCode's hit rate might be high for the same reason: it might encourage a standard context template that is good for the cache but not for the developer's specific need. There is also the question of the price elasticity of the API. DeepSeek's 50x miss multiplier is a choice. If DeepSeek changes the multiplier to 10x, ZCode's advantage would shrink from 27% to about 76% of Claude Code's cost. The ratio of cost between ZCode and Claude depends on the miss penalty. The miss penalty could vary based on the market position of the provider. If DeepSeek wants to maximize revenue, it could increase the hit price. Then all agents, no matter how cache-optimized, would pay more. The "moat" is actually a lease, not property. We also have to consider that the cache is not a permanent asset. The cache expires. DeepSeek likely uses an LRU cache with a sliding window of attention. If a conversation is idle for too long, the cache is evicted. The next request will be a miss, and all the previously saved cost comes back. In a long-running agent workflow, the developer might not have 100% control over the time between turns. If the agent is dealing with rate limits or user delays, the cache can expire. This means the hit rate is a function of time, not just format. ZCode may be using techniques to keep the cache warm, such as pinging the API in the background. But that costs money too. The true optimization is not just about hit rate; it's about the total cost of the warm-up calls. Let me also point out a gameplay flaw: The cache hit rate can be "gamed" by clients that send the same request multiple times. If a client is stuck in a loop, it will generate many identical requests and achieve a perfect hit rate, but it produces no value. This is analogous to wash trading. We need to validate whether ZCode's actual sessions produce meaningful coding progress. Without that validation, the 98.6% number is just a trophy. But even with these caveats, the difference between 89.31% and 98.60% is too large to be explained by task distribution alone. The gap of 9.29 percentage points is a structural warning. It says that the best-known tool is the least cache-aware in this particular setting. Why would a market-leading tool be so careless? Perhaps because Anthropic assumes that its users will use Anthropic's API, not DeepSeek's. This is a classic vertical integration trap. The same thing happened in the blockchain industry when centralized exchanges built their own chains. Users who borrowed those chains for other purposes suffered. The other contrarian angle is the role of Zhipu itself. Zhipu is a state-affiliated university spinoff. Some Western developers might avoid its tool due to geopolitical concerns. That is a valid risk. If Zhipu or DeepSeek are subject to sanctions, the cache hit rate may not be available for long. But for the purpose of this article, the technical lesson remains. Now let me bring back the blockchain perspective. In the crypto world, there is a concept called "subsidized gas." When a project subsidizes a user's gas fees, the user adopts the project, but the moment the subsidy ends, the user leaves. ZCode's cost advantage is not a subsidy; it is a technical edge. This is more sustainable. But it can be copied. OpenCode can adopt the same discipline. Anthropic can update Claude Code to be more cache-aware on third-party APIs. The edge will narrow over time. However, the first-mover in cost efficiency often builds a community of dedicated users, and that community is the true moat. Let's think about what a copy trading community founder has to do with this. I have learned that the best strategy is not to gimmick the market, but to preserve cash. In a bear market, the traders with the lowest cost basis survive. In an AI agent bear market, the developers with the lowest token burn rate survive. ZCode gives them that edge. It is like finding a DEX that offers zero gas for limit orders. You don't need to tell everyone; you just quietly use it. This data is a wake-up call. The next time you benchmark an AI agent, do not just compare the quality of the output. Compare the size of the cache miss. Ask the vendor: "What is your client-side cache hit rate when connected to DeepSeek?" If they don't know, that is a red flag. If they know, and it's below 95%, that is a cost bomb ticking in your production environment. What should you do today? If you are using Claude Code with DeepSeek, test ZCode. It is available for many platforms. If you prefer a more independent tool, study OpenCode V2's design and emulate its context management. At minimum, inspect your own prompt templates. Remove timestamps. Keep the system prompt static. Move dynamic information to the tail. The result could be a 70% reduction in input cost, which is not a feature; it's a survival mechanism. I am not going to tell you that ZCode will be the "winner." I have seen too many flash-in-the-pan protocols in my years. But I will tell you that the underlying trend is clear: the future of AI agents belongs to those who treat context as a finite resource. Just like block space, context space is expensive. The agents that respect this will thrive. The ones that don't will be priced out. So, as the market moves sideways, and developers wait for the next model to spark a rally, I am watching a different chart. I am watching the cache hit rate. It is the silent chart that moves first. Flows change, but the current remains. The current here is not the model's intelligence. It is the efficiency of the infrastructure. And right now, the current flows through a tool nobody knew: ZCode. The numbers of the table from Dax Raad are not the end of the story. They are the beginning of a new metric in the AI stack. Next time you hear someone say "the model is all that matters," show them the 27% number. Because in the long run, the model is a commodity. The cache is the alpha. And the alpha, as always, lives in the shadows. We trade in shadows to find the light. Silence is the loudest audit. ZCode has been silent, but its 98.6% hit rate is a screaming audit of everyone else's context management. I am listening.

The 98.6% Cache Arsenal: How ZCode, an Unknown Chinese ADE, Is Quietly Crushing Claude Code on DeepSeek Costs