faber-atlas
by fabersep
README.md
# FaberSEP Atlas (`@fabersep/atlas`)
[](LICENSE)
[](tsconfig.json)
[](https://github.com/fabersep/atlas/actions/workflows/ci.yml)
[](package.json)
**Give your AI coding agent a deterministic map of the codebase, not a pile of files.**
**FaberSEP Atlas** (`@fabersep/atlas`, CLI: `faber-atlas`) scans any supported repository with Tree-sitter language packs and produces layered zoom maps (`--zoom 0|1|2`), declaration briefs, import neighborhoods, downstream execution flows (`flow`), upstream impact trees (`impact`), centrality hubs (`hubs`), code health checks (`health`), and privacy-first local efficiency stats (`stats`).
**100% local. Zero network calls. Zero telemetry. Zero LLM indexing cost.**
> **Why not embeddings?**
> Vector search is fuzzy and semantic; it misses exact call chains, interface implementations, and import graphs. Raw text search (`grep`) has no concept of AST scopes or runtime wiring. Atlas gives agents deterministic, language-level structural awareness with zero embedding costs.
>
> Embeddings still help for fuzzy conceptual queries; Atlas complements them by showing the exact structure, callers, and execution flow around any symbol or file.
---
## Quick Start (60 Seconds)
### 1. Wire MCP automatically (`init`)
Run in your project root to preview MCP setup for Claude Code, Antigravity, Cursor, and Claude Desktop:
```bash
npx @fabersep/atlas init
npx @fabersep/atlas init --apply
```
- Pass `--agents-md` to also add an optional, non-destructive `<!-- faber-atlas:start -->` navigation hint block to your project's `AGENTS.md`.
- Pass `--undo` to cleanly remove only Atlas entries.
### 2. Scan, verify health, and inspect your local stats
```bash
npx @fabersep/atlas scan .
npx @fabersep/atlas doctor .
npx @fabersep/atlas stats
npx @fabersep/atlas stats --share # 100% anonymized Markdown benchmark card
```
### 3. Explore structure, flow, and impact
```bash
npx @fabersep/atlas map --zoom 0
npx @fabersep/atlas map src/orders --zoom 1
npx @fabersep/atlas brief src/orders/orderService.ts
npx @fabersep/atlas neighborhood src/orders/orderService.ts --budget 400
npx @fabersep/atlas flow OrderController.create --depth 4
npx @fabersep/atlas impact OrderRepository.save --depth 4
npx @fabersep/atlas hubs --top 10
```
A second `scan` parses only files whose size or modification time changed (`--full` parses everything). Queries read `.faber-atlas/` directly and never re-parse unless `--fresh` is passed (which runs an incremental scan in milliseconds first).
---
## MCP Server (Claude Code, Antigravity, Cursor, Claude Desktop)
`faber-atlas mcp` runs a zero-dependency stdio MCP server exposing 7 tools: `map` (with `zoom`), `brief`, `neighborhood`, `flow`, `impact`, `hubs`, and `health`. It automatically runs an incremental scan before each query so edited files are always fresh (pass `--no-fresh` to disable).
**Claude Code**
```bash
claude mcp add faber-atlas -- npx -y @fabersep/atlas mcp --root /path/to/project
```
**Antigravity (`agy`)**
```bash
agy mcp add faber-atlas -- npx -y @fabersep/atlas mcp --root /path/to/project
```
**Cursor (`.cursor/mcp.json` or `~/.cursor/mcp.json`)**
```json
{
"mcpServers": {
"faber-atlas": {
"command": "npx",
"args": ["-y", "@fabersep/atlas", "mcp", "--root", "."]
}
}
}
```
**Claude Desktop (`claude_desktop_config.json`)**
```json
{
"mcpServers": {
"faber-atlas": {
"command": "npx",
"args": ["-y", "@fabersep/atlas", "mcp", "--root", "/absolute/path/to/project"]
}
}
}
```
---
## Real-World Benchmarks
### 1. Multi-Tier Production App (848 files, Apple M4 Pro)
| Tier | Files scanned | Declarations | Source tokens | Skeleton tokens | Saved | First scan | Rescan |
| :--- | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
| Flutter app (Dart) | 613 | 7,247 | 584,063 | 100,151 | 83% | 844 ms | 33 ms |
| API (TypeScript) | 194 | 2,326 | 172,827 | 29,337 | 83% | 266 ms | 15 ms |
| Admin (React) | 41 | 2,204 | 124,354 | 19,132 | 85% | 208 ms | 7 ms |
| **Total** | **848** | **11,777** | **881,244** | **148,620** | **83%** | **1.3 s** | **55 ms** |
### 2. Scout Benchmark (`immich-server`, 775 files, 7,593 declarations)
Measured on `immich-app/immich` `server/` (`7b27863`) across 4 plain-language Q&A and edit tasks using `gemini-4-hydrogen-low` (primary) and `gemini-3.8-flash-low` (read-only scout with Zoom 0/1 map, `brief`, `neighborhood`, `flow`, `impact`):
- **Layered map sizes:** `--zoom 0` = **171 tokens** (18 lines), `--zoom 1` = **9,930 tokens** (`controllers + services + repositories` = 3,095 tokens), `--zoom 2` = **17,725 tokens**.
- **Zero-LLM AST signals:** 531 entrypoints (`@Controller`, `@Get/@Post`, `@OnEvent`, `@OnJob`, `@Cron`), 221 thrown exceptions, 7 role tags (`http`, `event`, `job`, `db`, `auth`, `ui`, `io`).
- **Primary model impact (4 tasks total):**
- Primary tokens: **119,415 → 76,757 (-35.7%)**
- Primary latency: **61.8 s → 31.5 s (-49.0%)**
- Accuracy: **3/4 → 4/4** (on the edit task, primary alone hallucinated a non-existent `album.assetCount` property; the scout located `albumRepository.getMetadataForIds([album.id])` and existing spec mocks).
Full tables: [Phase 1 summary](bench/results/immich-server-7b27863-phase1-scout/SUMMARY.md) and [Phase 2 summary](bench/results/immich-server-7b27863-phase2-flow-scout/SUMMARY.md).
---
## Privacy-First Local Stats & Shareable Benchmark
Atlas records **zero remote telemetry**. Every `scan` and MCP tool call appends only numeric counters and durations to `<out>/metrics.jsonl` (auto-rotated at 10 MB / 90 days) — **never** repository names, file paths, symbol names, or source code.
- `faber-atlas stats` shows your repo's token compression, `zoom 0/1/2` sizes, AST signal counts, MCP schema footprint, median scan/rescan latency, and MCP tool usage.
- `faber-atlas stats --share` outputs a strictly anonymized Markdown benchmark card you can inspect locally and optionally share.
- `faber-atlas doctor` runs read-only `PASS / WARN / FAIL` checks on Node version, index schema/freshness, parse health, `.gitignore` hygiene, and local metrics.
---
## Code Health & CI Gate
```bash
faber-atlas health . \
--max-file-lines 300 --max-function-lines 25 --hard-function-lines 40 \
--max-nesting-depth 4 --min-duplicate-lines 6 --json > after.json
faber-atlas health-compare before.json after.json --json
```
`health` requires every limit explicitly (none are assumed) and reports oversized files, long functions/methods, excessive nesting depth, duplicated code blocks, import cycles, and unmeasured files. `health-compare` diffs two reports to flag only regressions introduced by a change.
---
## Supported Language Packs
| Pack | Files | Notes |
| :--- | :--- | :--- |
| `typescript` | `.ts .tsx .mts .cts .js .jsx .mjs .cjs` | `tsconfig.json` `paths` & `baseUrl`, NodeNext `./a.js` → `a.ts`, JSX/TSX, AST signals, `flow`/`impact` (calls, `implements`, `@OnEvent`, `@OnJob`) |
| `dart` | `.dart` | Dart 3 (records, patterns, switch expressions, class modifiers), `package:` import resolution, Flutter lifecycle markers, `flow`/`impact` |
| `csharp` | `.cs` | Classes, structs, records, interfaces, enums, delegates, `using` resolution, AST signals, `flow`/`impact` (fields, `implements`, MediatR `Send` ↔ `IRequestHandler`) |
| `msbuild` | `.csproj .props .targets .sln .slnx` | Package dependencies and project references as graph edges |
| `json` | `.json` | JSONC comments & trailing commas, `package.json` dependency audit, compact shape folding |
| `yaml` | `.yaml .yml` | `pubspec.yaml` dependencies (SDK, path, git) and compact shape folding |
Adding a language pack: see [CONTRIBUTING.md](CONTRIBUTING.md).
---
## Programmatic Library
```ts
import {
scan, renderMap, flow, impact, renderFlow,
neighborhood, hubs, health, compareHealth,
computeStats, runDoctor, PACKS,
} from '@fabersep/atlas';
const { map, topology } = await scan({ root: 'path/to/project', packs: PACKS });
console.log(renderMap(map, { zoom: 1 }));
console.log(renderFlow(flow(map, 'OrderController.create', { depth: 4 })));
```
---
## Documentation & Ecosystem
- **Master PRD:** [docs/master-prd.md](docs/master-prd.md)
- **Architecture Guide:** [docs/architecture.md](docs/architecture.md)
- **Feature Specs & BDD Criteria:** [docs/features/README.md](docs/features/README.md)
- **Roadmap:** [ROADMAP.md](ROADMAP.md)
- **FaberSEP Ecosystem:** [fabersep.com](https://fabersep.com) · [fabersep.dev](https://fabersep.dev) · [`@fabersep/spec`](https://github.com/fabersep/spec) · [`@fabersep/memory`](https://github.com/fabersep/memory)
Licensed under the [Apache License 2.0](LICENSE).
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues