LayerMap is a codebase layering map tool designed for coding agents. Through an MCP server, a command-line tool (CLI), and plugins for clients such as Claude Code and Codex, it provides agents with read-only code analysis capabilities, helping agents obtain in a single call information that would otherwise require dozens of searches to piece together.
Main capabilities include:
- Call chain tracing: trace callers upward up to 8 levels, all the way to HTTP routes, handlers, tasks, and commands; trace callees downward up to 8 levels.
- Code structure queries: list modules, the declarations in each file, and all usage locations of a symbol.
- Change impact analysis: for uncommitted changes, list the affected HTTP routes, tasks, commands, and related existing tests.
- Multi-language support: uses each language's own compiler or type checker to parse TypeScript, JavaScript, Go, Python, and Java, and correctly handles call relationships in interfaces, base classes, templates, and decorators.
- WeChat Mini Program support: associates .wxml templates of pages and components with bound methods and displayed components, and associates events emitted by components with handler functions bound in pages.
Usage:
- Via an MCP client: run npx -y layermap mcp in the repository as a stdio server.
- Via plugins: supports Claude Code, Codex, CodeBuddy Code, Pi, DeepSeek Harness, Antigravity, and others; after installing the plugin, agents can automatically use the map tools.
- Via the CLI: provides the layermap command, usable in scripts or Git hooks.
- Without a plugin: run npx layermap setup claude or npx layermap setup codex to complete registration, prompt-free authorization, and instruction file addition.
Use cases:
- When an agent needs to understand function call relationships or assess the impact of changes.
- To quickly locate affected endpoints, tasks, and tests in large projects.
- When compiler-level accurate cross-file call analysis is needed.
Limitations and notes:
- Cannot resolve calls that compiler static analysis cannot see, such as dependency injection, unknown framework routes, reflection, and computed property names.
- TypeScript/JavaScript types depend on packages installed in the project's node_modules; when not installed, the relevant types cannot be traced.
- Windows support is experimental; in Claude Code print mode (claude -p), the plugin server does not start automatically.
- The first call requires building the map, which takes seconds for small projects and minutes for large projects; subsequent calls only re-analyze the changed parts.
- The map is stored in the user cache directory and is not written to the repository; all analysis runs locally and no data is sent.
- Requires Node.js 22.22 or later, macOS or Linux (x64/arm64), experimental Windows support, and JDK 21+ for Java projects.
- Environment variables and configuration keys are associated by name only and are not resolved through the compiler.
- Does not write or run tests.