# Specter Scan

> Scan and index the current codebase into Specter's knowledge graph Use when this capability is needed.

- Skill: `tomevault-io/specter-scan` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/specter-scan`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/specter-scan/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/specter-scan

---


# Specter Scan

Build or rebuild the knowledge graph for the current codebase.

## When to Use

- First time using Specter on a project
- After major refactoring or adding many files
- When specter tools return stale or missing data
- Before asking the specter agent questions about the codebase

## How to Run

Execute the specter scan command:

```bash
npx specter-mcp scan
```

Or with options:

```bash
# Skip git history analysis (faster)
npx specter-mcp scan --no-git

# Force rescan even if graph exists
npx specter-mcp scan --force

# Scan a specific directory
npx specter-mcp scan --dir ./packages/core
```

## What It Does

1. Parses all TypeScript/JavaScript files using AST analysis
2. Extracts functions, classes, interfaces, types, and exports
3. Maps import relationships between files
4. Calculates cyclomatic complexity for each function
5. Analyzes git history for modification patterns (unless --no-git)
6. Saves the knowledge graph to `.specter/graph.json`

## Output

After scanning, you'll see:
- File count and total lines
- Symbol count (functions, classes, etc.)
- Relationship count (imports)
- Complexity metrics
- Language breakdown

The `.specter/` directory will contain:
- `graph.json` — The full knowledge graph
- `metadata.json` — Quick-access scan statistics

## Performance

- ~1000 files per minute on typical hardware
- Git history adds ~30% scan time
- Use `--no-git` for faster iteration during development

## Notes

- Only TypeScript and JavaScript files are analyzed
- `node_modules`, `dist`, and `build` directories are excluded
- Test files (`*.test.ts`, `*.spec.ts`) are excluded
- The `.specter/` directory is automatically added to `.gitignore`

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/forbiddenlink) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-13 -->

