Without DevMap
- RepositoryClaude explores filescontext rebuilt
- RepositoryCodex explores filescontext rebuilt
- RepositoryNew session explores filescontext rebuilt
DevMap reads your codebase and writes a map that developers and AI agents start from: entry points, critical files, features and routes. Read it as files, or let your agent ask over MCP.
npm i -g @flaid/devmapNeeds Node 22 or newer. An API key is optional and only adds the AI layer.
$ npx @flaid/devmap analyze
✓scanning files
✓building dependency graph
✓detecting framework · routes · database
✓ranking critical files
→writing .devmap/index.json
context ready for any agent
Illustrative output.
One devmap analyze for Claude Code, Codex, Cursor, Gemini CLI, OpenCode and more. If a tool can read files, it can read the map. If it speaks MCP, it can ask for it.
Tells the agent the reading order and where the map lives. Written once by init, never overwritten.
Entry points, critical files and a pointer to every feature. Small enough to read first.
One file per feature with the files that implement it, so the agent opens only what it needs.
devmap mcp runs DevMap as an MCP server. The agent calls a tool and gets structured JSON back, so it reads only the part of the map it needs. Read-only by default, and every answer says if the snapshot is stale.
Run devmap analyze in the project. It writes .devmap/snapshot.json.
Add the command below to Claude Code, or the config to Cursor, Codex and opencode.
It calls the tools it needs instead of reading the whole map up front.
Claude Code
claude mcp add devmap -- npx -y @flaid/devmap mcp{
"mcpServers": {
"devmap": {
"command": "npx",
"args": ["-y", "@flaid/devmap", "mcp"]
}
}
}Nothing is sent anywhere. --auto-refresh and --allow-ai are opt-in.
devmap_overviewFramework, entry points, critical files, features and flows. Where an agent starts.
devmap_mapDependency map of the project, one feature or one file.
devmap_flowTrace a feature or an API request from entry to database.
devmap_routesList page and API routes.
devmap_impactWhat breaks if this file changes, followed through the import graph.
devmap_findFind features, files and routes by keyword.
devmap_analyzeRe-analyze and refresh the snapshot. Writes only inside .devmap/.
devmap_explainExplain a file, feature or function with your own AI key.
needs --allow-aiEvery new session, every new agent and every new teammate starts the same way: open files, trace imports, guess which ones matter.
devmap analyzeshared project contextdevmap analyze writes a .devmap folder next to your code. Agents open the small index first and follow it to the one feature they need, instead of exploring the whole repository.
.devmap/index.jsonStart here. Entry points, critical files and a pointer to each feature.
.devmap/features/*.jsonOne map per feature, with the files that implement it.
.devmap/snapshot.jsonThe full analysis, read only when the two above are not enough.
{ "project": { "name": "devmap-workspace", "framework": "astro", "language": "typescript", "workspaceType": "monorepo" }, "entryPoints": [ "packages/cli/src/index.ts", "apps/web/src/pages/docs.astro", "apps/web/src/pages/index.astro" ], "criticalFiles": [ "packages/cli/src/commands/analyze.ts", "packages/cli/src/commands/init.ts", "packages/cli/src/commands/map.ts" ], "features": [ { "name": "CLI Commands", "map": ".devmap/features/cli-commands.json" } ]}Pick one and see what it prints. Most of them need no API key.
devmap init
◆ Validating Groq API key
◆ Groq API key is valid
◆ Config saved to ~/.devmap/config.json
◆ Added .devmap/ to .gitignore
◆ Created DEVMAP.md
◆ Created AGENTS.md
◆ Next: devmap analyze
devmap config model llama-3.3-70b-versatile
◆ Default model override set to llama-3.3-70b-versatile.
devmap doctor
DevMap Doctor
DevMap 0.8.3
Node.js v22.23.4 (supported)
OS linux/x64
Project devmap-workspace
Framework astro
Package Manager pnpm
Provider not configured
Config missing
Snapshot valid
API key not configured
Issues
◆ Run devmap init to create ~/.devmap/config.json.
devmap analyze
DevMap Analyze
◆ Scanning ~/devmap
◆ Scanned 377 files
◆ Mapping dependencies
◆ Detected 7 features
◆ Project index built
Project devmap-workspace
Framework astro
Language typescript
Package Manager pnpm
Files 377
Lines 55284
Entry Points
◆ packages/cli/src/index.ts
◆ apps/web/src/pages/docs.astro
… 3 more
◆ Snapshot saved to .devmap/snapshot.json
◆ Agent navigation saved to .devmap/index.json and .devmap/features/
devmap map
DevMap — map: project
Features
- AI Integration (5 files)
- Caching (5 files)
- CLI Commands (9 files)
- Doc (5 files)
- Documentation (11 files)
- Home (16 files)
- Testing (1 file)
Feature relationships
- Caching → AI Integration
- CLI Commands → AI Integration
- CLI Commands → Caching
- Doc → Home
- Documentation → Doc
48 of 377 files belong to a detected feature.
◆ Wrote .devmap/maps/project.mermaid
devmap flow
AI flow narration is not configured. Run devmap init to enable it.
Flows written
◆ AI Integration flow
◆ Caching flow
◆ CLI Commands flow
◆ Request /robots.txt
◆ Request /sitemap.xml
◆ Wrote .devmap/flows/cli-commands-flow.md
◆ Wrote .devmap/flows/cli-commands-flow.mermaid
devmap onboarding
DevMap Onboarding
devmap-workspace
Typescript · Astro · Groq · OpenRouter
What this is
devmap-workspace handles ai integration, caching, cli commands. Integrates with Groq, OpenRouter.
Start here
1
File examples/todo-app/prisma/schema.prisma
Why read this Understand the data model and entity relationships
2
File packages/cli/src/index.ts
Why read this Execution entry point — see available commands or routes
3
File apps/web/src/pages/docs.astro
Why read this Execution entry point — see available commands or routes
devmap explain packages/cli/src/index.ts
Context files: packages/cli/src/index.ts
Answer
The CLI entry point. It builds the commander program and hands
init, analyze, onboarding, map, flow, explain, config, doctor and mcp
to their command handlers.
devmap mcp
DevMap MCP server ready (root: ~/devmap)
Agent calls devmap_impact
→ file: packages/cli/src/commands/analyze.ts, depth: 2
DevMap answers
Features CLI Commands, Caching
Dependents 6 direct, 7 within 2 steps
◆ packages/cli/src/index.ts
◆ packages/cli/src/mcp/refresh.ts
… 4 more
◆ snapshot.stale: false
Files, imports, routes, features and flows come from static analysis, so the result doesn't change between runs. AI is optional and is used in three places: inferring what the project is for, describing files, and answering questions. If the provider fails, devmap analyze still finishes.
Next.js to NestJS, in the same monorepo if that's what you have. JavaScript and TypeScript come first; other languages are read with lighter tools.
Exports, symbols and imports read with ts-morph.
Imports, exports and declarations.
npx @flaid/devmap analyzeFree and open source under the MIT license. Install it globally with npm install -g @flaid/devmap when you want it on every project.