# Repository Briefing: kingbootoshi/cartographer
> Source: https://repoforai.com/repo/kingbootoshi/cartographer (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/kingbootoshi/cartographer
- **Category**: Coding, Skills & MCP (AI 编程 / Skills / MCP)
- **Primary Language**: TypeScript
- **License**: See repository
- **Engineering Health**: C (31/100 · Maintenance 6/35 · Adoption 13/25 · Releases 6/20 · License 6/20)
- **Review Snapshot**: 2026-12-04
- **Deployment / Stack Signals**: CLI, MCP
- **Momentum**: 856 ★ total (+0 24h / +1 7d) · 65 forks
- **When to Use**: Best for: Teams that want coding agents to share bounded repository context and maintain verifiable removal ledgers during cross-package migrations. Skip if: Live text search is sufficient, you cannot maintain fresh graph artifacts, or procurement requires clear license terms before a pilot.

## Overview
```text
### Architecture & Core Mechanics
Cartographer separates two workflows. The v2 graph engine is a TypeScript CLI run with Bun, with `zod` and `typescript` listed as dependencies and `cartographer` as the binary entrypoint. `index` turns a checkout into local artifacts: `.cartographer/graph.sqlite`, `manifest.json`, JSON schemas, and `CODEBASE_MAP.md`. A file-hash cache in SQLite lets it reuse artifacts when the repository is unchanged.

The MCP entrypoint is a thin, newline-delimited stdio wrapper over graph operations, not a second indexing engine. The legacy Claude Code plugin takes a different path: a scanner respects `.gitignore` and counts tokens, the plugin splits work by token budget, and parallel Sonnet subagents analyze their portions before the reports are combined into `docs/CODEBASE_MAP.md` and referenced from `CLAUDE.md`.

### Key Capabilities & Differentiators
`brief` compiles bounded context for a path, package, symbol, environment variable, DB or IaC object, audit ledger, or changed files. `audit removal` creates a task-specific ledger for `audit verify` to check. Evidence-backed notes have explicit ingest, audit, accept, and retire operations, so agent workflows can distinguish curated notes from material that has not been accepted or is no longer current.

Operators can inspect an existing graph with `view`, compare artifact directories with `diff`, and explicitly export the full graph as debug JSON or JSONL. Broad selectors on compatibility and debug surfaces such as `slice` and `impact` require opt-in. `adoption` scores graph-first behavior from runtime traces; it measures how the agent used context, not whether the resulting code change was correct.

### Trade-offs & Limitations
Compared with ripgrep or editor navigation, Cartographer adds a persistent graph, bounded agent context, and task-specific ledgers. Those are useful for work spanning packages or configuration boundaries, but the index introduces a freshness obligation: use `verify --fresh` before relying on artifacts for a consequential change. Interpret a passing removal audit in light of the graph's extraction coverage; it is not proof that every runtime reference has been removed.

The v2 graph path keeps storage local and avoids running a new parallel model pass for each query. The legacy plugin instead produces narrative documentation, with token use that can grow materially as the checkout and number of subagents grow. No language-by-language coverage or performance benchmarks are available, so pilot with representative code and migrations. The unspecified license is a separate adoption gate for commercial use or redistribution.

### Hardware & Deployment Guide
For v2, install dependencies with `bun install`, build an index with `bun run cartographer:index -- --root . --out .cartographer`, and launch the MCP process with `bun run cartographer:mcp`. The graph is a local SQLite file; no separate database service or model call is part of the listed index-and-query commands. The index consumes local disk, while scanning and graph construction consume CPU and memory. No measured resource figures are available, so size the workflow against representative checkouts.

The legacy path installs through the Claude Code marketplace and uses Python `tiktoken` for scanner token counts. Sonnet is the default for parallel analysis, with Haiku an option when token cost matters more than depth. The shift to v2 is visible in the command surface—`brief`, `audit`, and `notes` rather than just map generation—but there is no tagged release to use as a version milestone. The evaluation examples also reference a machine-specific external checkout path, so verify that setup before treating the profiles as portable CI checks.
```

## Key Capabilities
```text
- Local persistence: `index` writes a SQLite graph, manifest, JSON schemas, and `CODEBASE_MAP.md`.
- Index lifecycle: File hashes support artifact reuse, and `verify --fresh` fails when artifacts drift from the live repo.
- Agent transport: A newline-delimited MCP stdio wrapper exposes graph operations separately from the legacy Claude Code skill.
- Context selection: `brief` accepts selectors including symbols, environment variables, DB/IaC objects, and changed files.
- Review workflow: Removal ledgers have a verification step, and evidence-backed notes can be ingested, audited, accepted, or retired.
- Diagnostics: Full graph export is explicit in debug JSON or JSONL, and `adoption` scores graph-first behavior from runtime traces.
```

## Quick Start / Clone
```bash
bun install
```
