Open-source MCP server and PreToolUse hook for Claude Code. Exposes 15 MCP tools that let Claude inspect its own context-hygiene stats mid-session (token waste, duplicate reads, drift, cost forecasts), and caps verbose tool output plus dedups same-session file re-reads to keep context clean. Zero network calls in normal use; all local.
Overview
Sipcode
Open-source (MIT) MCP server and PreToolUse hook for Claude Code. It keeps the AI's context clean so it stays reliable over long sessions, and exposes that hygiene to Claude as MCP tools.
What it does
- Caps verbose tool output (grep, npm install, git log, tsc) before it reaches the model
- Deduplicates same-session re-reads of unchanged files (content-hash based, never serves stale bytes)
- Ships 15 MCP tools so Claude can inspect its own context stats mid-session: token waste, duplicate reads, drift, cost forecasts, and more
Why it matters
The token savings (~62% median on a reproducible benchmark) are the proof, not the point. The goal is a cleaner context window. Anthropic's own research reports a 29% quality lift and around 40% fewer agent errors when context stays clean.
Install
npm i -g sipcode && sipcode init
Server Config
{
"mcpServers": {
"sipcode": {
"command": "npx",
"args": [
"-y",
"-p",
"sipcode",
"sipcode-mcp"
]
}
}
}