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

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 installThe 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
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
--spion 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
👀 See Also

Claude-Code v2.1.111 adds Opus 4.7 xhigh effort, /ultrareview, and PowerShell tool
Claude-Code v2.1.111 introduces the Opus 4.7 xhigh effort level between high and max, adds the /ultrareview command for cloud-based multi-agent code reviews, and begins rolling out PowerShell tool support on Windows. The update also includes interactive /effort controls, auto theme matching, and numerous bug fixes.

AskFirst API adds human approval layer for AI agents
AskFirst is a REST API that lets AI agents pause for human approval before taking irreversible actions. It works with local models, hosted APIs, and any framework, providing email notifications, approve/deny options, and audit logs.

ByteRover Memory Plugin for OpenClaw: Native Integration with Semantic Hierarchy
ByteRover Memory Plugin for OpenClaw provides native, structured long-term memory via a three-layer architecture and semantic hierarchy stored in Markdown files. It achieves 92.2% retrieval accuracy and requires OpenClaw v2026.3.22+.

NEXUS: An Open Source Agent Coordination Layer for OpenClaw
NEXUS is a coordination layer built on OpenClaw that enables AI agents to discover each other, delegate tasks, and handle micro-payments. It includes an agent registry, capability-based discovery, trust scores, and uses Google's A2A protocol and Anthropic's MCP.