claudemap-runtime
Internal ClaudeMap runtime for turning a repository into a live architecture map and driving that map during walkthroughs. Prefer the public commands in .claude/commands for normal use.
install
source · Clone the upstream repo
git clone https://github.com/QuinnAho/claudemap
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/QuinnAho/claudemap "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skill" ~/.claude/skills/quinnaho-claudemap-claudemap-runtime && rm -rf "$T"
manifest:
skill/SKILL.mdsource content
ClaudeMap is a repo-to-architecture-map workflow.
High-level model:
- snapshot the repository
- ask
to turn that snapshot into a detailed, human-legible graph@claudemap-architect - render the graph in the bundled ClaudeMap UI
- keep the graph and presentation state updated as the user explores the codebase
Public commands:
: build or rebuild the map for the current repository/setup-claudemap
: reopen the existing UI without rebuilding/open-claudemap
: create or refresh a scoped subsystem map from the current root graph/create-map
: update the graph after code changes/refresh
: run a guided walkthrough through the live map/explain
: direct the live map for highlights, focus, presentation, and flows/show
If this skill is invoked directly, default to the setup workflow.
Target repository:
- If the user passed an argument to the invoked skill command, use
as the project root.$ARGUMENTS - If no argument was passed, use the current working directory.
Execution rules:
- Resolve the bundled ClaudeMap workspace from
.${CLAUDE_SKILL_DIR} - Generate a raw repo snapshot by running
for the target project root.${CLAUDE_SKILL_DIR}/skill/commands/snapshot.js - Read
.${CLAUDE_SKILL_DIR}/skill/prompts/enrichment.txt - Use the
subagent explicitly. Give it:@claudemap-architect- the raw snapshot JSON
- the graph schema contract from the enrichment prompt
- instructions to return only valid graph JSON
- instructions to optimize for a detailed graph with intuitive human grouping
- Wait for the subagent Task call to fully return, then save the returned JSON to
. Do not run the setup JS command until after this file has been written with non-empty valid graph JSON. Do not run setup in parallel with the subagent call.${CLAUDE_SKILL_DIR}/tmp/claudemap-enrichment.json - Run
for the target project root with${CLAUDE_SKILL_DIR}/skill/commands/setup-claudemap.js
. The setup command is strict: if the file is missing, empty, or unparseable it will exit non-zero and refuse to render a heuristic graph. Do not retry setup without fixing the enrichment file first.--enrichment-file ${CLAUDE_SKILL_DIR}/tmp/claudemap-enrichment.json - Add
only when the user explicitly asks for a fresh rebuild.--force-refresh - If the subagent fails to return valid JSON after two attempts, tell the user the architect pass failed and stop. Do not silently rerun setup without
— that would render a heuristic graph and pollute the cache. The user should rerun--enrichment-file
once the architect issue is resolved./setup-claudemap - Let the bundled launcher start the app unless the user explicitly asks not to.
- Summarize the analyzed file count, system count, graph source, render transport, and app readiness. Runtime graph outputs land in
(served by the bundled Vite app as${CLAUDE_SKILL_DIR}/app/public/graph/
)./graph/* - End the graph-generation flow with a short feedback prompt such as:
Does this map look right, or should I refine it? - If the user says the map is good, stop there.
- If the user asks for refinement, reuse the current target project's
graph and file snapshot as context when available instead of starting from a blank prompt again.claudemap-cache.json - For refinement passes, send the existing graph plus the user's requested changes back through
, save the refined JSON to@claudemap-architect
, and run${CLAUDE_SKILL_DIR}/tmp/claudemap-enrichment.json
with${CLAUDE_SKILL_DIR}/skill/commands/refresh.js
so the graph iterates in place.--enrichment-file - After the refined graph renders, ask the same short feedback prompt again.
/create-map runs an architect-first scoped pipeline:
- Resolve the target scope from the user's request (either a scope JSON payload copied from the UI, or a natural language description of a subsystem the architect should locate in the root graph).
- Read
. This is a dedicated scoped prompt — do not reuse the root enrichment prompt.${CLAUDE_SKILL_DIR}/skill/prompts/scoped-enrichment.txt - Build a scoped snapshot by filtering the root graph's file list to the files inside the target subsystem. Include any prior scoped graph from the target map's
when one exists so the architect can refine rather than rebuild.cachePath - Call the
subagent with the scoped snapshot, the scoped prompt, and any user instructions. Instruct it to emit a richer internal breakdown (2-6 internal subsystems, tighter edges, function nodes welcome) and to decide between edit-in-place and rebuild based on the intent of the request.@claudemap-architect - Save the returned JSON to
and run${CLAUDE_SKILL_DIR}/tmp/claudemap-enrichment.json
with${CLAUDE_SKILL_DIR}/skill/commands/create-map.js
(plus--enrichment-file
and optional--scope-json
). The command deletes the tmp file after it reads it.--instructions - If the architect pass fails, the command can still fall back to
by running withoutbuildScopedGraphFromRoot
, but warn the user the scoped map will be a plain filter view and suggest rerunning with architect enrichment for richer grouping.--enrichment-file - After the scoped map renders, ask the same short feedback prompt (
).Does this map look right, or should I refine it? - If the user asks for refinement, reuse the scoped map's own cache as prior graph context (via
'sbuildScopedSnapshot
option) and rerun the architect. Save the refined JSON to the tmp file and rerunpriorGraph
with the samecreate-map.js
payload plus--scope-json
.--enrichment-file - After the refined scoped graph renders, ask the same short feedback prompt again.
/refresh is change-aware for scoped maps:
- The root graph is always diffed against the cached snapshot.
- For each scoped map, if none of its files were in the diff and its cached graph was produced by the architect (
), the scoped map is preserved untouched — no rebuild, no filter fallback.meta.source === 'claude-scoped' - If the scoped map's files were touched, it is rebuilt from the updated root graph filter and marked
so the nextneedsRebuild: true
pass knows to rerun the architect for that scope./create-map - If a scope can no longer be resolved in the new root graph, it is marked
andstale: true
and left for the user to confirm.needsRebuild: true
Important details:
- The bundled runtime lives inside this skill directory, so keep all paths anchored to
.${CLAUDE_SKILL_DIR}
should treat the/setup-claudemap
path as the primary path, not an optional extra.@claudemap-architect- The packaged project includes a
subagent inclaudemap-architect
for system identification, graph refinement, and human-first graph restructuring..claude/agents/ - If a cached Claude-authored graph already exists, do not replace it with a heuristic regeneration unless the user explicitly asks for
.--force-refresh - If the user only wants to reopen the existing map UI, use
instead of rerunning setup./open-claudemap - Follow-up refreshes should use the
command shipped in/refresh
..claude/commands/refresh.md - Graph refinements should prefer
over rerunning setup so the current graph context is reused.${CLAUDE_SKILL_DIR}/skill/commands/refresh.js --enrichment-file ...
should be treated as a presentation-direction command, not just a low-level transport wrapper./show