Cartograph

Cartograph is the Claude Code plugin that turns "I have a codebase" into "I have a living architecture diagram." No manual diagramming — Claude scans your code, detects your architecture, and pushes a structured graph to your board.

ContextDx maps your codebase into a living architecture diagram and runs targeted analysis on it — all from Claude Code.

From codebase to a living architecture board:

Prerequisites

  • Claude Code installed and running
  • A ContextDx workspace with at least one board
  • Your Binding Token and API Secret from the portal

Cartograph reads its credentials from .contextdx/config.json at the root of your repo:

JSON
{
  "bindingToken": "YWJjMTIz...",
  "apiSecret": "ck_cp_live_xxx",
  "branch": "main",
  "boardSlug": "my-project-overview"
}
FieldRequiredNotes
bindingTokenYesBase64url-encoded orgId:bindingId from the portal.
apiSecretYesMust start with ck_cp_live_. The plugin rejects anything else.
branchYesThe git branch this board is bound to (e.g. main).
boardSlugYesThe Root Board slug. /configure discovers and writes this for you.
Note

The secret prefix is ck_cp_live_. If you find an older reference to a bb_ prefix anywhere, ignore it — it's outdated. /configure will offer to add .contextdx/ to your .gitignore; let it.

Setup (one-time)

1. Install Cartograph

Add the marketplace once, then install the plugin:

/plugin marketplace add contextdx/cartograph-plugin
/plugin install cdx-code@cdx-plugins

Restart Claude Code after installing so the commands load. To scope the install, add --scope user (default), --scope project, or --scope local to the install command.

2. Connect to your board

/configure

/configure validates your config, tests the connection, and auto-discovers your Root Board. It reads credentials from .contextdx/config.json rather than asking you to paste secrets inline — see Prerequisites for the file shape.

Map your architecture

/analyze

Claude scans your project — detects services, APIs, databases, queues — and maps how they connect. The result is a structured graph of your architecture (L0 overview, 10–30 nodes).

Note

Settle the vocabulary first (recommended). On a new codebase, run /analyze-archetypes before your first /analyze. It scans for component patterns that don't fit your workspace's archetype catalogue and submits proposals for review, so every component lands on a fitting type instead of a misfit you'd have to re-type later. If you skip it, /analyze prompts you to run it whenever the catalogue or commit has drifted.

To zoom into a specific node:

/analyze --drill my-project-overview/api-gateway

This creates a layer board (L1/L2) for that node with finer-grained components. The argument is <parent-board-slug>/<node-slug>.

To analyze all layers progressively (L0 → L1 → L2):

/analyze --all

Each layer is presented for review before proceeding to the next.

To force a full re-analysis from scratch:

/analyze --clean

Push to the portal

/sync

Your architecture appears as a visual diagram on your board in the portal. Nodes show components with their types and descriptions. Edges show how they relate — imports, API calls, data access, event flows.

If you have multiple boards, sync a specific one:

/sync --board my-project-overview

Or sync all boards at once:

/sync --all

Sync guardrails

Before any board reaches the portal, /sync runs a structural check on the analyzer's output. If a board has more than 8 nodes but no domain_group containers, the sync is rejected with a clear error — flat boards at that size are almost always a sign that the analyzer skipped the grouping step, and they render as an unreadable wall of nodes.

Claude Code showing /sync rejected by the board-structure check/sync blocks a flat, ungrouped board so it never renders as a wall of nodes.

The fix is to re-run /analyze; the agent's protocol includes a "domain grouping" step that should populate domain_group containers automatically.

Opting out

If your project is genuinely small enough that a flat board is the right call, you can disable the check in .contextdx/config.json:

JSON
{
  "bindingToken": "...",
  "apiSecret": "...",
  "boardSlug": "...",
  "branch": "main",
  "validation": {
    "skipBoardStructureCheck": true
  }
}
Note

When disabled, every /sync prints a stderr notice ([cdx-sync] board-structure check disabled via config.validation.skipBoardStructureCheck) so the opt-out is never silent. Remove the field — or set it to false — to re-enable the check.

Run targeted analysis

/insights

Insight skills are defined by your workspace admin on the portal — security checks, quality reviews, dependency audits, and more. The server defines what each skill looks for; Claude Code does the reasoning. It reads the board and your source files locally, authors the findings, and pushes them back.

Each finding is tied to a specific component on your diagram. Affected areas are highlighted so your team sees impact at a glance.

Note

/insights runs entirely in Claude Code — no model provider connection is required. This is different from the portal's in-app "With Insights" mode, which runs through Chat and does need a connected model provider. The plugin path here works without one.

Pass a natural-language prompt and Claude matches it to the right skills:

/insights find auth and data-access risks

To see what's available, pick from a list, run a specific skill, or run them all:

/insights --list          # list available skills
/insights --select        # choose skills and focus interactively
/insights security-analysis  # run a specific skill by slug
/insights --all           # run every skill

Keep it current

After code changes, just re-run:

/analyze
/sync

Analysis is incremental — it detects the git diff since last run and only re-analyzes changed files. This applies to all modes: /analyze, /analyze --drill, and /analyze --all each update only what changed in existing boards.

Note

First analysis on a large monorepo can take a few minutes. Subsequent runs are fast because they only touch the git diff.

Use /analyze --clean if the incremental result looks stale.

Check where things stand

/status

Shows configuration, board manifest, analysis summary per board, sync status, and changed files since last analysis.

Claude Code showing /status output — config, board manifest, sync state, and changed files/status reports where everything stands: config, boards, sync state, and changes since last analysis.

All commands

CommandPurpose
/configureConnect to the portal
/analyze-archetypesPhase 1 — settle the archetype vocabulary
/analyzeIncremental L0 analysis (full on first run)
/analyze --cleanFull re-analysis from scratch
/analyze --drill <board>/<node>Drill into a specific node
/analyze --allProgressive all-layer analysis
/syncSync single board (prompts if multiple)
/sync --board <slug>Sync a specific board
/sync --allSync all boards
/statusCheck current state
/insightsRun insight skills against a board
/insights <prompt>Match skills to a natural-language prompt
/insights --listList available skills
/insights --selectChoose skills and focus interactively
/insights <skill-slug>Run a specific skill
/insights --allRun all available skills
/helpList commands and show the plugin version

Troubleshooting

SymptomFix
Commands don't appear after installRestart Claude Code so the plugin's commands load.
/configure can't connect (401)Check bindingToken and apiSecret in .contextdx/config.json — the secret must start with ck_cp_live_. Regenerate the credentials in the portal if needed.
400 Branch MismatchSet branch in your config to the branch your board is bound to (e.g. main).
/analyze asks for /analyze-archetypes firstThat's the Phase 1 precondition — run /analyze-archetypes. It re-prompts whenever the archetype catalogue or your commit has drifted.
/sync rejected by the board-structure checkA board with more than 8 nodes has no domain_group containers — re-run /analyze, or opt out via validation.skipBoardStructureCheck (see Sync guardrails).
Analysis looks staleRe-run with /analyze --clean for a full re-analysis from scratch.
No insight skills availableInsight skills are defined by your workspace admin in the portal.

What's Next