Skip to content

First Context Generation

Manoj Mallick edited this page May 11, 2026 · 1 revision

First Context Generation

30-Second Start

cd /path/to/your/project
sigmap ask "explain the auth flow"

This generates a compact signature map and retrieves files related to authentication.


Step-by-Step Guide

1. Navigate to Your Project

cd ~/path/to/my-project

2. Generate Context File (One-Time)

sigmap

This creates .context/ directory with:

  • context.md — Full signature map
  • query-context.md — Current query results
  • sig-index.json — Index of all signatures

What it does:

  • Scans all source files
  • Extracts code signatures (function names, classes, etc.)
  • Ranks files by relevance

First run takes: 5-30 seconds (depending on project size)

3. Ask Questions

sigmap ask "how does the payment flow work?"

Output shows:

  • Top 10 ranked files
  • Full context in .context/query-context.md
  • Confidence scores

4. Validate Coverage

sigmap validate --query "payment flow"

Checks if essential files are in the context:

  • ✓ PASS — All files found
  • ⚠ PARTIAL — Some files missing
  • ✗ FAIL — Critical files not retrieved

5. Judge Answers

sigmap judge --response answer.txt --context .context/query-context.md

Scores how grounded your AI answer is (0-100):

  • 80-100 — Highly grounded, references code correctly
  • 60-80 — Grounded, mostly correct
  • 40-60 — Partial, some gaps
  • 0-40 — Not grounded, vague references

Common First-Run Issues

"No files found"

Cause: Empty project or hidden source directory
Fix:

sigmap --init
# Manually edit gen-context.config.json to specify srcDirs
sigmap

"Context file too large"

Cause: Including test files, node_modules
Fix: Create .contextignore:

node_modules/
dist/
.next/
__pycache__/
*.test.js
*.spec.ts

"Low confidence score"

Cause: Few signatures extracted (small project)
Fix: Run on larger projects or check language support:

sigmap --diagnose-extractors

Configuration

Create gen-context.config.json in project root:

{
  "srcDirs": ["src", "app", "lib"],
  "exclude": ["node_modules", "dist", "tests"],
  "strategy": "full",
  "maxTokens": 6000
}

Key options:

  • srcDirs — Directories to scan
  • exclude — Patterns to skip
  • strategyfull, per-module, or hot-cold
  • maxTokens — Budget limit

See Configuration Guide for all options.


Next Steps

  1. Set up your IDE
  2. Read FAQ
  3. Explore strategies

Clone this wiki locally