πŸ”§ Stop Feeding Your AI the Whole Codebase β€” Give It the Map Instead

:high_voltage: 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.

:light_bulb: 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)

npx sigmap

Downloads, runs, generates context, exits. Nothing permanent on your machine. Requires Node.js 18+.

Option 2 β€” Install globally

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:

Platform Binary
macOS Apple Silicon sigmap-darwin-arm64
macOS Intel sigmap-darwin-x64
Linux x64 sigmap-linux-x64
Windows x64 sigmap-win32-x64.exe
# 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

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.

:high_voltage: 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:

sigmap --adapter copilot    # just Copilot
sigmap --adapter claude     # just Claude

Or configure all of them in gen-context.config.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

:light_bulb: 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:

{ "strategy": "per-module" }
πŸ”Œ MCP Server β€” 8 On-Demand Tools

For AI tools that support MCP (Claude Code, Cursor), SigMap exposes a local server:

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
# 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 | Open VSX

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

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 Signature extraction β†’ compact context file 95–99.75% Regex, zero deps Node.js 18+ only
Repomix Full repo β†’ single AI-friendly file ~70% (compressed) Tree-sitter AST npm + Tree-sitter native binary
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 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.

:light_bulb: 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. 197 commits, 21 releases, 340 tests passing. The project dogfoods itself β€” SigMap runs on SigMap (40 JS files, 8,600 lines).


:high_voltage: Quick Hits

Want Do
:test_tube: Try it in 30 seconds npx sigmap
:counterclockwise_arrows_button: Never think about it again sigmap --setup
:bullseye: Find the right file for a task sigmap --query "your task"
:bar_chart: Check context health sigmap --health
:electric_plug: MCP for Claude/Cursor sigmap --mcp
:building_construction: Monorepo support sigmap --monorepo
:globe_with_meridians: Docs manojmallick.github.io/sigmap
:star: Support the dev Star on GitHub

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

8 Likes