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
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.

brew tap JordanCoin/tap && brew install codemap # one static binary
cd your-repo && codemap setup # hooks + MCP for Claude Code and Codex
codemap mcp # stdio MCP server for any other client
After codemap setup, the agent gets three answers it cannot get from the source text, at session start, before an edit, and on request.
Where things are. codemap .
╭────────────────────────────── codemap ──────────────────────────────╮
│ Files: 289 | Size: 2.3MB │
│ Top Extensions: .go (227), .yml (35), .md (23), .sh (2), .ps1 (1) │
╰─────────────────────────────────────────────────────────────────────╯
codemap
├── analysis/ (2 files, 3.6KB, all .go)
├── cmd/ (47 files, 463.2KB, all .go)
├── config/ (2 files, 23.2KB, all .go)
...
Who depends on this. codemap --importers config/config.go
⚠️ HUB FILE: config/config.go
Imported by 40 files - changes have wide impact!
Dependents:
• blast_radius.go
• cmd/config.go
... and 38 more
Coverage: complete
Where is the code that does X. codemap find "hub importers"
main.go
matched: resolveImportersInvocation, buildImportersReport, runImportersMode
importers: 0
Coverage: complete
Ranked by path and symbol match, each hit tagged with its importer count. Lexical only, and it says so.
And the one line every answer carries. Every dependency answer reports a coverage status: complete, partial, or unavailable, with the source that could not be trusted. A partial graph never reads as a complete one, so "nothing imports this" and "I couldn't tell" are different answers.
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. |
# 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 setup anywhere inside your git repo. Repo-scoped commands such as
setup, doctor, config, watch, skill, context, serve, and
managed hooks resolve the nearest git root automatically, including linked
worktrees with a .git file.
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) |
| Dart/Flutter | pubspec.yaml package names and declared dependencies; package: URIs resolve within the owning package's lib/, while undeclared or duplicate package names fail closed |
| 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.
21 ast-grep language rules for dependency analysis: Go, Python, JavaScript, JSX, TypeScript, TSX, Rust, Ruby, C, C++, Java, Swift, Dart, Kotlin, C#, PHP, Bash, Lua, Scala, Elixir, Solidity. Dart projects, including Flutter apps and packages, also get pubspec.yaml dependency discovery. CUE files also contribute module-scoped package edges through lexical import extraction; CUE is not an ast-grep rule.
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 collide # rank open PRs by shared-file merge-order hazard
codemap find "<query>" # rank files by path and symbol match, with importer counts
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
Standard linked Git worktrees automatically reuse the primary worktree's
.codemap/config.json and project skills. Create the worktree with Git, an IDE,
or any manager that uses standard linked-worktree metadata, then give the agent
its absolute path:
git worktree add <path> -b <branch> <base>
codemap -C /tmp/feature-worktree context
Normal CLI and plugin MCP calls need no --setup-root: central config and skills
come from the primary worktree, while handoffs, watcher files, and hook/session
state remain in the linked worktree. Independent clones have no trusted Git
metadata linking them, so sharing setup between them still requires an explicit
override:
codemap -C /tmp/independent-clone --setup-root /path/to/original context
-C/--project-root selects the repository Codemap operates on.
--setup-root explicitly reuses <repository>/.codemap policy and runtime state
from another checkout. Both accept a repository or subdirectory; relative setup
paths resolve from the project root.
| Flag | Description |
| Flag | Description |
|---|---|
-C, --project-root <repo> | Operate on code in <repo> |
--setup-root <repo> | Explicitly reuse policy and runtime state from <repo>/.codemap |
--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
FAQ
codemap is a Claude Code plugin with 2 hand-picked skills for development work, indexed on Flowy. Install it with the command on its page. It includes codemap, config-setup. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.
Is this plugin yours?
Claim it with GitHubSubmit a pluginPromote it