If you use Claude Code, OpenAI Codex CLI, or Cursor with 4–5 MCP servers connected (GitHub, Playwright, Postgres, Notion, Linear), there is a hidden tax running on every single turn: MCP JSON tool schemas.
Before you even type a prompt, every connected MCP server dumps its full tools/list JSON schema into your context window. A single server with 20+ tools can consume 15,000 to 35,000 tokens per turn, degrading model reasoning and burning through your rate limits.
At the same time, multi-agent teams now have to maintain CLAUDE.md, hierarchical AGENTS.md (which OpenAI Codex CLI silently truncates at 32 KiB), and .cursor/rules/*.mdc — while making sure nobody accidentally commits an API key or a prompt-injection payload inside .mcp.json or .claude/skills.
To solve this locally with zero API keys and zero telemetry, I built CtxWise v1.0 (@framy2/ctxwise on npm, Apache-2.0).
What CtxWise v1.0 does in one CLI:
-
Live MCP Schema X-Ray & Tree-Shaking (
mcp-xray)
npx @framy2/ctxwise mcp-xray --probe-stdio
Queries your local MCP servers over stdio (tools/list), calculates the exact token cost of every individual tool schema, flags [BLOATED] tools, and lets you prune unused tools (mcp-prune) to cut startup context by 50–80%.
-
Supply-Chain & Prompt-Injection Firewall (
shield)
npx @framy2/ctxwise shield --fail-on-risk
Scans CLAUDE.md, AGENTS.md, .claude/skills, and .mcp.json for leaked credentials (sk-ant-..., sk-proj-..., AWS, GitHub PATs), prompt-injection overrides, and hidden Trojan Source Unicode characters.
-
Multi-Agent Rule Sync + Lossless Token Diet (
sync --compress)
npx @framy2/ctxwise sync --compress
Synchronizes CLAUDE.md <-> AGENTS.md <-> .cursor/rules/ctxwise.mdc and compresses comments, blank lines, and duplicate bullets (~18–30% token reduction) while keeping fenced code blocks intact.
-
OpenAI Codex CLI 32 KiB Doctor (
codex-doctor)
npx @framy2/ctxwise codex-doctor
Audits your directory chain of AGENTS.override.md and AGENTS.md against Codex CLI's 32,768-byte limit (project_doc_max_bytes) and validates .codex/config.toml.
-
1-Line GitHub Action (
FramY2/ctxwise@v1) Dropuses: FramY2/ctxwise@v1into.github/workflows/ci.ymlto block secret leaks, prompt injections, and context bloat on every Pull Request with inline annotations and a Job Summary table.
Links:
-
GitHub Repository: https://github.com/FramY2/ctxwise (Stars and
good first issuestack preset PRs are super welcome!) -
npm Package:
@framy2/ctxwise
Top comments (1)
DEV-VERIFYtr.ee/dev-to