Dako's AI Builder Notes
System
Color theme
Changsha HubOffline
大可 Dako
大可 Dako大可 DakoAI Builder · Agent PractitionerTurning AI into working software. Practical notes on agent engineering, vibe coding, and commercial delivery.
Platform links coming soon
The dirtier the context, the more it costs and the worse it gets01Bloatedold files, redundancy, history piledtogether02Compresssummarize the old, keep only what youneed03Cachereuse stable content, don'tretransmit✓ Feed it right, spend less and get better results
A clean context is both cheaper and better.

Slim the Context, Don't Let the Conversation Sour

Compress when you should, cache the stable content, drop the history you no longer need. Dirty context costs more and performs worse.

AI's cost is mostly spent on "context": every chunk you feed and every transmission is billed. As the context piles up and gets dirty, it's not just more expensive—it performs worse, because the model is distracted by a heap of irrelevant information.

After reading, you should be able to answer:

  • Why does dirty context cost more?
  • What specific techniques slim the context?
  • What's the difference between caching and compressing?

Why dirty context is expensive and bad

  • Expensive: fed content is billed by volume; history and redundancy are pure waste
  • Bad: it performs worse—a pile of irrelevant information makes the model drift, cutting quality and stability
  • Slow: more content, slower processing

Cost, quality, and speed all suffer from context pollution.

Techniques to slim it

  • Compress when you should: summarize a long session and continue, don't let history accumulate forever
  • Drop the history you no longer need: stale content and abandoned plans, don't keep them
  • Load on demand: tool schemas, docs—bring them when used, not preloaded in full google-patterns
  • Stable content in the cache prefix: system prompt, tool definitions—put stable content up front to maximize cache hits, not at the end (the end changes)

Caching vs compressing

  • Compress: genuinely reduce the information (summarize, trim)
  • Cache: the same stable content isn't retransmitted; a hit bills less

Both aim at "expressing the same thing in fewer tokens," one by cutting volume, the other by reuse.

Don't save tokens by cutting critical verification

  • Optimize on the denominator of "complete the task": if the task isn't done, every saved token is waste
  • Cutting a critical context to save a sliver of tokens leads to rework—a net loss copilot-cost
  • So: slim the "useless"; don't slim the "critical"

Feed context that's both clean and right, and your vibe coding is both fast and cheap. The last piece of the cost is "how to save on completing the task": save on completing, not on calls.

References

  1. How we make AI coding more cost-efficient (GitHub Copilot)
  2. 4 engineering patterns behind the strongest AI agents (Google)