Survey
Build or refresh the Cartographer atlas for the current repository — a proactive map of "where things live" that downstream phases (Recon Brief, Architect, Conformance) consult before deciding where to make a change.
The atlas lives at ~/.claude/cartographer/projects/<hash>/:
atlas.json— machine-readable summary (layers, naming, error style, dependency edges, forbidden imports, staleness config).atlas.md— human-readable 2-5KB summary.staleness.flag— empty marker; present means the atlas has drifted.
Dependencies
- Path:
~/.claude/hooks/_lib_cartographer.py- hard import inscripts/run.py(project hash, tree-sitter access, audit append). Missing = the skill cannot run. - Path:
~/.claude/cartographer/projects/<hash>/- the atlas store it writes. - CLI:
python3. - Optional:
git(staleness config andhead_sha; absent = neither recorded), tree-sitter (absent = regex fallback and the atlas is markeddegraded).
Arguments
- (no argument) — No-op if
atlas.jsonexists andstaleness.flagis absent (prints a skip reason). Runs the survey otherwise (atlas missing or stale). --if-missing— Survey only whenatlas.jsonis absent. No-op when an atlas already exists, even ifstaleness.flagis present (a stale atlas is left for the bare invocation or--refreshto rebuild). Used by/catchup, which only needs an atlas to exist.--refresh— Force a full re-survey, bypassing the staleness check. Clearsstaleness.flagon success. Preserves any[manual]override block inatlas.jsonbyte-for-byte; rewrites every other field.
Workflow
Delegate to the survey script, forwarding any flag verbatim:
python3 "${CLAUDE_SKILL_DIR}/scripts/run.py"
python3 "${CLAUDE_SKILL_DIR}/scripts/run.py" --if-missing
python3 "${CLAUDE_SKILL_DIR}/scripts/run.py" --refresh
The script resolves the project hash via _lib_cartographer, walks the repo
tree, extracts symbols (tree-sitter, with a regex fallback marked degraded),
classifies layers, naming, and error style, then writes atlas.json and
atlas.md atomically.
After running
Report the status line the script emits — whether it surveyed, refreshed, or skipped, plus the atlas location and size. If the script reports a degraded run (tree-sitter unavailable) or a truncated atlas, surface that to the user.
Notes
- Atlas path:
~/.claude/cartographer/projects/<hash>/. - Layer detection is heuristic; a
[manual]block inatlas.jsonlets the user override it and survives re-survey. - Survey caps files-sampled at 50 per layer; large repos produce a partial
atlas with
truncated: true. - On a non-git directory the atlas omits
head_shaand staleness checks skip.