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

Databasus PostgreSQL Backup Tool Gains Anthropic Open Source Support
Anthropic has recognized the open source database backup tool Databasus through their Claude for Open Source program, providing maintainers with free access to Claude Max. The tool supports PostgreSQL, MySQL, MariaDB, and MongoDB with scheduled backups, 70+ storage destinations, and AES-256-GCM encryption.

Visdiff: Visual Feedback Loop for Claude's Frontend Code Generation
Visdiff addresses the visual accuracy gap in Claude's frontend code generation by comparing rendered output pixel-by-pixel with Figma designs and feeding differences back into the loop until they match.

alogin: A Go-based Security Gateway for AI Agents with Human-in-the-Loop
alogin is an open-source Go-based security gateway that provides a secure conduit between AI agents and infrastructure, featuring built-in MCP server support for Claude Desktop, human-in-the-loop safety rails, and encrypted credential storage.

Vibe Remote: Mobile Bridge for Claude Code Access from Anywhere
Vibe Remote is a mobile app that provides remote access to Claude Code development environments from a phone, allowing users to maintain their local configs, Git history, and file tree without requiring Tailscale or complex VPN setups.