Tag Archives: AI编程代理

Open-source plugin lets AI coding agents learn from past sessions to cut token costs

Original author: Brenda Potts

Researchers from UC Berkeley, Microsoft Research and Microsoft Security have released TokenEconomizer, an open-source plugin that helps AI coding agents spend fewer tokens by learning from earlier work in the same code repository. Developers often return to the same projects, yet agents usually begin every session from zero. They relearn how to run tests, load tool descriptions they never use, and burn many turns on the same error.

The team profiled Claude Code on 60 SWE-Bench tasks and found three recurring kinds of waste. Once a repository had at least five finished tasks, about 30% of tool calls repeated an earlier action in that repository, compared with only 7% matching another repository's history. The agent was given 23 tool descriptions every turn but never called 16 of them. Failed tasks made up 17% of the total but 32% of the spending.

TokenEconomizer reads each session's log and acts through three mechanisms. Micro-skills are one-line, repository-specific notes that enter the starting context only after several sessions confirm a pattern, and they are retired if later evidence contradicts them. Tool pruning removes tools the history suggests will go unused, while keeping core ones and allowing restoration. Failure-loop intervention uses a judge model to detect a stuck agent, suggests another approach, and alerts the developer if the agent stays stuck.

Tested on 277 SWE-Bench tasks across six repositories and five agent and model combinations, average costs fell by 18.4 to 30.9%, with success rates broadly stable. Savings grew as experience built up, and cumulative costs dropped below the default by the sixth task in every repository. Costs were also 16.0 to 21.2% lower on sequential web development and 6.4 to 19.6% lower on security auditing. Simply lowering reasoning effort saved similar amounts but hurt performance.

The plugin runs alongside existing agents without changing the underlying model, needs no API key of its own, and keeps what it learns on the developer's machine. For engineers and teams who rely on AI coding tools, it points to a practical way to reduce rising AI costs.


Source: Microsoft Research
Original title: Helping AI coding agents work smarter, for less
Original link: https://www.microsoft.com/en-us/research/blog/tokeneconomizer-learning-from-experience-to-make-ai-coding-agents-more-efficient/
Published: 2026-11-16

This is a summary written by our Editorial Team, not the full original text. Copyright remains with the original author and publisher; see the original link for the full article.

Disclaimer: The views and opinions expressed in this article are solely those of the original author(s) and do not necessarily reflect the views or positions of Overseas Chinese (overseaschinese.org). We republish, translate or summarize it for informational purposes only.

Proof-Driven Development: Making AI Coding Agents Keep to the Plan with Formal Proofs

Original author: Brenda Potts

Microsoft Research has introduced PDD Kit, a research prototype that applies formal verification to code written by AI coding agents. The motivation is that agents now produce changes of tens or even hundreds of thousands of lines, so reading every line in review no longer scales. Plans are supposed to be the contract between a developer and an agent, but nothing forces the agent to follow them, and the tests it writes often confirm what it built rather than what was requested.

The toolkit works inside GitHub Next's collaborative planning environment. It first asks the developer clarifying questions in plain language and records the answers in an intent document. Parts of that intent that can be formalized become specifications in Verus, a proof language for Rust. The rest become informal specifications backed by unit, end-to-end and browser tests. An agent then writes the code and the proof, and Verus deterministically checks that the code meets the spec for every possible input.

As a demonstration, the team verified the login logic of a roughly 5,000-line Rust storefront called Pet Store. The developer's request was two sentences: only the right password yields a token, and only admin accounts get admin tokens. PDD Kit turned this into eight contract clauses, including the often-missed converse that the right password must always succeed. It also made explicit the six pieces that must be trusted rather than proved, such as the bcrypt password check, database lookups and the clock, and wrote tests for each one.

To avoid weak specifications that verify but constrain nothing, the system plants one deliberate bug per clause and requires the verifier to reject it. Two reviewer agents also critique the spec. The resulting pull request labels each requirement as formally verified or empirically tested, and the proof check is added to continuous integration.

The authors are candid about limits. The tool only handles Rust today, proofs still take effort, a wrong spec is still possible, and the guarantees are only as strong as the trusted components. For engineers, the work points to a future where reviewing intent, not code, becomes a core skill, which matters for careers as AI-generated software spreads.


Source: Microsoft Research
Original title: Formally verifying agent-written full-stack web apps with PDD Kit – Microsoft Research
Original link: https://www.microsoft.com/en-us/research/blog/formally-verifying-agent-written-full-stack-web-apps-with-pdd-kit/
Published: 2026-11-05

This is a summary written by our Editorial Team, not the full original text. Copyright remains with the original author and publisher; see the original link for the full article.

Disclaimer: The views and opinions expressed in this article are solely those of the original author(s) and do not necessarily reflect the views or positions of Overseas Chinese (overseaschinese.org). We republish, translate or summarize it for informational purposes only.