This tool generates architectural insights by mapping file dependencies and tracking code changes to identify project structure and risk areas.

Install

mkdir -p .claude/skills/codemap && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/1839" && unzip -o skill.zip -d .claude/skills/codemap && rm skill.zip

Installs to .claude/skills/codemap

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Analyze codebase structure, dependencies, changes, cross-agent handoffs, and get code-aware intelligence. Use when user asks about project structure, where code is located, how files connect, what changed, how to resume work, before starting any coding task, when you need risk analysis and skill guidance, or when Codemap should tune project config before analysis.
366 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Beginner

Key capabilities

  • Map dependency flows between files
  • Perform diff analysis against specific git branches
  • Generate machine-readable project context
  • Track file importance via imports
  • Configure per-project analysis settings

How it works

Analyzes file system structure and dependency graphs to classify intent and provide architectural context to agents.

Inputs & outputs

You give it
Project path or specific file path
You get back
Architectural dependency map or change diff

When to use codemap

  • Map dependency relationships between files
  • Review changes between git branches
  • Analyze project folder structure
  • Trace function calls and imports

About this skill

Codemap

Codemap gives you instant architectural context about any codebase. It classifies your intent, detects risk, matches relevant skills, and tracks your working set — all automatically via hooks.

Codemap should also keep its own per-project config healthy. On first use in a repo, or when output is obviously noisy, tune .codemap/config.json before doing deeper analysis so future calls stay code-first instead of asset-first.

Commands

codemap .                       # Project structure and top files
codemap --deps                  # Dependency flow (imports/functions/hubs)
codemap --diff                  # Changes vs main branch
codemap --diff --ref <branch>   # Changes vs specific branch
codemap --importers <file>      # Who imports this file? Is it a hub?
codemap handoff .               # Build + save handoff artifact
codemap handoff --latest .      # Read latest saved handoff
codemap handoff --json .        # Machine-readable handoff payload
codemap skill list              # Show available skills with descriptions
codemap skill show <name>       # Get full skill instructions
codemap skill init              # Create custom skill template
codemap config show             # Show current project config
codemap context                 # Universal JSON context envelope
codemap context --for "prompt"  # With pre-classified intent + matched skills
codemap context --compact       # Minimal for token-constrained agents
codemap serve --port 9471       # HTTP API for non-MCP integrations

First-Use Setup

Before deeper Codemap analysis in a repo:

  1. Check .codemap/config.json.
  2. If it is missing, clearly boilerplate, or obviously too noisy for the stack, run codemap skill show config-setup and follow it.
  3. After writing or improving config, rerun codemap . and codemap --deps.

Treat config as repo memory. Once tuned, future Codemap calls should benefit automatically.

Signals that config needs setup or tuning:

  • .codemap/config.json is missing
  • config only contains generic auto-detected only values with no real project shaping
  • large non-code directories dominate the tree output
  • stack-specific noise is overwhelming source structure (.xcassets, screenshots, PDFs, training-data, fixtures, generated files, models, vendor directories)
  • the repo stack is obvious, but the config does not reflect it

When to Use

ALWAYS run codemap . when:

  • Starting any new task or feature
  • User asks "where is X?" or "what files handle Y?"
  • User asks about project structure or organization
  • You need to understand the codebase before making changes

ALWAYS run codemap --deps when:

  • User asks "how does X work?" or "what uses Y?"
  • Refactoring or moving code
  • Need to trace imports or dependencies
  • Finding hub files (most-imported)

ALWAYS run codemap --diff when:

  • User asks "what changed?" or "what did I modify?"
  • Reviewing changes before commit
  • Summarizing work done on a branch

ALWAYS run codemap --importers <file> when:

  • About to edit a file — check if it's a hub
  • Need to know the blast radius of a change
  • Deciding whether to refactor or leave alone

Run codemap skill show <name> when:

  • The prompt-submit hook shows matched skills in <!-- codemap:skills [...] -->
  • You need guidance for a specific task (hub editing, refactoring, testing)
  • Risk level is medium or high

Run codemap skill show config-setup when:

  • The repo has no .codemap/config.json
  • The config looks like a bare bootstrap and not a real project policy
  • Codemap output is cluttered by large non-code directories
  • You want Codemap to make better future decisions for this specific repo

Run codemap context when:

  • Piping codemap intelligence to another tool
  • Need a structured JSON summary of the project state
  • Building automation that consumes code-aware context

Run codemap handoff when:

  • Switching between agents (Claude, Codex, Cursor)
  • Resuming work after a break
  • User asks "what should the next agent know?"

Hook Output

The prompt-submit hook fires on every message and provides:

<!-- codemap:intent {"category":"refactor","risk":"high",...} -->
<!-- codemap:skills [{"name":"hub-safety","score":5},...] -->
Skills matched: hub-safety, refactor — run `codemap skill show <name>` for guidance
  • Intent categories: refactor, bugfix, feature, explore, test, docs
  • Risk levels: low (no hubs), medium (1 hub), high (2+ hubs or 8+ importers)
  • Skills are pull-based: only names are shown, run codemap skill show for full body

Builtin Skills

SkillWhen to Pull
config-setupMissing, boilerplate, or noisy .codemap/config.json
hub-safetyEditing files imported by 3+ others
refactorRestructuring, renaming, moving code
test-firstWriting tests, TDD workflows
exploreUnderstanding how code works
handoffSwitching between AI agents

Output Interpretation

Tree View (codemap .)

  • Stars (⭐) indicate top 5 largest source files
  • Directories flattened when containing single subdirectory

Dependency Flow (codemap --deps)

  • External dependencies grouped by language
  • Internal import chains showing how files connect
  • HUBS section shows most-imported files (3+ importers)

Diff Mode (codemap --diff)

  • (new) = untracked, = modified, (+N -M) = lines changed
  • Warning icons show hub files (high impact)

Importers (codemap --importers <file>)

  • Shows all files that import this file
  • Flags hub status (3+ importers = high impact)

Context Envelope (codemap context)

  • JSON with project metadata, intent, working set, matched skills, handoff ref
  • --compact strips skills and limits working set for token savings

MCP Tools

If codemap MCP server is configured, these tools are available:

ToolUse For
get_structureProject tree
get_dependenciesDependency flow + hubs
get_diffChanged files with impact
find_fileSearch by filename
get_importersWho imports a file
get_hubsList all hub files
get_file_contextFull context for one file
get_handoffBuild/read handoff artifact
get_working_setFiles edited this session
list_skillsAvailable skills (metadata)
get_skillFull skill instructions
get_activityRecent coding activity
start_watch / stop_watchControl daemon
statusVerify MCP connection
list_projectsDiscover projects

HTTP API

When codemap serve is running:

EndpointReturns
GET /api/context?intent=...Context envelope
GET /api/skillsAll skills metadata
GET /api/skills/<name>Full skill body
GET /api/working-setCurrent working set
GET /api/healthServer health

When not to use it

  • When the repository is too large to parse effectively
  • When only minor file edits are needed without needing architectural understanding

Prerequisites

gitCodemap-compatible config file

Limitations

  • Requires periodic config tuning for noisy projects
  • Analysis latency increases with repository depth

How it compares

It maintains an evolving map of the project structure rather than just looking at individual files in isolation.

Compared to similar skills

codemap side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
codemap (this skill)84moReviewBeginner
architect-review1094moNo flagsAdvanced
solid-principles579moNo flagsIntermediate
codex322moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

architect-review

sickn33

Master software architect specializing in modern architecture patterns, clean architecture, microservices, event-driven systems, and DDD. Reviews system designs and code changes for architectural integrity, scalability, and maintainability. Use PROACTIVELY for architectural decisions.

109320

solid-principles

SmidigStorm

Enforce SOLID principles (Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion) in object-oriented design. Use when writing or reviewing classes and modules.

57236

codex

Lucklyric

Invoke Codex CLI for complex coding tasks requiring high reasoning capabilities. This skill should be invoked when users explicitly mention "Codex", request complex implementation challenges, advanced reasoning, or need high-reasoning model assistance. Automatically triggers on codex-related requests and supports session continuation for iterative development.

32238

error-handling-patterns

wshobson

Master error handling patterns across languages including exceptions, Result types, error propagation, and graceful degradation to build resilient applications. Use when implementing error handling, designing APIs, or improving application reliability.

35170

deepwiki-rs

sopaco

AI-powered Rust documentation generation engine for comprehensive codebase analysis, C4 architecture diagrams, and automated technical documentation. Use when Claude needs to analyze source code, understand software architecture, generate technical specs, or create professional documentation from any programming language.

25170

senior-fullstack

davila7

Comprehensive fullstack development skill for building complete web applications with React, Next.js, Node.js, GraphQL, and PostgreSQL. Includes project scaffolding, code quality analysis, architecture patterns, and complete tech stack guidance. Use when building new projects, analyzing code quality, implementing design patterns, or setting up development workflows.

35110

Search skills

Search the agent skills registry