mcp:setup-codemap-cli

Guide for setup Codemap CLI for intelligent codebase visualization and navigation

23 stars

Best use case

mcp:setup-codemap-cli is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Guide for setup Codemap CLI for intelligent codebase visualization and navigation

Teams using mcp:setup-codemap-cli should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/setup-codemap-cli/SKILL.md --create-dirs "https://raw.githubusercontent.com/christophacham/agent-skills-library/main/skills/tooling/setup-codemap-cli/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/setup-codemap-cli/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How mcp:setup-codemap-cli Compares

Feature / Agentmcp:setup-codemap-cliStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Guide for setup Codemap CLI for intelligent codebase visualization and navigation

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

User Input:

```text
$ARGUMENTS
```

# Guide for setup Codemap CLI

## 1. Determine setup context

Ask the user where they want to store the configuration:

**Options:**

1. **Project level (shared via git)** - Configuration tracked in version control, shared with team
   - CLAUDE.md updates go to: `./CLAUDE.md`
   - Hook settings go to: `./.claude/settings.json`

2. **Project level (personal preferences)** - Configuration stays local, not tracked in git
   - CLAUDE.md updates go to: `./CLAUDE.local.md`
   - Hook settings go to: `./.claude/settings.local.json`
   - Verify these files are listed in `.gitignore`, add them if not

3. **User level (global)** - Configuration applies to all projects for this user
   - CLAUDE.md updates go to: `~/.claude/CLAUDE.md`
   - Hook settings go to: `~/.claude/settings.json`

Store the user's choice and use the appropriate paths in subsequent steps.

## 2. Check if Codemap is already installed

Check whether codemap is installed by running `codemap --version` or `codemap --help`.

If not installed, proceed with setup.

## 3. Load Codemap documentation

Read the following documentation to understand Codemap's capabilities:

- Load <https://raw.githubusercontent.com/JordanCoin/codemap/refs/heads/main/README.md> to understand what Codemap is and its capabilities

## 4. Guide user through installation

### macOS/Linux (Homebrew)

```bash
brew tap JordanCoin/tap && brew install codemap
```

### Windows (Scoop)

```bash
scoop bucket add codemap https://github.com/JordanCoin/scoop-codemap
scoop install codemap
```

## 5. Verify installation

After installation, verify codemap works:

```bash
codemap --version
codemap .
```

## 6. Update CLAUDE.md file

Use the path determined in step 1. Once Codemap is successfully installed, update the appropriate CLAUDE.md file with the following content:

```markdown
## Use Codemap CLI for Codebase Navigation

Codemap CLI is available for intelligent codebase visualization and navigation.

**Required Usage** - You MUST use `codemap --diff --ref master` to research changes different from default branch, and `git diff` + `git status` to research current working state.

### Quick Start

```bash
codemap .                    # Project tree
codemap --only swift .       # Just Swift files
codemap --exclude .xcassets,Fonts,.png .  # Hide assets
codemap --depth 2 .          # Limit depth
codemap --diff               # What changed vs main
codemap --deps .             # Dependency flow
```

### Options

| Flag | Description |
|------|-------------|
| `--depth, -d <n>` | Limit tree depth (0 = unlimited) |
| `--only <exts>` | Only show files with these extensions |
| `--exclude <patterns>` | Exclude files matching patterns |
| `--diff` | Show files changed vs main branch |
| `--ref <branch>` | Branch to compare against (with --diff) |
| `--deps` | Dependency flow mode |
| `--importers <file>` | Check who imports a file |
| `--skyline` | City skyline visualization |
| `--json` | Output JSON |

**Smart pattern matching** - no quotes needed:
- `.png` - any `.png` file
- `Fonts` - any `/Fonts/` directory
- `*Test*` - glob pattern

### Diff Mode

See what you're working on:

```bash
codemap --diff
codemap --diff --ref develop
```

```

if the default branch is not `main`, but instead `master` (or something else) update content accordingly:
 - use `codemap --diff --ref master` instead of regular `codemap --diff`


## 7. Update .gitignore file

Update .gitignore file to include `.codemap/` directory:

```text
.codemap/
```

## 8. Test Codemap

Run a quick test to verify everything works:

```bash
codemap .
codemap --diff
```

## 9. Add hooks to settings file

- Use the settings path determined in step 1. Create the settings file if it doesn't exist and add the following content:

    ```json
    {
        "hooks": {
            "session-start": "codemap hook session-start && echo 'git diff:' && git diff --stat && echo 'git status:' && git status"
        }
    }
    ```

    if default branch is not `main`, but instead `master` (or something else) update content accordingly:
    - use `codemap hook session-start --ref=master` instead of regular `codemap hook session-start`
    - For rest of commands also add `--ref=master` flag.

- Ask user whether he want to add any other hooks and provide list of options with descriptions. Add hooks that he asks for.

### Available Hooks

| Command | Trigger | Description |
|---------|---------|-------------|
| `codemap hook session-start` | SessionStart | Full tree, hubs, branch diff, last session context |
| `codemap hook pre-edit` | PreToolUse (Edit\|Write) | Who imports file + what hubs it imports |
| `codemap hook post-edit` | PostToolUse (Edit\|Write) | Impact of changes (same as pre-edit) |
| `codemap hook prompt-submit` | UserPromptSubmit | Hub context for mentioned files + session progress |
| `codemap hook pre-compact` | PreCompact | Saves hub state to .codemap/hubs.txt |
| `codemap hook session-stop` | SessionEnd | Edit timeline with line counts and stats |


### Example of file with full hooks configuration

```json
{
  "hooks": {
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "codemap hook session-start"
          }
        ]
      }
    ],
    "PreToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          {
            "type": "command",
            "command": "codemap hook pre-edit"
          }
        ]
      }
    ],
    "PostToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          {
            "type": "command",
            "command": "codemap hook post-edit"
          }
        ]
      }
    ],
    "UserPromptSubmit": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "codemap hook prompt-submit"
          }
        ]
      }
    ],
    "PreCompact": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "codemap hook pre-compact"
          }
        ]
      }
    ],
    "SessionEnd": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "codemap hook session-stop"
          }
        ]
      }
    ]
  }
}
```

Related Skills

expo-tailwind-setup

23
from christophacham/agent-skills-library

Set up Tailwind CSS v4 in Expo with react-native-css and NativeWind v5 for universal styling

ab-test-setup

23
from christophacham/agent-skills-library

Structured guide for setting up A/B tests with mandatory gates for hypothesis, metrics, and execution readiness.

ci-setup

23
from christophacham/agent-skills-library

Generates a CI/CD pipeline (GitHub Actions) tailored to the project's tech stack. Detects language, framework, test runner, and linter, then produces a production-ready workflow with caching, matrix testing, and security best practices.

observability-monitoring-monitor-setup

23
from christophacham/agent-skills-library

You are a monitoring and observability expert specializing in implementing comprehensive monitoring solutions. Set up metrics collection, distributed tracing, log aggregation, and create insightful da

mcp:setup-arxiv-mcp

23
from christophacham/agent-skills-library

Guide for setup arXiv paper search MCP server using Docker MCP

conductor-setup

23
from christophacham/agent-skills-library

Initialize project with Conductor artifacts (product definition, tech stack, workflow, style guides)

environment-setup-guide

23
from christophacham/agent-skills-library

Guide developers through setting up development environments with proper tools, dependencies, and configurations

ddd:setup-code-formating

23
from christophacham/agent-skills-library

Sets up code formatting rules and style guidelines in CLAUDE.md

mcp:setup-serena-mcp

23
from christophacham/agent-skills-library

Guide for setup Serena MCP server for semantic code retrieval and editing capabilities

mcp:setup-context7-mcp

23
from christophacham/agent-skills-library

Guide for setup Context7 MCP server to load documentation for specific technologies.

devcontainer-setup

23
from christophacham/agent-skills-library

Creates devcontainers with Claude Code, language-specific tooling (Python/Node/Rust/Go), and persistent volumes. Use when adding devcontainer support to a project, setting up isolated development environments, or configuring sandboxed Claude Code workspaces.

writing-skills

23
from christophacham/agent-skills-library

Use when creating new skills, editing existing skills, or verifying skills work before deployment