gen-context.config.json

Configuration

All 21 keys. Run sigmap --init to create a starter config with all options annotated.


Full example

Complete config with defaults

Every available key shown with its default value. All fields are optional — omit any key to keep its default.

gen-context.config.json
{
// Output
"outputs": ["copilot"],
"format": "default",
 
// Source scanning
"srcDirs": ["src", "app", "lib", "packages", "services", "api"],
"exclude": ["node_modules", ".git", "dist", "build", "__pycache__"],
"maxDepth": 6,
"maxSigsPerFile": 25,
"maxTokens": 6000,
"diffPriority": true,
 
// Strategy
"strategy": "full",
"hotCommits": 10,
 
// Features
"secretScan": true,
"routing": false,
"monorepo": false,
 
// Watch
"watchDebounce": 300,
"tracking": false,
 
// v2 Enrichment
"enrichSignatures": true,
"depMap": true,
"todos": true,
"changes": true,
"changesCommits": 5,
"testCoverage": false,
"testDirs": ["test", "tests", "__tests__", "spec"],
"impactRadius": false
}
Generate a starter config automatically
Run node gen-context.js --init to write a gen-context.config.json pre-filled with all defaults and inline comments. The command will not overwrite an existing file.

Config reference

All 21 keys

Grouped by function. Every key is optional — SigMap uses the default when the key is absent.

Output
outputs
string[] — default: ["copilot"]
Write to multiple target files in one run. Each value maps to a specific file path: copilot.github/copilot-instructions.md, claudeCLAUDE.md, cursor.cursorrules, windsurf.windsurfrules.
values: "copilot" | "claude" | "cursor" | "windsurf"
format
"default" | "cache" — default: "default"
Controls output format. "cache" writes an additional Anthropic prompt-cache JSON file alongside the standard markdown. Feed the JSON directly to the Anthropic API to reduce repeated context costs by up to 90%.
CLI equivalent: --format cache
Source scanning
srcDirs
string[] — default: ["src","app","lib","packages","services","api",...]
Directories scanned relative to the project root. Scanned recursively up to maxDepth. Full default list includes: components, pages, routes, controllers, models, utils, helpers, middleware, config, types, interfaces, schemas, stores, hooks.
exclude
string[] — default: ["node_modules",".git","dist","build","__pycache__","coverage",".next",".nuxt","vendor"]
Paths excluded from scanning. Matched against relative paths using glob patterns. Also respects .contextignore in the project root.
maxDepth
number — default: 6
Maximum directory recursion depth. Directories deeper than this limit are skipped entirely. Increase for deeply nested monorepos; decrease for faster scans on flat projects.
maxSigsPerFile
number — default: 25
Cap on the number of signatures extracted from any single file. Prevents one large file with hundreds of exports from consuming the entire token budget, keeping the output representative across the whole codebase.
maxTokens
number — default: 6000
Hard token budget for the output file. When the budget is exceeded, files are dropped in reverse priority order (least recently changed first) until the output fits. The --report --json flag exits 1 when over budget.
diffPriority
boolean — default: true
Files touched in recent git commits are prioritised within the token budget. When the budget is tight, recently changed files stay in and older untouched files are dropped first. Keeps the most relevant code front-and-centre for your AI agent.
Strategy
strategy
"full" | "per-module" | "hot-cold" — default: "full"
Controls how signatures are organised in the output. full flattens everything into one file. per-module groups by top-level directory. hot-cold separates frequently-changed files from stable ones. See the Strategies page for trade-offs.
see: strategies.html
hotCommits
number — default: 10
Number of recent git commits used to determine which files are "hot" in the hot-cold strategy. Files touched in any of the last N commits are placed in the hot section. Only relevant when strategy is "hot-cold".
Features
secretScan
boolean — default: true
Scans all extracted signatures for API keys, tokens, passwords, and other secrets before writing the output. Matches are automatically redacted with a placeholder. Recommended to keep enabled at all times, especially when committing the output file.
routing
boolean — default: false
Appends an HTTP route extraction section to the output. Supports Express, Fastify, Flask, FastAPI, Spring Boot, Rails, and other common frameworks. Gives your AI agent a full API surface map without needing to read controller files.
CLI equivalent: --routing
monorepo
boolean — default: false
Generates a separate context file per package instead of a single project-wide file. Packages are detected by package.json, pyproject.toml, or go.mod. Each file is scoped to its own package tree.
CLI equivalent: --monorepo
Watch
watchDebounce
number — default: 300
Milliseconds to debounce file-change events when running in --watch mode. Increase if rapid successive saves cause unnecessary regenerations (e.g. editors that save multiple intermediate states). Decrease for faster response on slow machines.
tracking
boolean — default: false
Appends a JSON record to .context/usage.ndjson on every run. Each record includes timestamp, token counts, file counts, and reduction percentage. Enables historical trend analysis via --report --history.
CLI equivalent: --track
v2 Enrichment
enrichSignatures
boolean — default: true
New in v2.0. Adds return type hints and parameter type annotations to extracted signatures where the language supports inference. Gives your AI agent richer type context without increasing file count.
v2.0+
depMap
boolean — default: true
New in v2.0. Includes a dependency import section at the top of the output showing which external packages and internal modules each file imports. Helps the AI agent understand project structure at a glance.
v2.0+
todos
boolean — default: true
New in v2.0. Extracts TODO, FIXME, HACK, and XXX comments from source files and appends them as a section in the output (max 20 items). Gives the AI agent immediate visibility into known debt and pending work.
v2.0+ — max 20 items
changes
boolean — default: true
New in v2.0. Includes a recent git commit summary section at the top of the output. Gives the AI agent instant context on what has changed recently without needing to read git log separately.
v2.0+
changesCommits
number — default: 5
Number of recent commits to include in the changes section. Only relevant when changes is true. Increase for longer project histories; decrease to keep the output leaner.
v2.0+
testCoverage
boolean — default: false
New in v2.0. Adds per-function test coverage markers (✓ covered / ✗ uncovered) next to each signature by cross-referencing the test directories. Useful for agents working on test gaps. Disabled by default as it requires a test scan pass.
v2.0+ — see testDirs
testDirs
string[] — default: ["test","tests","__tests__","spec"]
Directories scanned for test functions when testCoverage is enabled. Add custom test directory names here if your project uses a non-standard layout such as e2e or integration.
v2.0+
impactRadius
boolean — default: false
New in v2.0. Adds reverse dependency annotations next to each exported symbol, showing which other files import it (e.g. "used by: 3 files"). Helps the AI agent reason about the blast radius of a change before making it. Adds a build-time reverse-graph pass.
v2.0+

.contextignore

Fine-grained exclusions

Use gitignore syntax to exclude specific files and paths that the exclude array alone can't express.

📄
Gitignore syntax, zero config
Create a .contextignore file in your project root. SigMap reads it automatically on every run — no config key needed. It is fully compatible with .repomixignore, so you can symlink the two files to share one exclusion list across both tools.
.contextignore
# Generated and build artefacts
dist/
build/
.next/
coverage/
 
# Large auto-generated files
src/generated/
**/*.generated.ts
**/*.pb.go
 
# Fixtures and test snapshots
**/__snapshots__/
tests/fixtures/
 
# Vendor and lock files
vendor/
*.lock
 
# Specific noisy files
src/migrations/
docs/
🔗
Share with Repomix
If you use Repomix alongside SigMap, symlink the files so both tools respect the same exclusions: ln -s .contextignore .repomixignore. See the Repomix integration guide for the two-layer caching strategy.

What's next

Explore further

All flags
CLI reference
Every CLI flag documented with runnable examples — --watch, --diff, --health, --mcp and more.
v1.1
Context strategies
Full vs per-module vs hot-cold. When to use each strategy and the token trade-offs involved.
MCP
MCP setup
Integrate SigMap as a Model Context Protocol server with Claude Desktop, Cursor, and Windsurf.