<?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: Christian Frascogna</title>
    <description>The latest articles on DEV Community by Christian Frascogna (@framy2).</description>
    <link>https://dev.to/framy2</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%2F4194500%2F5aee59e0-e856-4578-9d91-e4caa612e1a0.png</url>
      <title>DEV Community: Christian Frascogna</title>
      <link>https://dev.to/framy2</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/framy2"/>
    <language>en</language>
    <item>
      <title>Why your MCP servers are secretly eating 30,000 tokens per turn (and how to tree-shake them)</title>
      <dc:creator>Christian Frascogna</dc:creator>
      <pubDate>Mon, 19 Oct 2026 16:55:26 +0000</pubDate>
      <link>https://dev.to/framy2/why-your-mcp-servers-are-secretly-eating-30000-tokens-per-turn-and-how-to-tree-shake-them-10ai</link>
      <guid>https://dev.to/framy2/why-your-mcp-servers-are-secretly-eating-30000-tokens-per-turn-and-how-to-tree-shake-them-10ai</guid>
      <description>&lt;p&gt;If you use &lt;strong&gt;Claude Code&lt;/strong&gt;, &lt;strong&gt;OpenAI Codex CLI&lt;/strong&gt;, or &lt;strong&gt;Cursor&lt;/strong&gt; with 4–5 MCP servers connected (GitHub, Playwright, Postgres, Notion, Linear), there is a hidden tax running on every single turn: &lt;strong&gt;MCP JSON tool schemas&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Before you even type a prompt, every connected MCP server dumps its full &lt;code&gt;tools/list&lt;/code&gt; JSON schema into your context window. A single server with 20+ tools can consume &lt;strong&gt;15,000 to 35,000 tokens per turn&lt;/strong&gt;, degrading model reasoning and burning through your rate limits.&lt;/p&gt;

&lt;p&gt;At the same time, multi-agent teams now have to maintain &lt;code&gt;CLAUDE.md&lt;/code&gt;, hierarchical &lt;code&gt;AGENTS.md&lt;/code&gt; (which OpenAI Codex CLI silently truncates at &lt;code&gt;32 KiB&lt;/code&gt;), and &lt;code&gt;.cursor/rules/*.mdc&lt;/code&gt; — while making sure nobody accidentally commits an API key or a prompt-injection payload inside &lt;code&gt;.mcp.json&lt;/code&gt; or &lt;code&gt;.claude/skills&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To solve this locally with &lt;strong&gt;zero API keys and zero telemetry&lt;/strong&gt;, I built &lt;strong&gt;&lt;a href="https://github.com/FramY2/ctxwise" rel="noopener noreferrer"&gt;CtxWise v1.0&lt;/a&gt;&lt;/strong&gt; (&lt;code&gt;@framy2/ctxwise&lt;/code&gt; on npm, Apache-2.0).&lt;/p&gt;

&lt;h3&gt;
  
  
  What CtxWise v1.0 does in one CLI:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Live MCP Schema X-Ray &amp;amp; Tree-Shaking (&lt;code&gt;mcp-xray&lt;/code&gt;)&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   npx @framy2/ctxwise mcp-xray &lt;span class="nt"&gt;--probe-stdio&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Queries your local MCP servers over stdio (&lt;code&gt;tools/list&lt;/code&gt;), calculates the exact token cost of every individual tool schema, flags &lt;code&gt;[BLOATED]&lt;/code&gt; tools, and lets you prune unused tools (&lt;code&gt;mcp-prune&lt;/code&gt;) to cut startup context by 50–80%.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Supply-Chain &amp;amp; Prompt-Injection Firewall (&lt;code&gt;shield&lt;/code&gt;)&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   npx @framy2/ctxwise shield &lt;span class="nt"&gt;--fail-on-risk&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Scans &lt;code&gt;CLAUDE.md&lt;/code&gt;, &lt;code&gt;AGENTS.md&lt;/code&gt;, &lt;code&gt;.claude/skills&lt;/code&gt;, and &lt;code&gt;.mcp.json&lt;/code&gt; for leaked credentials (&lt;code&gt;sk-ant-...&lt;/code&gt;, &lt;code&gt;sk-proj-...&lt;/code&gt;, AWS, GitHub PATs), prompt-injection overrides, and hidden Trojan Source Unicode characters.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Multi-Agent Rule Sync + Lossless Token Diet (&lt;code&gt;sync --compress&lt;/code&gt;)&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   npx @framy2/ctxwise &lt;span class="nb"&gt;sync&lt;/span&gt; &lt;span class="nt"&gt;--compress&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Synchronizes &lt;code&gt;CLAUDE.md&lt;/code&gt; &amp;lt;-&amp;gt; &lt;code&gt;AGENTS.md&lt;/code&gt; &amp;lt;-&amp;gt; &lt;code&gt;.cursor/rules/ctxwise.mdc&lt;/code&gt; and compresses comments, blank lines, and duplicate bullets (~18–30% token reduction) while keeping fenced code blocks intact.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;OpenAI Codex CLI 32 KiB Doctor (&lt;code&gt;codex-doctor&lt;/code&gt;)&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   npx @framy2/ctxwise codex-doctor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Audits your directory chain of &lt;code&gt;AGENTS.override.md&lt;/code&gt; and &lt;code&gt;AGENTS.md&lt;/code&gt; against Codex CLI's &lt;code&gt;32,768&lt;/code&gt;-byte limit (&lt;code&gt;project_doc_max_bytes&lt;/code&gt;) and validates &lt;code&gt;.codex/config.toml&lt;/code&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;1-Line GitHub Action (&lt;code&gt;FramY2/ctxwise@v1&lt;/code&gt;)&lt;/strong&gt;
Drop &lt;code&gt;uses: FramY2/ctxwise@v1&lt;/code&gt; into &lt;code&gt;.github/workflows/ci.yml&lt;/code&gt; to block secret leaks, prompt injections, and context bloat on every Pull Request with inline annotations and a Job Summary table.&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;strong&gt;Links:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/FramY2/ctxwise" rel="noopener noreferrer"&gt;https://github.com/FramY2/ctxwise&lt;/a&gt; &lt;em&gt;(Stars and &lt;code&gt;good first issue&lt;/code&gt; stack preset PRs are super welcome!)&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;npm Package:&lt;/strong&gt; &lt;a href="https://www.npmjs.com/package/@framy2/ctxwise" rel="noopener noreferrer"&gt;&lt;code&gt;@framy2/ctxwise&lt;/code&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>openai</category>
      <category>claude</category>
      <category>mcp</category>
      <category>opensource</category>
    </item>
    <item>
      <title>How to audit MCP tool schema token bloat and sync CLAUDE.md with AGENTS.md locally</title>
      <dc:creator>Christian Frascogna</dc:creator>
      <pubDate>Mon, 19 Oct 2026 16:16:40 +0000</pubDate>
      <link>https://dev.to/framy2/how-to-audit-mcp-tool-schema-token-bloat-and-sync-claudemd-with-agentsmd-locally-2c2n</link>
      <guid>https://dev.to/framy2/how-to-audit-mcp-tool-schema-token-bloat-and-sync-claudemd-with-agentsmd-locally-2c2n</guid>
      <description>&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%2Fjrxk4ej867fhsruyinog.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%2Fjrxk4ej867fhsruyinog.png" alt=" " width="800" height="336"&gt;&lt;/a&gt;If you connect 4–5 MCP servers to Claude Code or OpenAI Codex (GitHub, Playwright, Postgres, Notion), their &lt;code&gt;tools/list&lt;/code&gt; JSON schemas silently consume &lt;strong&gt;15,000–35,000 tokens on every turn&lt;/strong&gt; before you even type a prompt.&lt;/p&gt;

&lt;p&gt;On top of that, repositories using both &lt;strong&gt;Claude Code&lt;/strong&gt; (&lt;code&gt;CLAUDE.md&lt;/code&gt;) and &lt;strong&gt;OpenAI Codex&lt;/strong&gt; (&lt;code&gt;AGENTS.md&lt;/code&gt;) or &lt;strong&gt;Cursor&lt;/strong&gt; (&lt;code&gt;.cursor/rules&lt;/code&gt;) quickly suffer from rule drift or accidentally include exposed keys / covert prompt injections inside third-party skills.&lt;/p&gt;

&lt;p&gt;I just released &lt;strong&gt;CtxWise v1.0&lt;/strong&gt; (&lt;code&gt;@framy2/ctxwise&lt;/code&gt;, Apache-2.0, 100% local, zero API calls, zero telemetry) to inspect and fix all three in &lt;code&gt;&amp;lt;50ms&lt;/code&gt;:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
text
$ npx @framy2/ctxwise mcp-xray --probe-stdio
CtxWise mcp-xray · 4 MCP servers · 24 tool schemas · ~18,420 tokens/turn
  [BLOATED] ~2,840 tok · github/create_or_update_pull_request (19 params)
  [BLOATED] ~1,920 tok · playwright/browser_snapshot_dom (15 params)
  -&amp;gt; Tree-shaking savings: ~4,760 tokens saved on every single turn

$ npx @framy2/ctxwise agents &amp;amp;&amp;amp; npx @framy2/ctxwise sync --compress
CtxWise multi-agent · parity: synced · Claude ~410 tok · Codex ~410 tok
  Synced AGENTS.md &amp;lt;-&amp;gt; CLAUDE.md &amp;lt;-&amp;gt; .cursor/rules/ctxwise.mdc (-34% Token Diet)

$ npx @framy2/ctxwise shield --fail-on-risk
  [HIGH] .mcp.json:14 — Hardcoded Anthropic API Key (sk-ant-api03-REDACTED)
  [HIGH] .claude/skills/helper/SKILL.md:42 — Covert HTML comment prompt injection
![ ](https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/sz8s53ecr7mnxhhl2hz2.png)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>openai</category>
      <category>claude</category>
      <category>mcp</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
