<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: William Zhu</title>
    <description>The latest articles on DEV Community by William Zhu (@willzhu16).</description>
    <link>https://dev.to/willzhu16</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4008794%2F2b3e132a-3f71-4cd8-ad85-efa73c64e24a.png</url>
      <title>DEV Community: William Zhu</title>
      <link>https://dev.to/willzhu16</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/willzhu16"/>
    <language>en</language>
    <item>
      <title>GitHub Copilot went usage-based, so I built a linter for AI context files</title>
      <dc:creator>William Zhu</dc:creator>
      <pubDate>Tue, 30 Jun 2026 15:00:00 +0000</pubDate>
      <link>https://dev.to/willzhu16/github-copilot-went-usage-based-so-i-built-a-linter-for-ai-context-files-2i3k</link>
      <guid>https://dev.to/willzhu16/github-copilot-went-usage-based-so-i-built-a-linter-for-ai-context-files-2i3k</guid>
      <description>&lt;p&gt;As I'm sure a lot of you saw, GitHub Copilot recently moved from request-based billing to usage-based billing :(&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;...not that I ever did that...&lt;/p&gt;

&lt;p&gt;But the more I looked into it, the more I realized the token count was only part of the problem.&lt;/p&gt;




&lt;h2&gt;
  
  
  The part I didn't expect
&lt;/h2&gt;

&lt;p&gt;The weirder issue was that I didn't really have visibility into what gets loaded into the AI assistant's context.&lt;/p&gt;

&lt;p&gt;For me, that meant Copilot instruction files. But depending on your stack, it might be &lt;code&gt;CLAUDE.md&lt;/code&gt;, &lt;code&gt;AGENTS.md&lt;/code&gt;, MCP configs, old AI notes nobody cleaned up, or other agent-related config sitting around the repo.&lt;/p&gt;

&lt;p&gt;When I pointed my extension at a real public project, the open-source Cline repo, it found around &lt;strong&gt;29k tokens&lt;/strong&gt; in the loaded instruction/config layer before I'd typed anything.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuj1panyce5w17olzdvmz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuj1panyce5w17olzdvmz.png" alt="ContextGuard Status Bar - Cline" width="624" height="91"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And honestly, I couldn't have told you what half of it was.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb6i8y9zru9xeosnvq27y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb6i8y9zru9xeosnvq27y.png" alt="ContextGuard Injected Preview - Cline Repo" width="800" height="972"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;




&lt;h2&gt;
  
  
  So I built ContextGuard
&lt;/h2&gt;

&lt;p&gt;ContextGuard is a VS Code extension for inspecting and linting the AI config/instruction layer in your workspace.&lt;/p&gt;

&lt;p&gt;It's more than a token counter. It's built to answer:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What is my assistant already seeing, and is any of it weird?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9p9djze9rj60mr3cyt7d.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9p9djze9rj60mr3cyt7d.gif" alt="ContextGuard scanning Cline repo" width="600" height="853"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What it does:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Shows your auto-loaded token baseline in the status bar&lt;/li&gt;
&lt;li&gt;Previews what config/instruction files are being loaded, in order&lt;/li&gt;
&lt;li&gt;Flags broken import references and stale instruction files&lt;/li&gt;
&lt;li&gt;Flags likely secrets in AI-visible files, with exact line numbers&lt;/li&gt;
&lt;li&gt;Lets you bundle selected files/context for web agents&lt;/li&gt;
&lt;li&gt;Optionally estimates monthly cost from that baseline, with configurable usage assumptions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbhnepyrbko7blh9vg98h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbhnepyrbko7blh9vg98h.png" alt="ContextGuard flagging a fake secret in a test repo" width="543" height="96"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's free, runs fully local, and makes no network calls.&lt;/p&gt;




&lt;h2&gt;
  
  
  The honest caveats
&lt;/h2&gt;

&lt;p&gt;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 &lt;code&gt;CLAUDE.md&lt;/code&gt;" cases, but please do not treat it as airtight secret scanning.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;I'm sharing it here partly because I'm curious whether other people's AI context baselines look as weird as mine did.&lt;/p&gt;




&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;Marketplace: &lt;a href="https://marketplace.visualstudio.com/items?itemName=bearinblue.contextguard" rel="noopener noreferrer"&gt;https://marketplace.visualstudio.com/items?itemName=bearinblue.contextguard&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Website: &lt;a href="https://bearinblue.github.io/contextguard/" rel="noopener noreferrer"&gt;https://bearinblue.github.io/contextguard/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;Thanks for reading, and happy Fourth to everyone celebrating!&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>vscode</category>
      <category>ai</category>
      <category>githubcopilot</category>
    </item>
  </channel>
</rss>
