Codebase Visualization
Octopus uses Understand-Anything to build an interactive knowledge graph of the codebase itself — every file, function, class, and dependency mapped as an explorable graph.
Unlike the Sagittarius knowledge graph which tracks runtime entities (users, repos, issues, emails), the codebase visualizer maps the source code architecture — how files relate to each other, what layers exist, and where to find things.
Highlights
- 9,700+ nodes (files, functions, classes) and 14,700+ edges (imports, calls, contains)
- 10 architectural layers auto-detected (API Server, Service Integrations, Knowledge Graph Engine, CLI, etc.)
- 12 guided tour steps walking through the architecture in dependency order
- 3-level navigation: overview (layer clusters) → layer detail → individual node
- Fuzzy + semantic search across all nodes
- Persona-adaptive UI — different detail levels for different audiences
Usage
Prerequisites
Ensure Understand-Anything is installed for opencode:
curl -fsSL https://raw.githubusercontent.com/Lum1104/Understand-Anything/main/install.sh | bash -s opencode
Run the analysis in opencode:
opencode> /understand
This runs a multi-agent pipeline that:
- Scans all project files (950+ files, 20 languages)
- Extracts functions, classes, and imports using tree-sitter
- Generates plain-English summaries via LLM
- Identifies architectural layers
- Builds a guided tour
- Saves the result to
.understand-anything/knowledge-graph.json
Launch the Dashboard
make codebase-graph
This starts a Vite dev server at http://127.0.0.1:5173 and opens the interactive dashboard in your browser.
Incremental Updates
After making changes, re-run the analysis in opencode:
opencode> /understand
Only changed files are re-analyzed (incremental). You can also enable auto-updates:
opencode> /understand --auto-update
Dashboard Features
- Overview Level: Architectural layer clusters arranged via ELK layout
- Layer Detail: Expandable container nodes with cross-layer dependencies
- Node Selection: Shows summary, tags, complexity, connections, and code
- Search: Fuzzy search across all node names and summaries
- Guided Tours: Step-by-step walkthrough of the architecture
- Diff Mode: See which parts of the system your changes affect
- Language Concepts: 12 programming patterns explained in context