Dao Code makes a bet that most coding agents avoid: instead of paying for quality with an expensive frontier model, it wrings quality out of a cheap one by treating the prefix cache as a first-class engineering surface. The whole project is organized around the fact that DeepSeek's prefix-cache hit price is roughly 1/120 of a miss, and that ratio changes what you can afford to do.
The cache is the architecture
Most agents bolt memory and self-review on top of the model and eat the token cost. Dao Code inverts that. It keeps the system prefix, tool table, and memory byte-stable so DeepSeek's cache keeps hitting, then runs its heavier machinery on forks that reuse that same main prefix cache. Reflection, cross-session memory, and refocusing all ride the cache instead of paying full freight. The README frames the design goal plainly: cross-session memory and a continuous self-correction layer that add almost no token cost.
That claim comes with receipts. The team ran seven SWE-bench-style tasks on real open-source repos (valibot, date-fns, es-toolkit, sqlglot, hono), pushed 3.89M input tokens, and logged a 95.8% aggregate cache hit rate, ranging from 85.4% to 97.7% per task. A full feature cycle of read, edit, test, and self-review reportedly runs ¥0.07 to ¥0.21, averaging ¥0.15; all seven tasks together came to ¥1.07. Every figure traces back to a per-run agent.log, and you can replay the accounting with /cost. Pricing the same token traces under each vendor's official rates, the README puts the total at roughly 30x cheaper than Claude Opus 4.8 and 18x cheaper than Sonnet 4.6, and it credits the high hit rate to Claude too, in Claude's favor.
Whether those multiples hold on your workload is a separate question, but the honesty of the setup is notable. The tasks are real bug fixes, the test files are hidden from the agent to block reward-hacking, and there's a npm run accept:cache command that runs a live multi-turn conversation so you can watch the hit rate climb from cold start to steady state yourself.
Availability as a design constraint
The second thing Dao Code optimizes for is being able to run at all. The README is direct about its context: it is Chinese-first and targets users in mainland China, where Claude Code needs an Anthropic account and network access, and GLM's coding quota is hard to grab. DeepSeek, by contrast, is register-and-go and directly reachable there. That framing explains a lot of the project's priorities that would otherwise read as odd for a Claude Code clone.
And it is fairly openly a Claude Code clone in its surface area. Dao Code mirrors the familiar kit: 24 tools, layered allow/ask/deny permissions plus a smart auto approval mode, Skills, MCP over stdio and HTTP/SSE, Hooks on five lifecycle events, custom subagents, slash commands, and plugins. It reads Claude Code config, so existing setups carry over. The differentiators sit underneath: shadow-git checkpoints that snapshot via /restore and /rewind without touching your real .git, auto-compaction to carry long tasks past the context limit, and a /audit cache command that fingerprints exactly what broke the cache across four dimensions.
The reflection layer
The self-correction machinery is worth calling out because it is where the cache economics pay off. Three forks handle it: a Challenger that questions the premise on a failure streak, a Refocuser that restates the original goal every N turns to fight scope creep, and a Reply-challenger that fires when you re-raise the same problem. There's also a constitution-style priority order where safety and truth outrank your current instruction, which outranks Dao Code's own cache discipline, which outranks skills and memory. A third-party skill can change how work gets done but never the safety or cache floor.
Dao Code is TypeScript, MIT-licensed, and installs via a one-line script, npx dao-code, or from source. It's early (created June 2026, a small contributor base), and the benchmark set is seven to fourteen tasks, not hundreds. But the core idea is specific and testable: build the agent so its expensive habits live in the cheap part of the bill.
GitHub: https://github.com/tigicion/dao-code
Curated by Agent Palisade — practical AI for small and mid-sized businesses.
Top comments (0)