Best Architecture Mapping Software for Developers
Before I trust an architecture map, I pick an arrow and try to explain it. If it says checkout depends on accounts, I want to open the importing file, see what it imports, and check that the map describes the revision I'm working from. That's a more useful starting point than the size of the graph.
For this shortlist, I'm looking at tools that recover structure from implementation, plus one that maps how code changes together over time, because those relationships answer different questions. The candidates are dependency-cruiser, Sonargraph, Lattix, NDepend, CodeScene and Pharaoh (ours). I build Pharaoh.
Decide what a connection means
A code dependency graph gives you a place to start. Before comparing tools, write down what you need an edge to represent, whether that's a file import or a function call, and decide how far you need to trace it. Don't assume every graph answers the same question.
For explaining a design, use architecture diagram and diagram-as-code tools, and for rules about allowed dependencies, see tools that check architecture conformance and drift, keeping this trial focused on recovering the relationships you want to inspect, before deciding which ones to allow.
Tools to put through a repository trial
dependency-cruiser: start with imports you can inspect
For a JavaScript or TypeScript repository, dependency-cruiser can analyze dependencies, validate them against rules, and export the results as graphs, so I'd start here when the immediate question is which files depend on which others.
npm adds it to your development dependencies. dependency-cruiser runs its configuration wizard in the second command, scans the source directory and emits DOT output in the last one, and the shell pipes that output to Graphviz, which renders the SVG. These are the project's documented commands, and the last one requires Graphviz's dot command to be installed.
npm install --save-dev dependency-cruiser
npx dependency-cruiser --init
npx dependency-cruiser src --include-only "^src" --output-type dot | dot -T svg > dependency-graph.svg
npx invokes a scan whose --include-only filter keeps paths matching ^src, so if your application spans workspace packages, change the inputs and filter together, then inspect whether the expected package edges appear. The CLI documentation explains the filter. A missing directory shouldn't become a missing dependency you mistake for architectural isolation.
And there's a specific blind spot to test. The FAQ distinguishes dynamic imports with string literals, which it can follow, from imports whose paths are variables or expressions, which it can't resolve, so include one of those paths in your trial if the application uses them.
Sonargraph: trace a larger dependency view back to code
Sonargraph Architect offers dependency views down to methods, lets you trace arcs to source lines, and supports cycle analysis and virtual refactoring. Its documented languages include Java and Kotlin, C# and C/C++, TypeScript, Go and Python 3.
I'd evaluate it with a proposed module split. Find a dependency crossing the boundary, follow it to its source line, then try the virtual refactoring view, checking which relationships still cross the proposed boundary. That gives the trial a concrete purpose beyond opening a large graph.
Lattix: inspect dependencies in a matrix
In Lattix's dependency structure matrix, subsystems appear on rows and columns, their dependencies appear in cells, and you can edit the hierarchy, which I'd test when I need to inspect relationships between groups of components without following arrows across a crowded drawing.
Check the project creation documentation against your build first. Inputs depend on the analysis module, with Java JAR or class files and .NET DLL or EXE files among the documented inputs, so specify the artifact you'll supply, then verify that the resulting hierarchy matches the boundaries you wanted to investigate. Its module guide covers C/C++, Java, .NET, JavaScript, Python, Ruby, Ada and Fortran, among other modules.
NDepend: follow .NET project dependencies inward
For a .NET solution, NDepend's project dependency diagram starts at Visual Studio projects, lets you drill through namespaces and classes to methods, and opens the coupling classes behind an edge when you double-click it, with a code query available for inspection.
Pick a project dependency, inspect the classes behind it, then decide whether the project boundary is still useful, keeping the source open beside the diagram. I'd want to establish that connection before spending time adjusting the layout.
CodeScene: map relationships from change history
With CodeScene's architectural analyses, you define architectural groupings, the UI can help create them, and the analysis includes hotspots and change coupling, so check those groupings before investigating a result.
The change coupling documentation describes relationships based on shared commits or tickets, as well as changes by the same programmer within a time window, so when I inspect a relationship, I'd open the history that produced it, then decide what that relationship tells me. Because this evidence comes from version control, CodeScene's language support page says hotspots and change coupling work at file level on any text-based file.
I'd use it to investigate modules that keep changing together. Check the commits behind a relationship before treating it as a code dependency. A coordinated change is evidence worth investigating.
Pharaoh (ours): query the map from an AI coding session
Pharaoh is a hosted MCP server for TypeScript, JavaScript, Python, C and C++ repositories, mapping functions and files into a code knowledge graph, with module dependencies, endpoints and cron jobs included, so an assistant can ask about the structure before investigating a module.
The tool overview describes the available queries.
Start with get_codebase_map for module structure and dependencies. Then ask get_module_context about the module you're investigating.
Below is a trimmed excerpt of the dependency section from get_module_context for features/auth in cal.diy (the Pharaoh-so fork), revision 54343aa6.
Pharaoh lists every module: 16 that features/auth imports and 21 that import it. These lines are cut from those lists and kept in the tool's order:
## Dependencies
### Imports from:
- features/profile (weight: 6)
- features/users (weight: 4)
- i18n (weight: 4)
- lib (weight: 34)
- lib/server (weight: 6)
- prisma (weight: 16)
### Imported by:
- web/app (weight: 69)
- web/lib (weight: 9)
- web/modules (weight: 9)
- web/pages (weight: 6)
- app-store/stripepayment (weight: 5)
- trpc/server (weight: 20)
That gives an assistant directions to investigate. For a specific change, get_blast_radius returns production callers and affected endpoints, includes cron jobs and database operations, and follows relationships up to five hops. The guide to checking the blast radius of a code change covers that workflow. I'd still open the relevant source before editing.
The branch limit matters here. Pharaoh re-maps a live repository after pushes to its default branch, serves that branch's graph, and doesn't include uncommitted edits or other branches, so compare the answer with the code you're actually changing. Pharaoh does not retain source-file or function bodies.
Keep research approaches in their own trial
For documentation-to-code traceability, ExArch uses LLMs to extract component names from architecture documentation and code features, with a simple component model connecting the two, so I'd supply its required documents during a trial, then check the resulting links.
Test one module before mapping everything
Choose a module you know well, record the revision you're analyzing, write down a dependency you expect to find, and run the tool with that expectation in front of you. Include an awkward path if you have one. You're checking how the mapper behaves on your repository.
Then inspect the evidence:
- Open the code behind an edge.
- Check an expected edge the map missed.
- List excluded files or build artifacts.
- Record how to regenerate the map.
For a JavaScript or TypeScript trial, the dependency-cruiser commands above are a concrete starting point. dependency-cruiser analyzes only the inputs you give it, so keep the chosen scope with the exported graph, and repeat the check when you widen that scope, rather than compare differently scoped outputs as though the code alone changed.
For search and review assistants, see codebase intelligence tools compared.
I'd choose the mapper after I can explain one result and one omission.