Skip to content

This Is The Microsoft's New Plan To Fix Claude Usage Limits

Read the Portuguese translation →

Author: AI LABS · Watch on YouTube

Video authored by the channel shown, not by IANIA; all rights belong to the creator. Transcript and summary generated automatically; the original-language content is preserved.

Original language: English

Original video: This Is The Microsoft’s New Plan To Fix Claude Usage Limits · Channel: AI LABS · 12:53 · Watch on YouTube

Topics: AI agents, Claude Code, AI developer tools, Model inference and optimization, AI safety

The video explains Token Economizer, a plugin for Claude Code, Codex, and other agents that aims to reduce token use by learning from project sessions. It describes how the plugin records recurring mistakes as micro-skills, disables tools that go unused, and intervenes when Claude appears stuck. Because the plugin starts with no project history, the presenters modified it to learn from Claude Code’s saved past sessions, then demonstrated commands for inspecting its behavior and measuring token savings. In their tests, the modified plugin reduced token use on later tasks, although the video notes that it may cost more during its initial learning sessions.

  • Token Economizer learns from agent sessions within each project rather than creating a project file map.
  • It can save recurring project-specific facts as micro-skills so Claude can avoid repeating known mistakes.
  • Tools unused across 10 messages over at least two sessions can be disabled for that project.
  • A stuck-task check can prompt Claude to try a different approach; it does not stop Claude automatically.
  • Micro-skills are off by default because generating them uses the user’s limit and project output could contain prompt injection.
  • The presenters modified the plugin to learn from previous sessions stored in Claude Code’s main.claude folder.
  • The status, micro-skills, tool prune, tool prune measure, and tool prune restore commands help inspect and manage the plugin.
  • In one demo, estimated tokens per message fell from about 34,300 to about 24,400 after unused tools were pruned.
  • In another test, the plugin completed three tasks in 79 steps rather than 99 and cost about 21% less, with both runs passing the same checks.
  • Savings may not appear immediately: the plugin can initially cost more while it learns from a project.
Start Chapter Summary
00:00 What Token Economizer does The video introduces the plugin, contrasts its learning-based approach with project mapping tools, and summarizes Microsoft’s reported test results.
02:04 How it saves tokens The presenters explain token-heavy context and describe micro-skills, pruning unused tools, and checking whether Claude is stuck.
05:10 Installing and configuring the plugin After a sponsor segment, the video shows where to install the plugin and explains its hooks and why micro-skills are off by default.
08:16 Using past sessions to improve learning The presenters explain the plugin’s initial learning gap and modify it to use Claude Code’s saved session history as a starting point.
09:48 Inspecting and measuring savings The video demonstrates the plugin’s commands for checking learned facts, pruned tools, token estimates, and restoring tools.
11:51 Task test and conclusion The presenters report results from a three-task comparison and note that savings become more apparent after the plugin has learned.

It finds those savings in places you’d never think to look — 00:00

These facts are called micro skills. — 03:38

It never stops Claude by itself. — 04:40

At first, it can even cost you more while it’s still learning. — 08:16

With the plug-in, it took 79 steps and the whole thing cost about 21% less. — 12:22

Token Economizer, Microsoft, Claude Code, Codex, GitHub, micro-skills, prompt injection, Data Impulse

00:00 Microsoft built a tool that fixes your token usage and it’s called token economizer. And interestingly, this tool gets better the more you use it, so it saves you more tokens over time. It finds those savings in places you’d never think to look, even if you’re already using other tools to save tokens. But the tool has one gap we didn’t expect, so we changed the tool ourselves to close that gap. And when we tested how this tool held up when put to actual work, it did more than just save us tokens. If this is your first time, we’re a software company and this is our

00:30 channel AI Labs. And in this video, we’re going to show you how token economizer cuts your token usage, how to set it up and use it, and how to fix the problem it has. [snorts] Now, token economizer is a tool that makes your agent use fewer tokens on every task. Once you install it, every session you run in a project costs less than it would without it, and you don’t have to change the way you work. Now, you might think there are already a lot of tools that save tokens. We’ve covered a few of them on our channel, too, and Graft is one of them. So, why would you need another one? Graft and a lot of other

01:00 tools make a map of all the files in your project before you start. That way, when the agent needs something, it can find it right away instead of wasting tokens looking for it. But token economizer works a little differently. Instead of making a map, it learns from how you work. It watches every session and the commands your agent runs in it, and it keeps track of where tokens are being wasted. Then it cuts that waste out of the sessions that come after. Now, Microsoft also shared all the results from their own tests along with the data behind them. They gave the agent 277 real bugs to fix from six real

01:33 projects on GitHub, and they had it fix each project’s bugs one after another. They did that on five different setups across Claude Code, Codex, and GitHub Copilot. On every one of those setups, the tasks cost less with the tool than without it. On Claude Code, Sonnet 5 cost 23.6%less, and Opus 4.8 cost 30.9% less. And this tool didn’t affect the performance of any model. Sonnet actually fixed one more bug out of every hundred than it did without the tool because with fewer tokens in every

02:04 message it could stay focused on the task. But before we move forward, it would be great if you subscribe to the channel and hit the hype button. This small gesture of support goes a long way for us. But before we install token economizer, let’s understand how it actually works. And to see how this tool actually reduce your token usage, you first need to understand what’s actually using up the tokens. Every time you message your agent, it sends a request to the model that generates the answers for you. But it doesn’t just send your prompt to the model. Since models don’t remember things on their own, you also

02:36 need to send them extra context about everything in your project. So every request carries the instructions the agent always follows and the list of every tool it can use to work on your project. It also carries the MCP tools and skills you’ve added along with the whole conversation up to that point. But when you keep working on the same project, a lot of the context being sent to the model is stuff it doesn’t even need. All of that stays in the context and wastes tokens. Your agent also wastes tokens on mistakes. It fixes a mistake in one session, but the next

03:06 time you run it in the same project, it has to learn the same thing again by failing at it. On top of that, it carries around tools it never even uses. Token economizer finds these places where your agent wastes tokens. It watches the sessions you’ve opened in that project and it fixes three things in them. The first one is the mistakes Claude keeps making again and again in your project like running a tool or a command that doesn’t work. Claude doesn’t remember what worked and what didn’t from one session to the next. So every time it’ll try the same command that didn’t work and then spend tokens

03:38 trying to fix the same mistake. This is where the tool helps because it looks out for mistakes like this. When it sees Claude making the same mistake multiple times, it writes it down as a fact about your project. These facts are called micro skills. Once a few more sessions confirm that a fact is right, the tool saves it for that project. Whenever you start a new session, it gives the agent that information as something it already knows to be true about your work. That way your agent already knows this didn’t work before, so it doesn’t try it again. The second one is the tools you never use. Claude Code loads a lot of tools

04:09 into every session. If one of them doesn’t get used across 10 of your messages over at least two sessions, the tool turns it off for that project. That way, it stops getting sent with every message. Microsoft’s own numbers show this one saves the most tokens because it reduces the tools that are being sent at each turn, but it does this without asking you. So, you won’t even know it took a tool out of your context window. But, there’s a command that shows you the tools it turned off, and we’ll show you that command later in the video. The third one is when Claude gets stuck. Sometimes, an agent works on a task and

04:40 can’t find a way to do it. So, it keeps trying things that don’t work. And sometimes, it keeps going for way longer than Claude usually takes to answer one of your messages in that project. When the tool sees this, it asks a model to check if Claude is really stuck. Only if it is, the tool tells Claude once to try something different, so it doesn’t stay stuck in a loop. If Claude is still stuck after that, the tool tells you to press escape and stop it. It never stops Claude by itself. But, before we install it, let’s have a word by our sponsor, Data Impulse. We had Claude Code build a

05:10 tool to check where our site ranks in other countries, and Google blocked it almost immediately because every request came from the same place. A VPN wouldn’t help here because we needed multiple countries and real volume. That’s where Data Impulse comes in. It’s a proxy network with 90 million plus IPs across 195 countries, and the dashboard shows how many are live in each one before you pick. We pointed our tool at it, and the agent could search from the US, Germany, and Japan like someone sitting there. Nothing got blocked, and we had real

05:42 rankings for every country in minutes. You can hold the same IP for up to 2 hours. You only pay for the traffic you buy, and it never expires. And residential proxies are $1 per gigabyte. When something breaks, you get actual people on support 24/7. We’ve been running our own builds on it for a while, and it just works. Grab the $1 per gigabyte deal at dataimpulse.com. The link’s in the description. Now, this tool is actually a plugin that’s available for Claude Code, Codex, and a few other AI agents. And to install this tool, you just need to go to their

06:14 GitHub repo and scroll down to the install section. The install commands for all the agents are listed there. So, you can just copy the command for the agent you’re using and paste it into your terminal and it will be installed for you. When you open Claude Code and run the plugin command, you’ll see Token Economizer in your list. It adds a few commands and hooks. The hooks run on their own at set times, like when a session starts or when you send a message. These hooks are how the plugin runs the three things we went through earlier without you having to do anything. The micro-skills we talked

06:44 about get handed to Claude by a hook that runs at the start of every session. So, Claude already has all the facts for your project. While Claude is working on your prompt, another hook checks on it after every tool it uses and that’s how the plugin knows when Claude is stuck and needs a push. And once the session ends, the plugin looks back over everything that happened in it all on its own. That’s where it learns new facts for next time and keeps count of the tools that never got used. Now, once you’ve installed this tool and run its config command, you’ll see that most of its features are turned on, but

07:14 micro-skills are turned off when you first install it. Micro-skills are off for two reasons. The first reason is to save your limit. Once it’s on, every three sessions it asks a model to read through your recent sessions and write the facts and that uses some of your own limit. And the second reason is safety. The facts it writes come from whatever the commands in your project print out and Claude reads them at the start of every session as if they were true facts about your project. So, if you download a project from someone else, whoever made it could hide instructions in what

07:44 its commands print. Those instructions would end up in the facts and Claude would treat them as true in every session unless you change them yourself. This is basically what’s known as a prompt injection. That’s why Microsoft leaves the choice to you. But for your own projects, you should turn it on because in Microsoft’s tests, it was the feature that saved a lot of tokens. So, if you want to turn on micro-skills, you need to run the Token economizer config command and set micro skills to on. And that way, you’ll be able to use this feature. But even [snorts] with micro skills turned on, there’s one problem

08:16 with this tool. As we said earlier, it learns from the way you use your agent. So when you first install it, it hasn’t learned anything yet, which means it won’t save you anything at first. To see results, you’d have to use it on the same project for a while. And that’s true even for projects you’ve already been working on for a long time. Because if you install it now, it has nothing to learn from. So you have to wait before it starts paying off. And at first, it can even cost you more while it’s still learning. In Microsoft’s own tests, almost every project cost more with the plugin at first and only got cheaper by

08:47 the sixth task. And this happens in every single project because the plugin learns each project on its own and nothing carries over from one to the next. But Claude Code already saves all your sessions in the main.claude folder for 30 days, so you can use those past sessions to fix this. So to fix the problem, you just need to ask Claude Code to change the tool. We gave it the repo and asked it to change the tool so that when it starts, instead of starting from a blank state with no memory of what happened before, it goes through the session history that Claude stores

09:18 in the main.claude folder first. It should use that as the starting point instead of starting from scratch. If you want to make this change yourself, you can pause here and copy the prompt from the screen. When you give it that prompt, it will start working on the changes in the repo and once it’s done, the tool will be ready for use. It changed the repo so that when you open the first session after installing this version, it starts a task that runs in the background and goes through the sessions you’ve run before in the same folder. Then it keeps everything it learned from those sessions as its

09:48 starting point instead of starting blank. If Claude didn’t install it for use everywhere, ask Claude to make that change. Once it’s done, all your projects can benefit from the context saved from previous sessions. This won’t do anything for a brand new project because there’s no history to read, but for the projects you’re already working on, it means the plugin doesn’t start from zero. So to see if it actually saves anything, we installed our changed version and used it on a demo project. This tool comes with a few commands that show you what it’s doing. The first one is the status command. This is the

10:18 command you run whenever you want to know what the plugin is doing in the project you’re in. It shows how many sessions it has learned from, how many tokens those sessions used, and what each of its features has done so far. In our project, it had already learned from four sessions and the stuck check hadn’t needed to step in once, but it already had a long list of tools it could turn off. The status command also shows how many micro-skills facts it’s handing Claude at the start of every session. So, to see what it’s actually telling Claude for your project, you need to run the micro-skills command. It lists the

10:49 facts the plugin hands Claude at the start of every session and the ones it’s still checking. The status command also lists the tools the plugin is turning off, but it only gives you their names. So, to see why each tool is on that list, you run the tool prune command. It lists every tool it’s turning off in that project and next to each one it shows how many sessions and messages went by without that tool being used. On our project, 276 tools had gone unused across all four sessions and since the plugin turns them off without telling you, this command is the place to check

11:20 whenever Claude suddenly can’t do something it used to do. But, a long list of tools doesn’t tell you how much it actually saves you. So, that’s what the tool prune measure command is for. It counts how many tokens every message takes with all your tools and how many it takes with only the ones you use. On our project, every message went from about 34,300 tokens down to about 24,400, which is about 29%less on every single message. But, what if Claude needs one of those tools later? A tool the plugin turned off stays off in that

11:51 project, so you can just run the tool prune restore command with the name of the tool and it gives that tool back. And once you’ve given a tool back, the plugin won’t turn it off again. When we tested it on another app, we first ran five sessions on it with the plugin on so that it had something to learn from. In those sessions, it turned off 303 tools. Then, we gave Claude three new tasks on that app and ran each one twice. Once with the plug-in and once without. Both runs started from the exact same code. Without the plug-in, Claude took 99 steps to finish all three

12:22 tasks. With the plug-in, it took 79 steps and the whole thing cost about 21% less. Both versions also passed the same checks. So, in the first sessions, when the plug-in hadn’t learned anything yet, it cost a little more than a session without it. The savings started showing up in later sessions once it had learned something. So, you’re going to see more of a difference as you keep using it. Now, if you want to use the changed and refined tool, you can get it on AI Labs Pro, which is our community. So, if you found value in what we do and want to support the channel, this is the best way to do it. The link’s in the

12:53 description. That brings us to the end of this video. If you’d like to support the channel and help us keep making videos like this, you can do so by using the Super Thanks button below. As always, thank you for watching and I’ll see you in the next one.