Every flag, with examples. Run sigmap --help to see the full list.
Quick reference
Every command SigMap accepts, one per line.
Core commands
Detailed reference for each flag with runnable examples.
The default run mode. Scans all configured source directories, extracts signatures from every supported file, applies the token budget, and writes the output file(s). Use this in CI, as a pre-push check, or any time you want a one-shot refresh. Exits with code 0 on success.
Starts the file watcher and keeps the process running. Every time a file inside a configured srcDir changes, SigMap regenerates the context after the watchDebounce delay (default 300 ms). Ideal during active development when you want your AI agent to always have the freshest context. Press Ctrl+C to stop.
The recommended one-time setup command. It generates the context file, installs a git pre-commit hook so every commit triggers a regen, and starts the file watcher in the foreground. Running this once means you never have to think about keeping context up to date again.
--diff limits the scan to files that have changed since the last git commit (unstaged + staged). --diff --staged further narrows to only staged files, making it ideal as a pre-commit hook check. Both variants run significantly faster on large codebases since they skip unchanged files entirely.
Prints a human-readable token reduction breakdown to stdout. Add --json for machine-readable output suitable for CI pipelines — the command exits with code 1 if the output exceeds maxTokens. The --history flag shows trends across past runs stored in .context/usage.ndjson.
Computes a composite health score (0–100, graded A through D) by combining token efficiency, secret-scan results, dependency freshness, and test coverage signals. Use it as a quick sanity check before a big session or in your CI dashboard. The --json variant emits structured output for programmatic consumption.
Analyses the codebase complexity and the provided task description, then recommends the appropriate model tier: fast (Haiku-class), balanced (Sonnet-class), or powerful (Opus-class). Useful when you want to keep costs down by routing simple tasks to cheaper models and only reaching for the powerful tier when it is truly needed.
Starts the Model Context Protocol server on stdio, exposing SigMap's context generation capabilities as MCP tools that any compatible client (Claude Desktop, Cursor, Windsurf) can call. The server stays alive until the parent process closes the pipe. See the MCP setup page for full integration instructions.
generate_context, get_report, and get_health as callable tools.Activates monorepo mode, which generates a separate context file per package instead of a single project-wide file. SigMap detects packages by looking for package.json, pyproject.toml, or go.mod files. Each package gets its own context file scoped to only its own source tree, keeping token budgets lean per workspace.
Runs context generation independently for each sub-directory, producing a separate output file per directory. Unlike --monorepo (which detects packages via manifest files), --each treats each top-level directory as an independent workspace. Pass an optional comma-separated list of dirs to limit which ones to process. Useful for polyglot repos or workspaces where each directory is a completely separate project.
Appends an HTTP route extraction section to the output file. SigMap scans for route definitions in Express, Fastify, Flask, FastAPI, Spring, Rails, and other common frameworks. The resulting section gives your AI agent a complete picture of your API surface without it having to read controller files.
In addition to the standard markdown output, writes a companion .json file structured for the Anthropic prompt-cache API. Feed the JSON directly to the API's system parameter with cache_control set to save up to 90% on repeated context costs when calling the API directly.
Appends a newline-delimited JSON record to .context/usage.ndjson on every run. Each record includes timestamp, token counts, file counts, and reduction percentage. Use this to track usage trends over time or pipe into your observability stack. The file is safe to commit alongside your project.
Scaffolds a gen-context.config.json with every available option pre-filled with its default value and a comment explaining each key. Also creates a starter .contextignore with common exclusion patterns. Neither file overwrites an existing one, so it is safe to run repeatedly.
Ranks every file in the project by relevance to a free-text query using a zero-dependency TF-IDF approach. Prints a scored table of the top-K files, then the full signature blocks for the top 3. Add --json for machine-readable output or --top N to limit results. The MCP query_context tool exposes the same ranking live in any agent session.
Prints the current SigMap version string and exits. Useful in scripts to verify you have the expected version installed before running a pipeline.
What's next