Meet TokenEconomizer: Microsoft’s Plugin That Cuts Coding Agent Costs by Up to 30.9%

2026年10月30日 17:53
站內 AI 整理稿

A team of researchers from Microsoft Research and UC Berkeley have released TokenEconomizer, an open-source cost controller for coding agents.TokenEconomizer is a plugin that learns from past sessions in a repository to cut waste in later ones.

It works with Claude Code, Codex, GitHub Copilot CLI and Pi.It does not touch model weights or agent code.On 277 SWE-Bench tasks, it lowered mean cost by 18.4% to 30.9% across 5 agent-model settings.TL;DR Package: A standard-library Python package and agent plugins, with 3 switchable mechanisms.

Runs on: Any machine running Claude Code, Codex, Copilot CLI or Pi with Python 3.10+.No GPU and no API key of its own.Performance: 18.4% to 30.9% lower mean SWE-Bench cost, and cheaper in all 30 repository-setting cells.Best: 30.9% lower cost on Claude Code with Opus 4.8 (33.

2% when combined with RTK).Worst: Only 6.4% to 9.3% savings on ReposVul audits; Pass@1 drops 1.0 point on Opus 4.8.Why do coding agents waste tokens?Every agent turn re-bills the system prompt, every loaded tool schema and the full history.

The research team profiled 60 SWE-Bench tasks across 6 repositories using Claude Code with Opus 4.8.They found 3 recurring sources of waste: Repeated discovery: once 5 tasks precede the current one, 30% of tool calls repeat an earlier action.Unused tools: 23 tool schemas load every turn.

16 are never called, and 3 cover 98% of calls.Failure loops: 10 failed runs were 17% of tasks but 32% of total spend.They also tested 3 fixed open-source strategies: RTK, Serena and Aider’s RepoMap.None was cheaper everywhere.All 3 cut cost on Django and raised it on SymPy.

How does TokenEconomizer work?TokenEconomizer is an external controller that treats the agent as a black box.It keeps a state per repository, built from completed traces.Before each task, it sets 3 policies through the prompt, the tool settings and the event stream.1.

Micro-skills An LLM proposer turns trace digests into 1-line facts, such as the working test command.Each fact carries regex detectors that check later traces without a model call.A fact enters the prompt after 3 confirmations on tasks with non-overlapping edited files.

Its need rate must also stay at or above 0.4.One contradiction counts as 5 confirmations, so wrong facts retire quickly.2.Tool pruning Shell, read, write and edit tools are always kept.Other tools are masked after 3 consecutive unused tasks, or when an LLM judge marks them irrelevant.

The full catalog returns every 5 tasks for a re-audit.On Django with Claude Code, the first request on task 2 fell from 43,351 to 16,295 prompt tokens.3.Failure-loop intervention The controller learns a turn budget: 1.25 times the 90th percentile of successful run lengths.

Cheap rule checks flag repeated failures or dense errors.An LLM judge then decides if the agent is stuck, at 0.7 confidence or higher.A stuck agent gets 1 redirect, then a stop if the loop recurs.#mtp-te-embed iframe{width:100%!important;border:0!important;display:block;background:transparent!

important}#mtp-te-embed p:empty,#mtp-te-embed hr,#mtp-te-embed del,#mtp-te-embed s{display:none!important} (function(){var f=document.getElementById('mtp-te-frame');window.addEventListener('message',function(e){if(e.data&&e.data.mtpTE&&e.source===f.contentWindow){f.style.height=e.data.

h+'px';}});})(); What do the SWE-Bench results show?SettingCost vs defaultPass@1 defaultPass@1 TokenEconomizerClaude Code + Sonnet 5-23.6%74.776.0Claude Code + Opus 4.8-30.9%74.073.0Codex + GPT-5.6 Terra-24.7%73.874.7Codex + GPT-5.6 Sol-26.1%80.181.7Copilot CLI + Sonnet 5-18.4%75.077.

6 Source: arXiv 2610.22732, Table 1.Costs include all controller calls.3 seeds per setting.Pass@1 improved in 4 of 5 settings.Lower reasoning effort saved cost but cut Pass@1 by 1.8 to 10.3 points.RTK alone raised cost in 12 of 30 repository-setting cells, and RepoMap in 15.Savings build over time.

Most repositories cost more at first, but all were cheaper by the sixth task.Alone on Claude Code, tool pruning saved 13.2% to 17.7%, micro-skills 11.8% to 14.3%, and the loop guard 5.4% to 7.1%.Results also held outside SWE-Bench.Costs fell 16.0% to 21.2% on Web-Bench and 16.5% to 19.

6% on CredData.ReposVul saw only 6.4% to 9.3%, because shorter runs leave less to remove.How does it compare with other token-saving tools?

FeatureTokenEconomizerRTKSerenaAider RepoMapApproachLearns per-repository policies from past sessionsCompresses shell command outputMCP server with symbol-level code toolsRanked map of repository symbols in the promptLearns from earlier tasksYesNoNoNoLicenseApache 2.0Apache 2.0 CLI; BUSL-1.

1 engineGPL-3.0-or-later (MIT for SolidLSP)Apache 2.0AgentsClaude Code, Codex, Copilot CLI, Pi18 AI coding toolsAny MCP clientAiderMean SWE-Bench cost change (paper, 5 settings)-18.4% to -30.9%-8.9% to +4.5%Not in main runs (raised pooled cost in profiling)-6.1% to +6.

5%Cells with higher cost (of 30)012Not disclosed15 Cost rows: TokenEconomizer paper.Licenses and claims: each project’s repository or docs.How do you install TokenEconomizer?The plugin needs one of the 4 agents and Python 3.10 or newer.

On Claude Code, clone the repo, add it as a marketplace, then run claude plugin install [email protected] data stays local in ~/.tokeneconomizer.Tool pruning and the loop guard are on by default.Micro-skills are off by default, because the proposer adds model calls.

Key Takeaways TokenEconomizer cuts SWE-Bench cost 18.4% to 30.9% with an unchanged agent.It was cheaper in all 30 repository-setting cells; RTK and RepoMap were not.Tool pruning is the biggest single lever, at 13.2% to 17.7%.Pass@1 rose in 4 of 5 settings and fell 1.0 point on Opus 4.8.

It is Apache 2.0 and installs on Claude Code, Codex, Copilot CLI and Pi.Check out the Paper, GitHub Repo and Project Page.Also, feel free to follow us on Twitter and don’t forget to join our 150k+ML SubReddit and Subscribe to our Newsletter.Wait!are you on telegram?

now you can join us on telegram as well.Need to partner with us for promoting your GitHub Repo OR Hugging Face Page OR Product Release OR Webinar etc.?Connect with us The post Meet TokenEconomizer: Microsoft’s Plugin That Cuts Coding Agent Costs by Up to 30.9% appeared first on MarkTechPost.

Related

相關文章

智東西生成式AI

英特爾與騰訊發佈基於至強6+的雲實例,曬智能體AI基礎設施全家桶

作者 | ZeR0 編輯 | 漠影 11月3日報道,近日,在2026騰訊全球數字生態大會上,英特爾與騰訊雲發佈基於英特爾至強6+處理器的騰訊雲新一代雲實例,並全面展示英特爾的芯片產品與雲端實踐。 全新至強6+處理器擁有最高288顆能效核,單顆處理器最高可支持超過1000個智能體的穩定部署,這也為騰訊雲服務器提供更高併發、更低時延、更優能效的雲端算力服務。

1 小時前
雷峰網生成式AI

智元榮獲2026世界互聯網大會傑出貢獻獎

11月3日,2026年世界互聯網大會烏鎮峰會在浙江烏鎮隆重開幕,國務院總理李強出席開幕式並發表主旨演講。開幕式上,智元憑藉在具身智能領域的系統性技術突破與產業化實踐,獲頒世界互聯網大會傑出貢獻獎。智元合夥人、高級副總裁朱潔在領獎時表示:人工智能的終局,不在於屏幕與雲端,而紮根於工廠一線和尋常煙火。具身智能賽道的競爭,早已跳出單點技術的競速,轉向軟硬協同、工程化落地、產業組織與治理體系的綜合比拼。智元期待與各界同心同行,堅守務實,躬身落地。

1 小時前

電動車退燒、AI 儲能燒起來:LG 新能源把產能挪向數據中心

11 月 3 日,首席財務官李昌植在財報電話會上給出時間表:今年底軟包儲能系統(ESS)產能將超 50 吉瓦時,明年進一步拉到 70 GWh 以上。在他看來,電動車增速放緩之際,AI 數據中心的大規模新建為電池廠撕開了新口子——第三季度 ESS 在手訂單已達 160 GWh,公司正與電力企業、超大型數據中心運營商談新項目,今年 9 月還作為儲能供應商擠進了英偉達的 DSX Ready 計劃。

2 小時前4700
雷峰網生成式AI

最高288核的至強6+,為了Agent高密度部署還下了哪些「雲功夫」?

作者 | 陳悅琳編輯 | 包永剛 一個智能體能順利完成任務,不代表成百上千個智能體就能同時高效運行。 對於承載大量智能體任務的雲服務器而言,除了提升計算速度,如何在任務集中到來時迅速準備好執行環境、怎樣減少暫時閒置的任務對內存資源的佔用,也成為亟待解決的問題。 對此,在一年一度的騰訊全球數字生態大會上,英特爾與騰訊雲聯合發佈了基於至強6+處理器的新一代雲實例,圍繞任務啟動效率、內存資源利用率等關鍵因素進行優化後,其綜合性能較上一代提升30%以上。

2 小時前

聯合國副秘書長點贊!千問AI耳夾式耳機亮相烏鎮互聯網大會

他認為,產品非常實用,適合自己日常工作中需要使用多國語言進行交流的場景。面對面交流時,用戶可以通過耳機收聽譯文;會議中的討論內容,也能通過AI聽記整理為結構化紀要,方便會後回顧。連接千問App後,用戶還可通過語音交辦資料研究等任務、接收完成提醒,讓耳機成為日常辦公的隨身助手。

3 小時前