codemap — structural ground truth for coding agents. Resolves what your code actually imports, tells you what breaks if you change it, and is explicit about what it couldn't figure out.
$ npx -y skills add JordanCoin/codemap --agent claude-code
Run the curl in your terminal, the rest in Claude Code.
Repo: JordanCoin/codemap
What's inside
codemap — structural ground truth for coding agents. Resolves what your code actually imports, tells you what breaks if you change it, and is explicit about what it couldn't figure out.

An agent reading your repo can see what a file says. It can't cheaply see what depends on that file — that answer lives in go.mod, Cargo workspace membership, package.json exports maps, and tsconfig path aliases, not in the source text.
codemap computes three things:
| Orientation | A structure map with the most-imported files called out. Cheap cold start, useful when an agent has no memory of the last hour. |
| Dependency graph | Imports resolved through each ecosystem's real rules — not string matching. |
| Blast radius | Who breaks if you change this file. |
And one thing that matters more than any of them: it tells you when it doesn't know. Every dependency answer carries a coverage status, so a partial graph never reads as a complete one.
codemap . # structure + hubs
codemap --importers path/to/file # who depends on this
codemap --diff # what changed vs main
# macOS/Linux
brew tap JordanCoin/tap && brew install codemap
# Windows
scoop bucket add codemap https://github.com/JordanCoin/scoop-codemap
scoop install codemap
Other options: Releases |
go install| build from source
Release tarballs ship codemap and the bundled rules but not the ast-grep executable, which --deps needs. Either install it separately:
apk add --no-cache curl jq bash python3 py3-pip
ARCH=$(uname -m)
if [ "$ARCH" = "x86_64" ]; then ARCH="amd64"; elif [ "$ARCH" = "aarch64" ]; then ARCH="arm64"; fi
CODEMAP_VERSION=$(curl -fsSL https://api.github.com/repos/JordanCoin/codemap/releases/latest | jq -r '.tag_name' | tr -d 'v')
curl -fsSL "https://github.com/JordanCoin/codemap/releases/download/v${CODEMAP_VERSION}/codemap_${CODEMAP_VERSION}_linux_${ARCH}.tar.gz" \
| tar xz -C /usr/local/bin/ codemap
python3 -m pip install --no-cache-dir ast-grep-cli
…or use the self-contained codemap-full artifact, which bundles codemap, ast-grep, and sg:
curl -fsSL "https://github.com/JordanCoin/codemap/releases/download/v${CODEMAP_VERSION}/codemap-full_${CODEMAP_VERSION}_linux_${ARCH}.tar.gz" \
| tar xz -C /usr/local/bin/ codemap ast-grep sg
Run from your git repo root — hooks resolve project context from the working directory.
cd /path/to/your/project
codemap setup
codemap setup configures Claude Code and Codex by default:
.codemap/config.json with auto-detected language filters.claude/settings.local.json and .codex/hooks.json.mcp.json and .codex/config.tomlManaged entries record the verified absolute path of the running codemap, so agents don't depend on your shell PATH. Rerun setup if that path changes.
codemap setup --agent claude # one agent only
codemap setup --agent codex
codemap setup --global # user-scope, applies to every project
codemap doctor # validate this project's integrations
codemap doctor --global # validate user-scope configuration
Doctor checks project scope and falls back to user scope, reporting which one satisfied each check. For Codex, trust the hooks from /hooks in CLI or Settings → Hooks in Desktop, then start a new session.
--deps and --importers resolve imports using each ecosystem's own rules rather than guessing from paths:
| Ecosystem | Resolved via |
|---|---|
| Go | module path from go.mod; stdlib and third-party imports are not fuzzy-matched into local files |
| Rust | cargo metadata — workspace membership, target kinds (lib/bin/test/bench/example/build), and dev-dependencies reachable from #[cfg(test)] blocks |
| JS/TS | package.json exports/imports maps, npm/pnpm/Bun workspaces, Deno import maps, and tsconfig rootDir/outDir remapping (including extends) |
| Everything else | ast-grep import extraction with suffix and directory matching |
Every dependency answer reports how much of it codemap actually stands behind:
codemap --json --deps . | jq .coverage
{
"status": "partial",
"sources": [
{ "name": "ast-grep", "status": "authoritative" },
{ "name": "cargo-metadata", "status": "mixed",
"detail": "2 of 5 Cargo manifests used fallback topology" }
],
"issues": []
}
status is complete, partial, or unavailable.authoritative, mixed, fallback, timeout, unavailable, or failed.The JSON payload is versioned (schema_version: codemap.analysis/v1) so consumers can depend on its shape.
20 language rules for dependency analysis: Go, Python, JavaScript, JSX, TypeScript, TSX, Rust, Ruby, C, C++, Java, Swift, Kotlin, C#, PHP, Bash, Lua, Scala, Elixir, Solidity.
Powered by ast-grep. Installed automatically with the Homebrew formula.
codemap . # structure view (respects .codemap/config.json)
codemap --diff # what changed vs main
codemap --deps . # dependency flow
codemap --importers f # who imports a file
codemap blast-radius # review bundle: diff + deps + importers
codemap handoff . # save layered handoff for cross-agent continuation
codemap context # machine-readable project context JSON
codemap doctor # validate agent integrations
codemap skill list # available agent skills
codemap watch start # background daemon for live graph state
codemap serve # HTTP API for non-MCP integrations
codemap mcp # MCP server on stdio
codemap --version
| Flag | Description |
|---|---|
--depth, -d <n> | Limit tree depth (0 = unlimited) |
--only <exts> | Only include 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 |
--animate | Animate the skyline (with --skyline) |
--json | Output JSON |
Flags come before the path/URL:
codemap --json github.com/user/repo
Pattern matching needs no quotes: .png matches any .png file, Fonts matches any /Fonts/ directory, *Test* is a glob.
codemap --diff
codemap --diff --ref develop
╭─────────────────────────── myproject ──────────────────────────╮
│ Changed: 4 files | +156 -23 lines vs main │
╰────────────────────────────────────────────────────────────────╯
├── api/
│ └── (new) auth.go ✎ handlers.go (+45 -12)
└── ✎ main.go (+29 -3)
⚠ handlers.go is used by 3 other files
codemap --deps .
╭──────────────────────────────────────────────────────────────╮
│ MyApp - Dependency Flow │
├──────────────────────────────────────────────────────────────┤
│ Go: chi, zap, testify │
╰──────────────────────────────────────────────────────────────╯
Backend ════════════════════════════════════════════════════
server ───▶ validate ───▶ rules, config
api ───▶ handlers, middleware
HUBS: config (12←), api (8←), utils (5←)
Who breaks if you change a file:
codemap --importers config/config.go
⚠️ HUB FILE: config/config.go
Imported by 21 files - changes have wide impact!
Dependents:
• cmd/hooks.go
• mcp/find_guidance.go
...
For a review bundle in one command — Markdown, text, or a single JSON object:
codemap blast-radius --ref main .
codemap blast-radius --json --ref main .
codemap blast-radius --text --ref main .
codemap --skyline --animate

Analyze any public GitHub or GitLab repo without cloning it yourself:
codemap github.com/anthropics/anthropic-cookbook
codemap gitlab.com/user/repo
Shallow-clones to a temp directory and cleans up. If you already have the repo locally, codemap uses your copy.
Automatic context at session start, before and after edits, and at compaction. → See docs/HOOKS.md
The prompt-submit hook classifies intent, surfaces hub-file risk, shows your working set, matches relevant skills, and emits structured markers (<!-- codemap:intent -->) for tool consumption.
codemap mcp serves 16 tools over stdio:
| Category | Tools |
|---|---|
| Structure | get_structure, find_file, get_hubs, get_file_context |
| Dependencies | get_dependencies, get_importers, get_diff |
| Session | get_working_set, get_activity, get_handoff |
| Daemon | start_watch, stop_watch, status |
| Skills | list_skills, get_skill |
| Discovery | list_projects |
get_structure, get_diff, get_importers, get_dependencies, and get_handoff declare an OutputSchema and return typed structured content alongside the text response, so callers get parseable results instead of prose.
codemap setup configures Codex alongside Claude. For Codex only:
codemap setup --agent codex # project hooks + MCP
codemap plugin install # global plugin (MCP + skills), activated by default
codemap doctor --agent codex # validate; reports CLI and Desktop runtimes separately
After upgrading the codemap binary, agent integrations do not update themselves:
codemap plugin install # Codex only, once per Codex environment
cd /path/to/project && codemap setup && codemap doctor # both agents, per project
codemap plugin install refreshes the plugin for CLI and Desktop sharing a Codex environment, and migrates the current project when run inside one — but it does not discover every configured project. Start a new task or session afterward, and re-check hook trust if Codex asks.
codemap doctorprobes executables recorded in project-local config (.codex/config.toml,.mcp.json), so running it inside an untrusted repo executes a repo-chosen path. Doctor bounds this by requiring absolute paths and a recognized argument shape, but treat it like any command that honors project-local config.
Per-project defaults in .codemap/config.json, so you don't pass --only/--exclude/--depth every time. Hooks respect it too.
codemap config init # auto-detect top extensions, write config
codemap config show # display current config
{
"only": ["rs", "sh", "sql", "toml", "yml"],
"exclude": ["docs/reference", "docs/research"],
"depth": 4,
"mode": "auto",
"guidance": {
"missing_extension_hints": true,
"ignored_extensions": []
},
"budgets": {
"session_start_bytes": 30000,
"diff_bytes": 15000,
"max_hubs": 8
},
"routing": {
"retrieval": { "strategy": "keyword", "top_k": 3 },
"subsystems": [
{
"id": "watching",
"paths": ["watch/**"],
"keywords": ["hook", "daemon", "events"],
"docs": ["docs/HOOKS.md"],
"agents": ["codemap-hook-triage"]
}
]
},
"drift": {
"enabled": true,
"recent_commits": 10,
"require_docs_for": ["watching"]
}
}
All fields are optional; CLI flags always override config. When an MCP file search finds real matches hidden by only, codemap reports the paths and suggests which extensions to add — set guidance.missing_extension_hints: false to disable.
Markdown files that give agents context-aware guidance, matched against intent, mentioned files, and project languages.
codemap skill list
codemap skill show hub-safety
codemap skill init # custom skill template
| Builtin | Activates when |
|---|---|
hub-safety | Editing hub files (3+ importers) |
refactor | Restructuring, renaming, moving code |
test-first | Writing tests, TDD workflows |
explore | Understanding how code works |
handoff | Switching between AI agents |
config-setup | .codemap/config.json is missing, boilerplate, or mismatched to the stack |
Drop a .md file with YAML frontmatter in .codemap/skills/ to add your own — project-local skills override builtins, no Go code required:
---
name: my-skill
description: When this skill should activate
keywords: ["relevant", "keywords"]
languages: ["go"]
---
# Instructions for the AI agent
One command that gives any AI tool codemap's full intelligence:
codemap context # full JSON envelope
codemap context --for "refactor auth" # with pre-classified intent + matched skills
codemap context --compact # minimal, for token-constrained agents
Returns a ContextEnvelope with project metadata, intent classification, working set, matched skills, and a handoff reference. Anything that can shell out gets code-aware context.
codemap serve --port 9471
| Endpoint | Returns |
|---|---|
GET /api/context?intent=refactor+auth | Full context envelope |
GET /api/context?compact=true | Minimal envelope |
GET /api/skills | All skills with metadata |
GET /api/skills?language=go&category=refactor | Filtered skill matches |
GET /api/skills/<name> | Full skill body |
GET /api/working-set | Current session's active files |
GET /api/health | Health check |
Binds to 127.0.0.1; use --host 0.0.0.0 to expose.
When you switch agents (Claude → Codex → Cursor), codemap tracks who worked and what they touched:
{
"agent_history": [
{"agent_id": "claude-code", "files_edited": ["cmd/hooks.go", "main.go"], "ended_at": "..."},
{"agent_id": "codex", "files_edited": ["scanner/types.go"], "ended_at": "..."}
]
}
Agent detection is automatic via environment variables. History carries across sessions, capped at 20 entries, in .codemap/handoff.latest.json.
Shipped: diff/skyline/deps modes, project config, Claude + Codex hooks and MCP, cross-agent handoff, remote repos, intent routing, skills framework, context protocol, HTTP API, build-system-aware resolution for Go/Rust/JS/TS, and the versioned coverage contract.
Next:
codemap skill add <name>)Fork → branch → commit → PR. See CONTRIBUTING.md before adding a new language.
MIT
.agents/
plugins/
marketplace.json
.claude/
skills/
codemap/
SKILL.md
config-setup/
SKILL.md
.githooks/
pre-commit
.github/
codex/
coverage-improvement.md
ISSUE_TEMPLATE/
bug_report.md
feature_request.md
PULL_REQUEST_TEMPLATE.md
SECURITY.md
workflows/
ci.yml
release.yml
.gitignore
.goreleaser.full.yml
.goreleaser.yml
analysis/
contracts_test.go
contracts.go
assets/
codemap.png
skyline-animated.gif
skyline.png
blast_radius_fixes_test.go
blast_radius_test.go
blast_radius.go
CLAUDE.md
cmd/
agent_edits.go
codemap-mcp/
main.go
config_more_test.go
config_test.go
config.go
context_test.go
context.go
doctor_codex_hooks.go
doctor_process_other.go
doctor_process_unix.go
doctor_process_windows.go
doctor_scope_test.go
doctor.go
drift_test.go
drift.go
gitignore_test.go
gitignore.go
hooks_base_ref_test.go
hooks_more_test.go
hooks_payload_test.go
hooks_provenance_test.go
hooks_test.go
hooks.go
integration_command.go
intent_gate_test.go
intent_test.go
intent.go
mcp_test.go
mcp.go
plugin_test.go
plugin.go
root_test.go
root.go
serve_test.go
serve.go
setup_review_test.go
setup_run_test.go
setup_test.go
setup.go
skill_test.go
skill.go
CODE_OF_CONDUCT.md
codemap.rb
config/
config_test.go
config.go
CONTRIBUTING.md
daemon_unix.go
daemon_windows.go
docs/
HOOKS.md
MCP.md
go.mod
go.sum
handoff/
build_more_test.go
build.go
config_filter_test.go
context_test.go
detail.go
handoff_test.go
render_extra_test.go
render.go
storage.go
types.go
internal/
buildinfo/
version.go
LICENSE
limits/
budget.go
limits_test.go
limits.go
main_cli_polish_test.go
main_helpers_test.go
main_more_test.go
main_test.go
main_unix_test.go
main.go
Makefile
mcp/
mcp_entrypoints_test.go
mcp_fallback_entrypoints_test.go
analysis_output_test.go
analysis_output.go
cancellation_test.go
find_guidance.go
main_more_test.go
main_test.go
main.go
parity_contract_test.go
structured_contract_test.go
plugins/
codemap/
.codex-plugin/
plugin.json
.mcp.json
assets/
icon.png
logo.png
screenshot1.png
README.md
skills/
codemap/
SKILL.md
config-setup/
SKILL.md
install_test.go
install.go
README.md
render/
clone_animation_test.go
clone_animation.go
colors_test.go
colors.go
depgraph_test.go
depgraph.go
skyline_test.go
skyline.go
tree_render_test.go
tree_test.go
tree.go
scanner/
api_surface_test.go
astgrep_test.go
astgrep.go
bench_test.go
cancellation_test.go
contracts_test.go
deps_test.go
deps.go
filegraph_test.go
filegraph_truth_test.go
filegraph.go
git_test.go
git.go
integration_more_test.go
jsworkspace_test.go
jsworkspace.go
outcome_test.go
outcome.go
rustcargo_test.go
rustcargo.go
rustgraph.go
sg-rules/
bash.yml
c.yml
cpp.yml
csharp.yml
elixir.yml
go.yml
java.yml
javascript.yml
jsx.yml
kotlin.yml
lua.yml
php.yml
python.yml
ruby.yml
rust.yml
scala.yml
sgconfig.yml
solidity.yml
swift.yml
tsx.yml
typescript.yml
types.go
walker_test.go
walker.go
scripts/
download-bundled-astgrep.sh
onboard.ps1
onboard.sh
skills/
builtin/
config-setup.md
explore.md
handoff.md
hub-safety.md
refactor.md
test-first.md
embed.go
loader_test.go
loader.go
types.go
watch/
control_events_test.go
daemon.go
events_debounce_test.go
events_handle_test.go
events_limits_test.go
events.go
more_test.go
process_unix.go
process_windows.go
state_more_test.go
state_test.go
state.go
testdata/
output/
20251206-144613/
events.log
summary.md
watcher.log
watcher.pid
mcp-20251206-145502/
mcp_stderr.log
run_test.sh
test_mcp.sh
types.go
watch_test.go
workingset_test.go
workingset.goFAQ
codemap is a Claude Code plugin with 4 hand-picked skills for development work, indexed on Flowy. Install it with the command on its page. It includes codemap, config-setup, codemap. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.