Madar: Local Context Compiler for Claude Code / Cursor — 78% Fewer Tokens on NestJS Repo

✍️ OpenClawRadar📅 Published: June 17, 2026🔗 Source
Madar: Local Context Compiler for Claude Code / Cursor — 78% Fewer Tokens on NestJS Repo
Ad

Madar is an open-source local context compiler for coding agents like Claude Code, Cursor, Copilot, and Gemini. It maps your TypeScript/Node.js repo once (locally, with no ML dependencies) and serves a minimal context pack via MCP for each query, avoiding the agent's default per-session rediscovery of the codebase.

How It Works

Install globally and generate a graph scoped to your backend service using --spi (single package isolation):

npm i -g @lubab/madar
madar generate . --spi
madar claude install   # or: madar cursor install / madar copilot install

The tool is deterministic — pure static analysis of imports and call paths, no embeddings, no model calls.

Benchmark on NestJS + BullMQ (~800 files)

The same question ("how is the idea report generated") was asked to Claude Code with and without Madar. Numbers from Anthropic's reporting:

  • Input tokens: 1,000,776 (plain) → 223,539 (with Madar) — 78% reduction
  • Cost: $1.84 → $0.69 — 63% savings
  • Turns: 16 → 5
  • Tool calls: 15 → 4
Ad

Where It Backfires

The author is transparent about limitations:

  • Only tested on one repo, one agent, one question type ("how does X work"). Not a general claim.
  • Scoping is critical: using --spi on a single service worked; pointing it at a whole monorepo produced context packs that could increase token usage.
  • Edit/review tasks are not yet validated — the win is for explain-type queries.
  • Only works for TypeScript/Node.js codebases currently.

Who It's For

Developers working on large NestJS, Express, or Node.js repos who rely on AI coding agents and want to cut token waste on repetitive context-gathering. Not suitable for monorepos without careful scoping.

📖 Read the full source: r/ClaudeAI

Ad

👀 See Also

NerfGuard: A Classifier That Routes Coding Requests to Cheaper Models, Cutting Spend 3x
Tools

NerfGuard: A Classifier That Routes Coding Requests to Cheaper Models, Cutting Spend 3x

NerfGuard uses a fast classifier to route coding agent requests to the least expensive model and reasoning depth needed, yielding 3x usage for the same spend. Includes token optimizations.

OpenClawRadar
JANG Quantization Method Improves MLX Performance for Large Models
Tools

JANG Quantization Method Improves MLX Performance for Large Models

A new quantization method called JANG enables running large models like MiniMax-M2.5 and Qwen 3.5 on Apple's MLX framework with significantly better performance than standard MLX quantization, achieving near-native speeds while maintaining accuracy comparable to higher-bit quantizations.

OpenClawRadar
Comparison of Four Managed OpenClaw Hosting Providers for 2026
Tools

Comparison of Four Managed OpenClaw Hosting Providers for 2026

A developer tested four managed OpenClaw hosting providers over two months, ranking them based on setup time, uptime, integration reliability, model routing, cost, and multi-step task handling. LobsterTank costs $2/month with basic container hosting, KiwiClaw is $39/month with better support, xCloud is $24/month with solid uptime, and RunLobster is $49/month with extensive tool integration and flat pricing.

OpenClawRadar
ClawControl v1.3.1 adds media support, voice dictation, and Linux packaging
Tools

ClawControl v1.3.1 adds media support, voice dictation, and Linux packaging

ClawControl v1.3.1 is a cross-platform OpenClaw client that now supports image sharing, wake-word voice dictation, usage charts, and Linux AppImage/.deb packages. The release includes security updates requiring OpenClaw 2.19+ users to update Control UI Allowed Origins.

OpenClawRadar