Evidence-backed reverse engineering and human-gated software planning for Pi and MCP coding agents.
git clone https://github.com/HuginnIndustries/CodeCartographer{
"mcpServers": {
"codecartographer": {
"command": "node",
"args": ["/path/to/CodeCartographer/dist/index.js"]
}
}
}MCP Servers overview
<p align="center">
<img src="assets/logo.svg" alt="CodeCartographer logo" width="96" height="96">
</p>
# CodeCartographer
[](https://github.com/HuginnIndustries/CodeCartographer/actions/workflows/ci.yml)
[](LICENSE)
[](https://www.npmjs.com/package/codecartographer-pi)
[](package.json)
> **Evidence-backed software cartography for coding agents.** Turn an unfamiliar repository into validated architecture, contracts, defects, and a reimplementation specification—then combine explicitly confirmed specifications with a product vision to produce a provenance-backed implementation plan.
```text
● CodeCartographer
├─ ✓ architecture phase ⟳ 25 · 76 tool uses · 1.0M tokens · 4m28s
├─ ✓ defect-scan-mech. ⟳ 39 · 91 tool uses · 2.4M tokens · 7m05s
└─ ⠹ contracts phase ⟳ 11 · 37 tool uses · 335.1k tokens · 40.1s
⎿ extracting behavioral contracts from server/index.ts…
```
---
## At a glance
| What you get | Where it lives |
|---|---|
| **Layered analysis pipeline** — architecture → defect scan → behavioral contracts → protocols → porting → reimplementation spec | `.codecarto/` template |
| **Validation gates between phases** — no advancing past a `FAIL` output | `core/` state machine |
| **Three surfaces, one framework** — Pi extension (recommended), MCP server (for other coding agents), or drop-in template (one-off / evaluation) | All three share `core/` |
| **Live progress widget** while phase sub-agents work | Pi extension |
| **HTML dashboard** — single-file aggregate of progress, links, usage, narrative | `.codecarto/dashboard.html` |
| **Per-phase token tracking** | `/codecarto-usage` |
| **Opt-in LLM steering** of the next phase's seed prompt | `/codecarto-next --llm-steer` |
| **Forward synthesis** — vision + confirmed library specs → provenance-backed project plan | `pipeline-synthesis.yaml` |
Publish completed reimplementation specs from Pi or MCP, then run the `synthesis` pipeline to turn a product vision and explicitly confirmed library entries into a conflict-aware `project-plan.md` with a decision-level provenance ledger.
OpenAI Build Week reviewers: see the [new-vs-existing scope and one-command demo](docs/build-week-2026.md).
---
## Install
Three surfaces, in recommended order. All three share the same `core/` and produce byte-identical phase prompts. Pi provides the richest orchestration UX; Pi and MCP both support the executable library and synthesis workflows; drop-in mode provides the analysis framework without those runtime operations.
1. **Pi extension** — recommended for interactive use. First-class UX.
2. **MCP server** — for Claude Code, Codex, opencode, Cursor, Claude Desktop, and any other MCP-capable agent.
3. **Drop-in template** — pure `.codecarto/` markdown + YAML for one-off evaluation or any LLM that can read and write files. Library and synthesis workflows are **not** available in pure drop-in mode; the analysis side works fully.
### Pi extension (recommended)
[Pi](https://github.com/badlogic/pi-mono/tree/main/packages/coding-agent) is a TUI coding agent. The CodeCartographer extension adds slash commands, a live agents widget, and the dashboard.
```bash
pi install npm:codecartographer-pi # from the npm registry
pi install /absolute/path/to/CodeCartographer # from a local checkout
pi install git:github.com/HuginnIndustries/CodeCartographer # from a git URL
```
> **Don't** run `npm install codecartographer-pi` for the Pi use case. Plain `npm install` puts the package on disk but doesn't register it with Pi. Use `pi install npm:...` so Pi writes the package into its own `~/.pi/agent/settings.json`.
For extension development, point Pi directly at the entrypoint:
```bash
pi -e /absolute/path/to/CodeCartographer/extensions/codecarto/index.ts
```
### MCP server (for other coding agents)
Use this when your coding agent isn't Pi — Claude Code, Codex, opencode, Cursor, Claude Desktop, or anything else that speaks MCP. The host drives the conversation and runs the LLM; CodeCartographer provides phase prompts, validation, and experimental library publish/list/reindex operations.
```bash
npm install --global codecartographer-pi
```
Add to your host config (`~/.config/claude-code/config.json`, `claude_desktop_config.json`, etc.):
```json
{
"mcpServers": {
"codecartographer": {
"command": "codecarto-mcp"
}
}
}
```
[Official MCP Registry listing](https://registry.modelcontextprotocol.io/?search=CodeCartographer): `io.github.HuginnIndustries/codecartographer`.
### Drop-in template (one-off / evaluation)
Use this to try CodeCartographer in any repo without installing anything, or in environments where neither Pi nor an MCP-capable agent is available. Works with any LLM that can read and write files.
```bash
cp -r /path/to/CodeCartographer/.codecarto /path/to/your-repo/
```
Then in the LLM session: `Read .codecarto/GUIDE.md and begin the analysis.`
> **Limitation.** Drop-in mode runs the analysis pipeline fully, but library + synthesis workflows require executable code through Pi or MCP.
---
## Forward synthesis quickstart
Analysis turns repositories into reusable specifications. Synthesis runs the other direction: it combines a raw product vision with human-confirmed specifications and produces an implementation-ready plan without losing provenance.
1. Configure the library that contains specs published with `/codecarto-publish` or the MCP `codecarto_publish` tool:
```yaml
# ~/.codecarto/config.yaml or .codecarto/workflow/config.yaml
library:
path: /absolute/path/to/codecarto-library
namespace: your-namespace # omit for a single-tenant library
publish_confirm: true
```
2. Initialize a clean planning workspace and fill in its brief:
```text
/codecarto-init synthesis
```
Edit `.codecarto/inputs/vision.md` with the audience, problem, desired outcome, constraints, and non-goals.
3. Run until CodeCartographer creates the candidate proposal:
```text
/codecarto-next --auto
```
The run intentionally stops before merging. Review `.codecarto/findings/goal-synthesis/proposal.md` and change one or more candidate boxes from `[ ]` to `[x]`.
4. Resume:
```text
/codecarto-next --auto
```
The final `.codecarto/findings/goal-synthesis/project-plan.md` contains product scope, architecture, work packages, acceptance gates, an unresolved-conflict register, and a provenance ledger mapping every load-bearing decision back to the vision or a confirmed specification. Runtime preflight checks prevent merging or finalization before explicit human confirmation.
---
## How it works
The "code" is structured Markdown + YAML inside `.codecarto/`:
- **`GUIDE.md`** — LLM entry point. Every session reads this first.
- **`workflow/pipeline.yaml`** — phase definitions, dependencies, output paths.
- **`workflow/status.yaml`** — mutable per-project state. Single source of truth for progress.
- **`workflow/VALIDATE.md`** — validation protocol run after every phase.
- **`findings/<phase>/SKILL.md`** — detailed analysis instructions per phase.
- **`templates/`** — output templates that enforce consistent structure.
Phases form a DAG: `contracts` and `protocols` can run in parallel after `architecture`; `porting` waits for both; `reimplementation-spec` is last. The host (Pi, MCP, or your shell) reads the active pipeline, finds the next phase whose dependencies are all `complete`, hands the LLM that phase's instructions, validates the output, and advances `status.yaml`.
For multi-session work, every new session reads `.codecarto/GUIDE.md` (or the lighter `NEW_THREAD_BLURB.md`), checks `workflow/status.yaml`, and picks up where the last session left off. You don't explain what happened in previous sessions.
---
## Progressive distillation and context resilience
CodeCartographer is a progressive, evidence-tagged distillation of a codebase. It does not ask one context window to retain the entire investigation. Instead, each phase turns a large body of source evidence into a smaller, more task-specific artifact that the next phase can read:
```text
source code
→ architecture map
→ behavioral contracts + protocols + defect findings
→ porting bundle
→ reimplementation spec
```
This is deliberate distillation, not incidental chat summarization. Each artifact follows a template, preserves evidence levels and known unknowns, and must pass validation before it becomes an input to downstream phases.
### What happens when conversation context is compacted?
The filesystem, not the conversation, is the durable memory of a run:
- Each phase gets a fresh context window. In the Pi extension it runs as an isolated phase sub-agent; MCP and drop-in hosts should use the same one-session-per-phase pattern.
- Completed findings live under `.codecarto/findings/`. Later phases re-read the specific upstream artifacts declared by the active pipeline instead of relying on conversational recall.
- `workflow/status.yaml` records progress, terminal `open_questions`, in-pipeline `carry_forward`, and a separate `post_pipeline` backlog for optional spikes, amendments, deltas, decisions, and reruns after completion. Phase agents propose changes in `.codecarto/scratch/handoffs/<phase>.yaml`; completion validates and applies them under a lock with host timestamps, one canonical closeout, and an idempotent `THREAD_LOG.md` entry.
- Pi phase transcripts are file-backed and remain available through `/resume`, `/tree`, and `/export`, even when the active model context has been compacted.
- For isolated Pi phase sessions, compaction uses a phase-aware continuation summary that explicitly preserves evidence, files inspectedWhat people ask about CodeCartographer
What is HuginnIndustries/CodeCartographer?
+
HuginnIndustries/CodeCartographer is mcp servers for the Claude AI ecosystem. Evidence-backed reverse engineering and human-gated software planning for Pi and MCP coding agents. It has 1 GitHub stars and was last updated today.
How do I install CodeCartographer?
+
You can install CodeCartographer by cloning the repository (https://github.com/HuginnIndustries/CodeCartographer) or following the README instructions on GitHub. ClaudeWave also provides quick install blocks on this page.
Is HuginnIndustries/CodeCartographer safe to use?
+
HuginnIndustries/CodeCartographer has not been audited yet by our security agent. Review the original repository on GitHub before using it in production.
Who maintains HuginnIndustries/CodeCartographer?
+
HuginnIndustries/CodeCartographer is maintained by HuginnIndustries. The last recorded GitHub activity is from today, with 0 open issues.
Are there alternatives to CodeCartographer?
+
Yes. On ClaudeWave you can browse similar mcp servers at /categories/mcp, sorted by popularity or recent activity.
Deploy CodeCartographer to your cloud
Ship this repo to production in minutes. Each platform spins up its own environment with editable env vars.
Maintain this repo? Add a badge to your README
Drop the badge into your GitHub README to show it's tracked on ClaudeWave. Each badge links back to this page and reflects the live Trust Score.
[](https://claudewave.com/repo/huginnindustries-codecartographer)<a href="https://claudewave.com/repo/huginnindustries-codecartographer"><img src="https://claudewave.com/api/badge/huginnindustries-codecartographer" alt="Featured on ClaudeWave: HuginnIndustries/CodeCartographer" width="320" height="64" /></a>More MCP Servers
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
User-friendly AI Interface (Supports Ollama, OpenAI API, ...)
An open-source AI agent that brings the power of Gemini directly into your terminal.
The fastest path to AI-powered full stack observability, even for lean teams.
🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!
Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface