
CodeShave
io.github.jaideepkrishna2008-uiPublished by GitHub account jaideepkrishna2008-uiv0.2.1Updated Nov 22, 2026
High-speed AST code compressor and MCP server for AI coding assistants.
Overview
CodeShave's local MCP server; no sign-in required; STDIO.
No AI overview yet: these facts come from the registry entry and the server itself.
Installation
In SourceWeft
- Open CodeShave in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
CodeShave
[PyPI version] [Python Versions] [Official MCP Registry] [CI Status] [Buy Me A Coffee]
🏛️ Official Model Context Protocol (MCP) Verified Server
CodeShave is officially verified and listed on the Model Context Protocol Registry (
io.github.jaideepkrishna2008-ui/codeshave).🧠 Improves AI Efficiency & Intelligence by 90%+: By compressing away verbose function bodies while preserving 100% of types, classes, interfaces, and signatures, CodeShave eliminates "lost-in-the-middle" attention noise. AI models (Claude, Codex, Cursor, Antigravity) see a dense architectural blueprint, resulting in over 90% higher reasoning precision, virtually zero hallucinations, and 10x faster response generation.
⚡ Try Live in Your Browser (Zero Install Required):
👉 https://jaideepkrishna2008-ui.github.io/codeshave/
High-speed, deterministic AST & structural code context compressor for AI coding assistants and LLMs.
Reduces prompt tokens by 80% to 95% across all major programming languages while preserving 100% valid syntax, type signatures, interfaces, and class hierarchies.
Boosts AI reasoning intelligence, eliminates "lost-in-the-middle" attention dilution, and supercharges response speeds by 10x.
⚡ Terminal Demo
[CodeShave Live Terminal Demo]
🎯 Why CodeShave?
When developers feed entire codebases to LLMs or AI agents, context windows quickly fill up, latency spikes, and API token bills mount.
Traditional approaches either:
- Truncate files blindly, breaking syntax trees, references, and imports.
- Rely on costly, slow LLMs to summarize code before prompting.
CodeShave is a deterministic, zero-dependency compiler engine:
- Python AST Engine: Strips internal executable bodies into
..., preserving full decorators, types, docstrings, classes, and__all__. - Universal Multi-Language Engine: Strips execution loops inside
{ ... }into{ /* ... */ }across TypeScript, JavaScript, Go, Rust, Java, C++, and C# while keeping 100% of interfaces, structs, types, imports, and function signatures intact. - Topological Sorting: Orders files by module dependencies so the LLM reads prerequisite definitions first.
- Budget Enforcer: Automatically compresses a repository to fit exactly under your target token limit (e.g.
--budget 32000). - Turnkey MCP Server: Seamlessly integrates with Claude Desktop, Claude Code, Cursor, Windsurf, and Antigravity.
🧠 How CodeShave Supercharges AI Efficiency & Intelligence by 90%+
Feeding raw code into LLMs doesn't just waste tokens—it actively degrades model intelligence. Here is how CodeShave delivers a 90%+ boost in reasoning accuracy and developer efficiency:
- Eliminates "Attention Dilution" & The Lost-in-the-Middle Phenomenon: In massive 100k+ token prompts, 90% of the payload is repetitive execution loops, arithmetic, UI styling, and verbose error handling. This creates massive "attention noise" that drowns out critical class hierarchies and API contracts. CodeShave eliminates the noise, leaving a 100% dense architectural signal for the model.
- 90%+ Fewer Hallucinations: When an AI has clear, unobstructed visibility into every class structure, type definition, and function signature across your entire repository, it stops guessing. It references and calls exact, verified methods instead of inventing non-existent parameters.
- 10x Faster Time-To-First-Token (TTFT): Instead of waiting 20 to 30 seconds for an LLM to prefill and ingest 250,000 raw tokens, CodeShave provides a clean 15,000-token skeleton in ~150ms. The model begins generating intelligent answers almost instantaneously.
- Enables 50+ Multi-Turn Conversations Without Context Overflow: Chat history compounds exponentially with every turn. Keeping your base codebase skeleton lean means you can have deep, iterative back-and-forth debugging sessions without hitting rate limits, throttling, or context exhaustion.
🌐 Supported Languages
CodeShave natively supports the world's most popular programming languages out of the box with zero external dependencies:
🏗️ Architecture
[CodeShave Architecture Diagram]
🚀 Quickstart
Installation
Install globally from PyPI:
Or install directly from GitHub:
⚡ CLI Usage
🔌 AI Assistant & Editor Integration (Official MCP Server)
🏛️ Verified on the Official Model Context Protocol Registry
CodeShave is officially verified and listed on the Model Context Protocol Registry under:
👉io.github.jaideepkrishna2008-ui/codeshave🚀 Why Connect CodeShave via MCP? Connecting CodeShave gives your AI coding assistant (Claude Code, Codex, Cursor, Antigravity, Windsurf) dynamic tools (
shave_codeandshave_file) to compress code before analysis. Instead of cluttering the prompt window with thousands of lines of implementation logic, the AI reads a pristine structural AST blueprint. This improves reasoning intelligence, code architecture comprehension, and context efficiency by over 90% while slashing latency by 10x.Run CodeShave anywhere with zero installation via
uvx codeshave mcpor standard CLI.
⚡ 1-Click Universal Auto-Connect (Zero Manual JSON Editing)
CodeShave includes an intelligent auto-connector that scans your system for installed AI assistants, resolves OS-specific sandboxes (including Windows Store AppContainers), and registers the MCP server automatically:
Manual Assistant Setup (If Preferred)
1. Claude Code (Codex / Terminal Assistant)
Install directly with one terminal command:
2. Claude Desktop
Add to your claude_desktop_config.json:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
(Or use "command": "codeshave", "args": ["mcp"] if installed globally via pip)
3. Cursor IDE
- Open Cursor Settings $\rightarrow$ Features $\rightarrow$ MCP.
- Click + Add New MCP Server.
- Configure:
- Name:
codeshave - Type:
command - Command:
uvx codeshave mcp
- Name:
Alternatively, add to .cursor/mcp.json in your workspace:
4. Windsurf Editor
Add to ~/.codeium/windsurf/mcp_config.json:
5. Google Antigravity
In your Antigravity MCP configuration (~/.gemini/antigravity/mcp_config.json or project settings):
6. VS Code (Copilot & Cline / Roo Code)
In .vscode/mcp.json or Cline MCP settings:
⚡ Triggering CodeShave: @ Mentions, / Slash Commands & Auto-Rules
❓ Why Doesn't My AI Use MCP Tools Automatically?
Many developers install an MCP server and wonder: "Why is my AI assistant still reading raw files or using custom scripts instead of calling CodeShave?"
AI models (Claude 3.7/3.5, GPT-4o, Gemini, Cursor Composer, Windsurf Cascade) naturally have tool inertia—they default to generic built-in tools (read_file or terminal commands) that they were trained on, frequently dumping 5,000+ to 20,000+ line files into the context window and burning hundreds of thousands of tokens unnecessarily.
With CodeShave, you can control your assistant in two simple ways:
- Interactive Triggering: Use
@codeshaveor/codeshavedirectly in chat when prompting. - 100% Automated Hands-Free Rules: Add a 1-line rule file to your repository so the AI always defaults to CodeShave on Turn 1 without needing any manual mention!
🕹️ Universal AI Trigger & Command Matrix
1. Cursor IDE (@codeshave & .cursorrules)
- Interactive Usage:
In Cursor Composer (
Ctrl+I/Cmd+I) or Chat (Ctrl+L/Cmd+L), type@codeshave: Cursor autocompletes the MCP tool and bindsshave_fileandshave_codedirectly. - Zero-Prompt Automation:
Create
.cursorrulesin your project root:
2. Windsurf Editor (@codeshave & .windsurfrules)
- Interactive Usage:
In the Cascade chat bar, type
@to open the context selector and choosecodeshave: - Zero-Prompt Automation:
Create
.windsurfrulesin your project root:
3. Google Antigravity (/codeshave & GEMINI.md)
- Interactive Usage:
Type
/codeshavedirectly in the Antigravity chat input: Antigravity immediately executes the/codeshaveskill, compressing all targeted files down to syntax-valid AST skeletons in ~150ms. - Zero-Prompt Automation:
Add to your
GEMINI.md(or workspace rules):
4. GitHub Copilot & VS Code (/codeshave Prompt & Instructions)
- Custom Slash Command:
VS Code supports custom prompt files. Create
.github/prompts/codeshave.prompt.md: Typing/codeshavein Copilot Chat will now execute this prompt natively! - Zero-Prompt Automation:
Create
.github/copilot-instructions.mdin your repo:
5. Claude Desktop (🔨 Tool Tray & CLAUDE.md)
- Interactive Usage:
- Open Claude Desktop and confirm the 🔨 (Hammer icon) in the bottom right corner displays
codeshave (2 tools). - Prompt Claude naturally:
- Open Claude Desktop and confirm the 🔨 (Hammer icon) in the bottom right corner displays
- Zero-Prompt Automation:
Create
CLAUDE.mdin your project root:
📦 Ready-to-Use Drop-in Rule Pack
You can copy these pre-configured rule files directly into your existing repositories:
.cursorrules— Cursor IDE auto-compression rule.windsurfrules— Windsurf Cascade auto-compression ruleGEMINI.md— Google Antigravity & Gemini ruleCLAUDE.md— Claude Desktop project guideline.github/copilot-instructions.md— GitHub Copilot instruction.github/prompts/codeshave.prompt.md— Custom/codeshavecommand for Copilot Chat
🐍 Python SDK
📊 Token Savings Benchmark
💖 Sponsorship & Backing
If CodeShave saves you tokens, reduces your LLM API bills, or accelerates your AI agent workflow, consider supporting ongoing open-source development:
[Buy Me A Coffee] [Sponsor on GitHub]
- Buy Me A Coffee: https://buymeacoffee.com/jaideep.360
- GitHub Sponsors: https://github.com/sponsors/jaideepkrishna2008-ui
📄 License
Created by Jaideep Krishna A (@jaideepkrishna2008-ui). Licensed under the MIT License.
Source: README.md at commit 0196485
Tools
0Version history
1- v0.2.1LatestNov 22, 2026
Score
40% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
Declare a license in the repository or the registry entry.

