Zero npm install

Up and running
in under 2 minutes

One file. One command. Your AI coding agent gets full codebase context at every session start.

⏱ Average setup time: 90 seconds

Prerequisites

Before you start

One requirement. That's it.

🟢
Node.js 18 or later
Check with node --version. Install from nodejs.org if needed. No other tools, runtimes, or package managers required.
terminal
$ node --version
v22.11.0 ← v18+ required

Installation

Three steps

No package manager. No build step. Just copy one file into your project.

1
Step 1 of 3
Download gen-context.js
Copy the single-file entry point into the root of your project. No package.json changes needed.
your-project/
$ curl -O https://raw.githubusercontent.com/manojmallick/sigmap/main/gen-context.js
% Total % Received
100 48.2K 100 48.2K ← single file, ~50KB
2
Step 2 of 3
Generate your context file
Run it once. It scans your codebase, extracts signatures from all 21 supported languages, and writes .github/copilot-instructions.md.
your-project/
$ node gen-context.js
 
[sigmap] scanning 247 files across src/ app/ lib/
[sigmap] extracted 1,842 signatures from 89 files
[sigmap] secret scan: clean (0 findings)
[sigmap] budget: 6,000 tokens target, using 3,847
[sigmap] ✓ wrote .github/copilot-instructions.md
[sigmap] reduction: 82,400 → 3,847 tokens (95.3%)
3
Step 3 of 3
Enable always-on updates
The --setup flag installs a git post-commit hook and starts a file watcher. From now on, every save and every commit automatically regenerates the context file.
your-project/
$ node gen-context.js --setup
 
[sigmap] ✓ installed .git/hooks/post-commit
[sigmap] ✓ watcher started on src/ app/ lib/
[sigmap] watching for changes... (Ctrl+C to stop)

Verification

What you get

The token report and a structured context file your AI agent reads at every session start.

node gen-context.js --report
╔══════════════════════════════════╗
║ SigMap Token Report ║
╚══════════════════════════════════╝
 
Input 82,400 tokens (full source)
Output 3,847 tokens (signatures only)
Saved 78,553 tokens (95.3% reduction)
 
Files scanned 247
Files included 89 (dropped 158 under budget)
Languages TypeScript, Python, Go, CSS
Secrets found 0 (clean)
 
Output: .github/copilot-instructions.md
.github/copilot-instructions.md (excerpt)
# Code signatures
 
## src/api/users.ts
export interface User
export class UserService
async findById(id: string): Promise<User>
async create(data: CreateUserDto): Promise<User>
async delete(id: string): Promise<void>
 
## src/auth/jwt.ts
export function signToken(payload: JwtPayload): string
export function verifyToken(token: string): JwtPayload
 
...89 more files...

Configuration

Customise the output

Create gen-context.config.json in your project root. All fields optional.

gen-context.config.json
{
"output": ".github/copilot-instructions.md",
"outputs": ["copilot", "claude", "cursor"],
"srcDirs": ["src", "app", "lib"],
"maxTokens": 6000,
"secretScan": true,
"monorepo": false,
"diffPriority": true
}
outputs
string[] — default: ["copilot"]
Write to multiple target files in one run. Supports copilot, claude, cursor, windsurf.
srcDirs
string[] — default: ["src","app","lib","packages","services","api"]
Directories to scan. Relative to project root. Nested paths are scanned recursively up to maxDepth.
maxTokens
number — default: 6000
Token budget for the output file. Files are dropped in priority order when the budget is exceeded.
maxDepth
number — default: 6
Maximum directory depth to recurse into. Increase for deeply nested monorepos.
secretScan
boolean — default: true
Scan extracted signatures for API keys, tokens, passwords, and secrets before writing. Redacts matches automatically.
diffPriority
boolean — default: true
Files changed in recent git commits are prioritised within the token budget. Keeps the most relevant code front-and-center.
monorepo
boolean — default: false
When enabled, generates a separate context file per package in a monorepo, using the package name as the section header.
routing
boolean — default: false
Appends a model routing recommendation section: which AI model tier to use for each file based on its complexity score.
📄
.contextignore
Create a .contextignore file in your project root using the same gitignore syntax to exclude specific paths. This file is compatible with .repomixignore — you can symlink them to share one exclusion list.

All CLI flags

Command reference

Every flag the CLI accepts.

node gen-context.js --help
SigMap v1.5.0
 
Usage: node gen-context.js [flag]
 
(no flags) Generate context and exit
--watch Generate and watch for file changes
--setup Generate + install git hook + start watcher
--mcp Start MCP server on stdio
--report Print token reduction stats to stdout
--report --json Token report as JSON (for CI pipelines)
--diff Generate context for git-changed files only
--diff --staged Generate context for staged files only
--health Composite 0-100 health score (grade A-D)
--suggest-tool Recommend fast/balanced/powerful model tier
--track Log run metrics to .sigmap/runs.jsonl
--init Write gen-context.config.json.example
--version Print version string
--help Show this message

What's next

Explore further

v1.1
Context strategies
Full vs per-module vs hot-cold with case-by-case recommendations and token trade-offs.
21 languages
Language support
See what gets extracted for TypeScript, Python, Go, Rust, and 17 more languages.
Integration guide
Repomix + SigMap
Stack both tools for the two-layer caching strategy. SigMap for daily; Repomix for deep sessions.
v0.1 → v1.5
Full roadmap
All 16 versions shipped. 97% token reduction. 274 tests. MIT license.