# 🔧 Stop Feeding Your AI the Whole Codebase — Give It the Map Instead

**URL:** <https://onehack.st/t/stop-feeding-your-ai-the-whole-codebase-give-it-the-map-instead/321101>\
**Category:** Tools & Scripts\
**Tags:** programming, tips-tricks\
**Created:** [April 13, 2026, 2:04pm UTC](https://onehack.st/t/stop-feeding-your-ai-the-whole-codebase-give-it-the-map-instead/321101 "2026-04-13T14:04:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![manoj\_mallick1](https://onehack.st/user_avatar/onehack.st/manoj_mallick1/32/159058_2.png) [@manoj\_mallick1](https://onehack.st/u/manoj_mallick1)\
**Post date:** [April 13, 2026, 2:04pm UTC](https://onehack.st/t/stop-feeding-your-ai-the-whole-codebase-give-it-the-map-instead/321101/1 "2026-04-13T14:04:00Z")

</div>

# ⚡ SigMap — Your AI Coding Assistant Just Got a 97% Context Upgrade

_One command. Zero config. Every AI assistant starts every session already knowing your entire codebase._

**80,000 tokens per session. That’s what your AI wastes reading your codebase every time you open a chat.**

SigMap extracts only function and class signatures — no bodies, no imports, no comments — and writes a compact file that Copilot, Claude, Cursor, and Windsurf read automatically. Your codebase goes from ~80K tokens to ~4K. The AI stops guessing which file matters. It already knows.

* * *

> **🔍 What SigMap Actually Does — The 30-Second Version**
>
> Your AI coding assistant has a context window. Everything it reads eats into that window. On a real project, raw source files consume ~80,000 tokens. That’s most of the window — gone before you even ask a question.
> 
> SigMap scans your source files across 21 languages and pulls out only the **function signatures, class definitions, interfaces, and type declarations**. No function bodies. No comments. No imports. Just the skeleton your AI needs to understand the architecture.
> 
> The result: a single context file your AI reads automatically on every session.
> 
> | Stage | Tokens | Reduction |
> | --- | --- | --- |
> | **Raw source files** | ~80,000 | — |
> | **Repomix compressed** | ~8,000 | 90% |
> | **SigMap signatures** | ~4,000 | 95% |
> | **SigMap + MCP (hot-cold)** | ~200 | 99.75% |
> 
> **What this means in practice:**
> 
> | Before SigMap | After SigMap |
> | --- | --- |
> | AI finds the right file 13.7% of the time | AI finds the right file 87.5% of the time |
> | ~2.84 prompts to get an answer | ~1.54 prompts to get an answer |
> | 87% wrong-context rate | 13% wrong-context rate |
> 
> Those numbers come from 80 real coding tasks across 16 repos and 13 languages. No LLM API involved in the benchmark — pure retrieval quality.
> 
> > 💡 **The core insight:** Your AI doesn’t need to read every line of code. It needs to know what functions exist, where they live, and how they relate. Signatures are the map. SigMap draws that map.

> **🛠️ Install & Run — Three Ways, Pick One**
>
> **Option 1 — Try it right now (zero install)**
> 
> ```auto
> npx sigmap
> 
> ```
> 
> Downloads, runs, generates context, exits. Nothing permanent on your machine. Requires Node.js 18+.
> 
> **Option 2 — Install globally**
> 
> ```auto
> npm install -g sigmap
> sigmap
> 
> ```
> 
> Now available from any project directory.
> 
> **Option 3 — No Node.js at all (standalone binary)**
> 
> Download the binary for your platform from [GitHub Releases](https://github.com/manojmallick/sigmap/releases/latest):
> 
> | Platform | Binary |
> | --- | --- |
> | **macOS Apple Silicon** | `sigmap-darwin-arm64` |
> | **macOS Intel** | `sigmap-darwin-x64` |
> | **Linux x64** | `sigmap-linux-x64` |
> | **Windows x64** | `sigmap-win32-x64.exe` |
> 
> ```bash
> # macOS / Linux
> chmod +x ./sigmap-darwin-arm64
> ./sigmap-darwin-arm64
> 
> ```
> 
> No npm. No Node. Just a binary that runs.
> 
> **Option 4 — Single file, any machine**
> 
> ```bash
> curl -O https://raw.githubusercontent.com/manojmallick/sigmap/main/gen-context.js
> node gen-context.js
> 
> ```
> 
> Drop one JS file into any project. Perfect for CI pipelines or locked-down environments.
> 
> ⚡ **Pro tip:** Run `sigmap --setup` to generate context + install a git post-commit hook + start a file watcher. From that point on, context regenerates automatically on every save and every commit. Set it and forget it.

> **🎯 Which AI Tools It Works With — All of Them**
>
> SigMap writes context files that each major AI coding assistant reads natively — no manual copy-paste, no configuration.
> 
> | AI Tool | Output File | How It Works |
> | --- | --- | --- |
> | **GitHub Copilot** | `.github/copilot-instructions.md` | Auto-read on every session |
> | **Claude / Claude Code** | `CLAUDE.md` | Appended below marker |
> | **Cursor** | `.cursorrules` | Auto-read |
> | **Windsurf** | `.windsurfrules` | Auto-read |
> | **OpenAI Codex** | `.github/openai-context.md` | Auto-read |
> | **Google Gemini** | `.github/gemini-context.md` | Auto-read |
> 
> Generate for multiple adapters at once:
> 
> ```bash
> sigmap --adapter copilot # just Copilot
> sigmap --adapter claude # just Claude
> 
> ```
> 
> Or configure all of them in `gen-context.config.json`:
> 
> ```json
> { "outputs": ["copilot", "claude", "cursor"] }
> 
> ```
> 
> One run. Every AI tool gets its context file in the right format, in the right place.

> **🌐 21 Languages — No Tree-sitter, No External Parser**
>
> Every extractor is pure regex + Node.js built-ins. Zero external dependencies means zero build steps, zero parser conflicts.
> 
> | Language | Extensions | What It Extracts |
> | --- | --- | --- |
> | **TypeScript** | `.ts` `.tsx` | interfaces, classes, functions, types, enums |
> | **JavaScript** | `.js` `.jsx` `.mjs` `.cjs` | classes, functions, exports |
> | **Python** | `.py` `.pyw` | classes, methods, functions |
> | **Go** | `.go` | structs, interfaces, functions |
> | **Rust** | `.rs` | structs, impls, traits, functions |
> | **Java** | `.java` | classes, interfaces, methods |
> | **Kotlin** | `.kt` `.kts` | classes, data classes, functions |
> | **C/C++** | `.cpp` `.c` `.h` `.hpp` | classes, functions, templates |
> | **C#** | `.cs` | classes, interfaces, methods |
> | **Ruby** | `.rb` `.rake` | classes, modules, methods |
> | **PHP** | `.php` | classes, interfaces, functions |
> | **Swift** | `.swift` | classes, structs, protocols, functions |
> | **Dart** | `.dart` | classes, mixins, functions |
> | **Scala** | `.scala` `.sc` | objects, classes, traits, functions |
> | **Vue** | `.vue` | `<script>` functions/components |
> | **Svelte** | `.svelte` | `<script>` functions/exports |
> | **HTML** | `.html` `.htm` | custom elements, script functions |
> | **CSS/SCSS** | `.css` `.scss` `.sass` `.less` | custom properties, keyframes |
> | **YAML** | `.yml` `.yaml` | top-level keys, pipeline jobs |
> | **Shell** | `.sh` `.bash` `.zsh` `.fish` | function declarations |
> | **Dockerfile** | `Dockerfile` | stages, key instructions |
> 
> > 💡 **Why no Tree-sitter?** Tree-sitter is powerful but adds a native binary dependency. SigMap’s regex extractors handle 95% of real-world patterns with zero install friction. For signature extraction (not full AST parsing), regex is the right tool.

> **🗂️ Context Strategies — Pick Your Token Budget**
>
> Not every project needs the same approach. SigMap ships three strategies:
> 
> | Strategy | Always-Injected Tokens | Context Lost? | Needs MCP? | Best For |
> | --- | --- | --- | --- | --- |
> | **`full`** | ~4,000 | No | No | Starting out, cross-module work |
> | **`per-module`** | ~100–300 | No | No | Large codebases, module-focused sessions |
> | **`hot-cold`** | ~200–800 | Cold files only | Yes | Claude Code / Cursor with MCP enabled |
> 
> **`full` (default):** One file, all signatures, always injected. Works everywhere. Start here.
> 
> **`per-module`:** Generates one context file per top-level source directory. Your AI loads only the module you’re working on. 70% fewer injected tokens, zero context loss.
> 
> **`hot-cold`:** Recently committed files are “hot” (auto-injected). Everything else is “cold” (pulled on-demand via MCP). Maximum reduction — ~200 tokens always-on.
> 
> Set it in `gen-context.config.json`:
> 
> ```json
> { "strategy": "per-module" }
> 
> ```

> **🔌 MCP Server — 8 On-Demand Tools**
>
> For AI tools that support MCP (Claude Code, Cursor), SigMap exposes a local server:
> 
> ```bash
> sigmap --mcp
> 
> ```
> 
> | Tool | What It Does |
> | --- | --- |
> | `read_context` | Signatures for one module or entire codebase |
> | `search_signatures` | Find matching signatures with file paths |
> | `get_map` | Import graph, class hierarchy, or route table |
> | `explain_file` | Signatures + imports + reverse callers for one file |
> | `list_modules` | Token-count table of all top-level directories |
> | `create_checkpoint` | Write a session checkpoint to `.context/` |
> | `get_routing` | Full model routing table |
> | `query_context` | Files ranked by relevance to any query |
> 
> The server reads files on every call — no stale state, no restart needed.

> **🔒 Built-In Security — Secrets Never Leak**
>
> SigMap automatically scans every extracted signature against 10 secret patterns:
> 
> | Pattern | Example |
> | --- | --- |
> | AWS Access Key | `AKIA...` |
> | GitHub Token | `ghp_...` / `gho_...` |
> | JWT | `eyJ...` |
> | DB Connection String | `postgres://user:pass@...` |
> | SSH Private Key | `-----BEGIN ... PRIVATE KEY-----` |
> | Stripe Key | `sk_live_...` / `sk_test_...` |
> | Generic secret | `password = "..."`, `api_key: "..."` |
> 
> If a match is found, the signature is replaced with `[REDACTED — {pattern} detected in {file}]`. The run continues — no silent failures. No secrets in your context file, ever.

> **⚙️ Power User Commands — Beyond the Basics**
>
> ```bash
> # Always-on context (git hook + watcher)
> sigmap --setup
> 
> # Context for changed files only (PR mode)
> sigmap --diff
> sigmap --diff --staged # staged files only
> 
> # Query-aware retrieval
> sigmap --query "authentication middleware"
> sigmap --query "auth" --top 5 --json
> 
> # Diagnostics
> sigmap --analyze # per-file: sigs, tokens, coverage
> sigmap --analyze --slow # include extraction timing
> sigmap --diagnose-extractors # self-test all 21 extractors
> sigmap --health # health score (0-100, grade A-D)
> 
> # Benchmarks
> sigmap --benchmark # hit@5 and MRR retrieval quality
> 
> # Monorepo support
> sigmap --monorepo # per-package context
> 
> # Model routing
> sigmap --suggest-tool "security audit"
> # → tier: powerful, models: claude-opus-4-6, gpt-5-4
> 
> # Prompt caching (60% API cost reduction)
> sigmap --format cache
> 
> ```

> **🔧 IDE Extensions — VS Code & JetBrains**
>
> **VS Code Extension** — [Marketplace](https://marketplace.visualstudio.com/items?itemName=manojmallick.sigmap) | [Open VSX](https://open-vsx.org/extension/manojmallick/sigmap)
> 
> | Feature | Detail |
> | --- | --- |
> | **Status bar** | Health grade (A/B/C/D) + time since last regen |
> | **Stale alert** | Warns when context is \>24h old, one-click regen |
> | **Regenerate** | `SigMap: Regenerate Context` command |
> | **Open context** | `SigMap: Open Context File` command |
> 
> **JetBrains Plugin** — [JetBrains Marketplace](https://plugins.jetbrains.com/plugin/31109-sigmap--ai-context-engine/)
> 
> Works with IntelliJ IDEA 2024.1+, WebStorm, PyCharm, GoLand, RubyMine, PhpStorm. Status bar widget + keyboard shortcut (Ctrl+Alt+G) for instant regen.

> **📊 SigMap vs The Landscape — Where It Fits**
>
> The AI coding context space has several tiers. SigMap sits in a specific lane — and it’s good to know the full picture.
> 
> | Tool | What It Does | Token Reduction | Approach | Dependencies |
> | --- | --- | --- | --- | --- |
> | **[SigMap](https://github.com/manojmallick/sigmap)** | Signature extraction → compact context file | 95–99.75% | Regex, zero deps | Node.js 18+ only |
> | **[Repomix](https://github.com/yamadashy/repomix)** | Full repo → single AI-friendly file | ~70% (compressed) | Tree-sitter AST | npm + Tree-sitter native binary |
> | **[code2prompt](https://github.com/mufeedvh/code2prompt)** | Repo → structured prompt | Moderate | File packing | Rust binary |
> | **Aider repo-map** | Dynamic context per chat | Varies | Tree-sitter tag map | Built into Aider |
> | **[GitNexus](https://github.com/pchaganti/gx-knowledge-graph)** | Knowledge graph + MCP | N/A (query-based) | Full graph engine | Complex setup |
> 
> **When to use what:**
> 
> - **SigMap alone** → Daily always-on context. Every session, every commit. The map is always fresh.
> - **Repomix alone** → On-demand deep dives. Full file content when you need the AI to read implementation details.
> - **SigMap + Repomix** → Best of both. SigMap for the daily index, Repomix when you need a deep session. They pair, not compete.
> - **Knowledge graphs (GitNexus, CodeGraphContext)** → Large codebases (10K+ files) where you need blast radius analysis and dependency chains that flat context can’t provide.
> 
> > 💡 **The real takeaway:** SigMap is the lightest layer — always on, always current, near-zero cost. Stack heavier tools on top when needed.

> **📐 Design Principles — Why It's Built This Way**
>
> | Principle | What It Means |
> | --- | --- |
> | **Zero npm dependencies** | `node gen-context.js` on a blank machine with Node 18+. Nothing else. |
> | **Never throws** | All extractors return `[]` on error. The run always completes. |
> | **Deterministic** | No AI in extraction. Pure regex + Node built-ins. Same input = same output. |
> | **No telemetry** | Never phones home. All state is files in your repo. |
> | **Local-first** | No cloud, no database, no accounts. |
> | **MIT license** | Use it however you want. |
> 
> Made in Amsterdam by [Manoj Mallick](https://github.com/manojmallick). 197 commits, 21 releases, 340 tests passing. The project dogfoods itself — SigMap runs on SigMap (40 JS files, 8,600 lines).

* * *

**⚡ Quick Hits**

| Want | Do |
| --- | --- |
| 🧪 Try it in 30 seconds | `npx sigmap` |
| 🔄 Never think about it again | `sigmap --setup` |
| 🎯 Find the right file for a task | `sigmap --query "your task"` |
| 📊 Check context health | `sigmap --health` |
| 🔌 MCP for Claude/Cursor | `sigmap --mcp` |
| 🏗 Monorepo support | `sigmap --monorepo` |
| 🌐 Docs | [manojmallick.github.io/sigmap](https://manojmallick.github.io/sigmap) |
| ⭐ Support the dev | [Star on GitHub](https://github.com/manojmallick/sigmap) |

* * *

_80,000 tokens was the problem. 4,000 is the answer. Your AI just stopped guessing._
