Loading...
Loading...
Guide for setup Codemap CLI for intelligent codebase visualization and navigation
npx skill4agent add neolabhq/context-engineering-kit setup-codemap-cli$ARGUMENTS./CLAUDE.md./.claude/settings.json./CLAUDE.local.md./.claude/settings.local.json.gitignore~/.claude/CLAUDE.md~/.claude/settings.jsoncodemap -helpbrew tap JordanCoin/tap && brew install codemapscoop bucket add codemap https://github.com/JordanCoin/scoop-codemap
scoop install codemapcodemap .## 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| Flag | Description |
|---|---|
| Limit tree depth (0 = unlimited) |
| Only show files with these extensions |
| Exclude files matching patterns |
| Show files changed vs main branch |
| Branch to compare against (with --diff) |
| Dependency flow mode |
| Check who imports a file |
| City skyline visualization |
| Output JSON |
.png.pngFonts/Fonts/*Test*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/codemap .
codemap --diff{
"hooks": {
"session-start": "codemap hook session-start && echo 'git diff:' && git diff --stat && echo 'git status:' && git status"
}
}mainmastercodemap hook session-start --ref=mastercodemap hook session-start--ref=master| Command | Trigger | Description |
|---|---|---|
| SessionStart | Full tree, hubs, branch diff, last session context |
| PreToolUse (Edit|Write) | Who imports file + what hubs it imports |
| PostToolUse (Edit|Write) | Impact of changes (same as pre-edit) |
| UserPromptSubmit | Hub context for mentioned files + session progress |
| PreCompact | Saves hub state to .codemap/hubs.txt |
| SessionEnd | Edit timeline with line counts and stats |
{
"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"
}
]
}
]
}
}