Agent frameworks waste 350,000+ tokens per session resending static files

Token waste benchmark results
Measurements on a local Qwen 3.5 122B setup revealed that agent frameworks waste more than 350,000 tokens per session by repeatedly resending static files. The source describes these numbers as "unreal."
Optimization approach
A compile-time approach was discovered that reduces query context from 1,373 tokens to just 73 tokens. This represents a 95% reduction in token usage for this specific context.
The benchmark also found that naive JSON conversion makes the problem 30% worse, increasing token waste beyond the baseline measurements.
Technical context
Agent frameworks typically include system prompts, tool definitions, and other configuration data that remains static across multiple interactions within a session. When this data is resent with every query, it consumes tokens without providing new information to the model. This is particularly costly with large models like Qwen 3.5 122B where token processing directly impacts both performance and cost.
The compile-time approach likely involves pre-processing static elements so they're referenced rather than resent, similar to how modern web applications cache static assets. For developers working with AI coding agents, reducing this overhead can significantly improve response times and reduce operational costs.
📖 Read the full source: r/LocalLLaMA
👀 See Also

Mneme: A Free, Local-First Claude Chat Client with Persistent Memory
Mneme is a free, open-source, local-first Claude chat client with tiered memory, entity tracking, daily summaries, and support for Sonnet 4.5 via the Anthropic API.

Cowork Context Management Kit Solves Claude's File Overload Problem
A developer built a context management kit for Cowork after Claude AI was reading all 462 files in their project folder, causing performance issues and contradictions. The solution includes global instructions, a manifest file system, and a Cowork skill to prioritize relevant documents.

Leanstral: Open-Source Code Agent for Lean 4 and Formal Proof Engineering
Mistral AI released Leanstral, the first open-source code agent designed for Lean 4, with 6B active parameters and Apache 2.0 licensing. Benchmarks show it outperforms larger open-source models and offers competitive performance to Claude at significantly lower cost.

Claude Code Plugin /verify: Automated Browser Testing from Your Plan
/verify is an open-source Claude Code plugin that reads your plan, spins up a real browser via Playwright MCP, checks each requirement, and gives you a pass/fail report with screenshots.