NavGator
Architecture Connection Tracker for Claude Code and Codex
Know your stack before you change it
NavGator tracks architecture connections across your entire stack—packages, services, databases, queues, and infrastructure—so your coding agent knows what else needs to change when you modify one part of the system.
New here, human or agent? Read ARCHITECTURE.md first. It is committed,
so a fresh clone has it before any scan runs: modules and what each is responsible for, what
depends on what, per-file blast radius, and the boundaries that must not be crossed. The
machine-readable form is docs/architecture/index.json.
Regenerate both with npm run architecture; CI fails if the committed copy is stale.
Features
- Component Detection: Packages (npm, pip, SPM, Cargo), frameworks, databases, queues, infrastructure
- Source-Level Code Navigation: Swift (types, protocol conformance, state/actor isolation, SwiftUI navigation) and Rust (modules, structs/enums/traits, trait impls,
use graph, LLM calls) — mapped straight from source
- Connection Mapping: API → Database, Frontend → API, Queue → Handler, Service calls
- Impact Analysis: "What's affected if I change X?"
- Change Detection: SHA-256 file hashing tracks what changed since last scan
- Mermaid Diagrams: Visual architecture diagrams
- Claude Code Integration: 4 slash commands, 4 subagents, 6 skills, and the
navgator CLI as the default agent surface
- Codex Integration: the same 6 skills, driving the
navgator CLI, through a Codex-specific manifest
Agent interface policy: CLI first, HTTP second, MCP last resort
CLI first — the default, always. navgator <command> --agent is the wired
surface for every agent-facing operation on both Claude Code and Codex. Each call
spawns a fresh process, so it reads current on-disk state, returns a real exit
code, and writes a stable {command, data, schema_version, timestamp} envelope
to stdout. It costs zero context until it is called.
Local HTTP API second — for process boundaries only. The loopback dashboard
(navgator ui) serves read routes under web/app/api/. Use it when a separate,
already-running process needs a request/response boundary. It is not an agent
surface: an agent that can run a shell should run the CLI.
MCP last resort — deprecated as a default, opt-in only. NavGator no longer
registers an MCP server on either host. The server code still ships and still
works; opt in with --with-mcp on either installer. Use it only for a consumer
that genuinely cannot spawn a subprocess — no shell, no Bash tool. Three failure
modes drove the demotion:
- Startup state caching. The server is a long-lived process. State it reads at
startup can go stale against the working tree while the session continues, so a
tool can answer from a snapshot the user has already changed. A CLI call
re-reads on every invocation.
- Silent failure. A failed handshake or a crashed server surfaces as a missing
tool, not an error. A CLI call returns a non-zero exit code and stderr you can
act on.
- Context cost. Twelve tool schemas load into every request whether or not the
session touches architecture. The CLI costs nothing until it is called.
Opting in:
bash scripts/install-plugin.sh --global --with-mcp # Claude Code
bash scripts/install-codex-plugin.sh --user --with-mcp # Codex
Without --with-mcp, no MCP server is registered on either host.
Exit codes
navgator <command> --agent returns one of five exit codes so a caller can
decide what happened without parsing stdout. 0–2 predate this contract and
keep their existing meanings; 3 and 4 are additive.
| Code | Name | Meaning | Caller should |
|---|
0 | SUCCESS | Command ran, produced its result | Read stdout |
1 | OPERATIONAL | Unexpected failure — exception, unreadable/unwritable state, spawn failure | Read stderr; treat as a bug or environment problem, not a retry target |
2 | NO_DATA | Ran fine, but nothing to report yet — no scan data, stale index, lock busy, nothing to diff. Not an error. | Run navgator scan (or retry once the lock clears) |
3 | NOT_FOUND | The named entity does not exist — unknown component, unregistered project, missing lesson id, unknown model | Check the name/id (candidates are usually printed), don't retry unchanged |
4 | USAGE | The invocation itself was wrong — bad/missing arguments, mutually exclusive flags, or a request this surface can't serve (e.g. a natural-language argument) | Fix the invocation; retrying unchanged will fail the same way |
Named constants live in src/cli/exit-codes.ts — reference those, not the
bare numbers, from anything that shells out to navgator.
Migrating off the MCP tools