As I'm sure a lot of you saw, GitHub Copilot recently moved from request-based billing to usage-based billing :(
Copilot is the main AI coding tool I use day-to-day, so the change made me look a lot harder at how much context I was actually feeding these tools. No more casually attaching half the repo and saying "loop until done" without wondering what that costs.
...not that I ever did that...
But the more I looked into it, the more I realized the token count was only part of the problem.
The part I didn't expect
The weirder issue was that I didn't really have visibility into what gets loaded into the AI assistant's context.
For me, that meant Copilot instruction files. But depending on your stack, it might be CLAUDE.md, AGENTS.md, MCP configs, old AI notes nobody cleaned up, or other agent-related config sitting around the repo.
When I pointed my extension at a real public project, the open-source Cline repo, it found around 29k tokens in the loaded instruction/config layer before I'd typed anything.
And honestly, I couldn't have told you what half of it was.
That layer can quietly become messy: stale notes, broken references, files you forgot existed, or even secrets that really should not be sitting in AI-visible config.
So I built ContextGuard
ContextGuard is a VS Code extension for inspecting and linting the AI config/instruction layer in your workspace.
It's more than a token counter. It's built to answer:
What is my assistant already seeing, and is any of it weird?
What it does:
- Shows your auto-loaded token baseline in the status bar
- Previews what config/instruction files are being loaded, in order
- Flags broken import references and stale instruction files
- Flags likely secrets in AI-visible files, with exact line numbers
- Lets you bundle selected files/context for web agents
- Optionally estimates monthly cost from that baseline, with configurable usage assumptions
It's free, runs fully local, and makes no network calls.
The honest caveats
Big disclaimer: the secret detection is heuristic, so it's a safety net, not a guarantee. It'll catch some obvious "oh no, that's a key in my CLAUDE.md" cases, but please do not treat it as airtight secret scanning.
It's also brand new and my first real VS Code extension, so I'd genuinely love feedback. If the UX is confusing, if it misflags something, or if it doesn't match how your AI setup works, please tell me and I'll patch what I can.
I'm sharing it here partly because I'm curious whether other people's AI context baselines look as weird as mine did.
Try it
If you do try it, I'm honestly curious what your baseline comes out to. I have a feeling some of these are bigger than people expect.
Marketplace: https://marketplace.visualstudio.com/items?itemName=bearinblue.contextguard
Website: https://bearinblue.github.io/contextguard/
The GIF is from the open-source Cline repo, which I used because it's a public project people can inspect. The secret example is from a test repo I made with fake keys. Not a real leak, thankfully.
Thanks for reading, and happy Fourth to everyone celebrating!




Top comments (0)