Single-call MCP pipeline reduces Claude Code token usage by 74%

A developer has shared their experience building a context engine (MCP server) that gives Claude Code a dependency graph of codebases, enabling it to read only relevant code instead of entire files. The tool reduces token usage significantly by serving dependency graphs and skeletons rather than raw files.
Original problem and initial solution
Claude Code typically reads entire files and dumps everything into context, consuming tokens rapidly. The initial approach involved serving only relevant code via MCP using dependency graphs and skeletons instead of raw files, which alone reduced token usage by 65%.
Identified inefficiency and solution
Users pointed out that the MCP workflow itself was wasteful, with agents making multiple round trips: calling get_context_capsule, reading the result, then calling get_impact_graph, reading that result, followed by search_memory, and reading that result. This created three round trips with overlapping results in context.
The run_pipeline fix
The developer shipped a single-call MCP tool called run_pipeline that replaces the multi-step workflow. The tool auto-detects intent (debug/modify/refactor/explore) and runs the appropriate combination of context search, impact analysis, and memory recall server-side.
run_pipeline({
task: "fix JWT validation bug",
preset: "auto",
max_tokens: 10000,
observation: "JWT uses Ed25519" // save insight in same call
})
This single call replaces 3-4 individual calls. Results are deduplicated and merged within a token budget before reaching the context window, resulting in approximately 60% fewer context tokens compared to calling tools individually. The observation parameter allows agents to save learned information in the same call without a separate save_observation step. Memory is linked to code graph nodes, so when code changes, observations are automatically flagged as stale.
Additional features shipped
- Passive observation pipeline: file watcher → blake3 hash diff → AST-level structural diffs → auto-correlation with tool calls → zero-config observations
- CLI that works without VS Code:
npm install -g vexp-cli - Git hooks that don't overwrite existing ones (marker-delimited blocks)
- Token savings display in VS Code sidebar showing actual numbers with a 24-hour rolling window
Availability
The tool is free to try with a generous free tier offering 2,000 nodes, basic pipeline functionality, and full session memory. No account or API key is required, and it makes zero network calls. The core architecture includes a Rust graph engine and tree-sitter parsers built by the developer, with Claude Code assisting on MCP protocol layer, SQLite schema migrations, and agent instruction templates.
📖 Read the full source: r/ClaudeAI
👀 See Also

AutoSkillUpdate: A Claude Code Plugin That Detects Outdated Skills
AutoSkillUpdate is an open-source Claude Code plugin that scans your codebase, compares it against existing skills, and identifies drift. It provides drift reports with file paths and line references, then offers to rewrite outdated skills with user confirmation.

Bifrost AI Gateway: Open-Source Tool Addresses AI Infrastructure Gaps
Bifrost is an open-source Go-based LLM gateway that provides automatic failover between providers, budget caps that reject requests, audit logging, and hooks for evaluation. Benchmarks show it's ~50x faster than LiteLLM at high throughput.
OtoDock: Self-Hosted Multi-Tenant Platform for Claude Code and Codex Agents
OtoDock is a self-hosted company OS that runs Claude Code or Codex agents in sandboxed departments with four collaboration modes, phone support, and local model support.

agentcache: Python Library for Multi-Agent LLM Prefix Caching
agentcache is a Python library that enables multi-agent LLM frameworks to share cached prompt prefixes, achieving up to 76% cache hit rates and cutting inference time by more than half in tests with GPT-4o-mini.