/understand command is the entry point for Understand Anything. It orchestrates a five-agent pipeline that scans your project, extracts structure and relationships, classifies architectural layers, builds a guided tour, and validates the result — all saved to .understand-anything/knowledge-graph.json. Once complete, it automatically opens the interactive dashboard.
Run /understand whenever you join a new project, after large refactors, or any time you want a fresh map of the codebase.
Usage
The five-agent pipeline
project-scanner — Discover
Detects languages, frameworks, and enumerates all source files with line counts. Reads
README.md and your package manifest (package.json, pyproject.toml, etc.) for authoritative project metadata.Output: .understand-anything/intermediate/scan-result.jsonIf your project has more than 200 files, the scanner will ask you to confirm before continuing or suggest scoping to a subdirectory.
file-analyzer — Extract
Reads every source file and extracts functions, classes, imports, and their relationships as graph nodes and edges. Batches are processed up to 3 concurrently for speed.Output:
.understand-anything/intermediate/batch-<N>.jsonarchitecture-analyzer — Classify
Groups nodes into architectural layers (API, Service, Data, UI, Utility) using the directory tree and framework conventions as evidence.Output:
.understand-anything/intermediate/layers.jsontour-builder — Narrate
Generates a step-by-step guided tour ordered by dependency, aligned with the project README narrative. Each step points to the files you should read first.Output:
.understand-anything/intermediate/tour.jsonIncremental updates
By default,/understand only re-analyzes files that changed since the last run:
- Reads
.understand-anything/meta.jsonto get the last git commit hash. - Runs
git diff <lastCommitHash>..HEAD --name-onlyto find changed files. - Re-runs
file-analyzeronly on those files, then merges results into the existing graph. - Always re-runs
architecture-analyzeron the full merged node set, since layer boundaries may shift.
--full to bypass this check and rebuild from scratch.
Options
| Option | Description |
|---|---|
--full | Force a full rebuild, ignoring any existing graph |
<directory> | Scope analysis to a subdirectory (e.g. src/payments) |
Output
After a successful run,.understand-anything/ contains:
On success,
/understand automatically launches /understand-dashboard so you can explore the graph immediately. If final validation did not pass, the graph is saved with warnings and dashboard launch is skipped.Examples
Related commands
/understand-dashboard
Explore the knowledge graph visually in an interactive web dashboard.
/understand-chat
Ask natural-language questions about the codebase using the graph as context.
/understand-diff
Analyze the impact of your current git changes on the knowledge graph.
/understand-onboard
Generate a structured onboarding guide for new team members.