Skip to main content

gitnexus://repo//clusters

Resource URI

gitnexus://repo/{name}/clusters
name
string
required
Repository name from gitnexus://repos

Description

Returns all functional areas (clusters/modules) detected in the repository using the Leiden community detection algorithm. Clusters group related code symbols that work together. Clusters represent functional boundaries in your codebase — authentication, database access, API handlers, etc.

Returns

modules
array
List of detected functional areas (top 20)

When to Use

  • Understanding architecture: See how code is organized
  • Finding related code: Identify which symbols work together
  • Planning changes: Understand functional boundaries
  • Exploring unfamiliar codebases: Quick architectural overview

Example Response

With Clusters

modules:
  - name: "Authentication"
    symbols: 23
    cohesion: 78%
  - name: "Database"
    symbols: 45
    cohesion: 82%
  - name: "API Routes"
    symbols: 67
    cohesion: 71%
  - name: "User Management"
    symbols: 34
    cohesion: 75%
  - name: "Payment Processing"
    symbols: 28
    cohesion: 80%

# Showing top 20 of 47 modules. Use gitnexus_query for deeper search.

No Clusters

modules: []
# No functional areas detected. Run: gitnexus analyze

Cohesion Scores

Cohesion indicates how tightly related the symbols within a cluster are:
  • 80-100%: Very tight coupling, likely a well-defined module
  • 60-79%: Good cohesion, functional area is clear
  • 40-59%: Moderate cohesion, may contain mixed responsibilities
  • < 40%: Low cohesion, cluster may be too broad

gitnexus://repo//cluster/

Resource URI

gitnexus://repo/{name}/cluster/{clusterName}
name
string
required
Repository name from gitnexus://repos
clusterName
string
required
Cluster name from the clusters resource

Description

Returns detailed information about a specific cluster, including all member symbols with their types and file locations. Use this to deep-dive into a functional area and see exactly what code belongs to it.

Returns

module
string
Cluster name
symbols
number
Total member count
cohesion
string
Internal cohesion percentage
members
array
List of symbols in this cluster (top 20)

When to Use

  • After reading clusters: Get details on interesting areas
  • Understanding module scope: See all symbols in a functional area
  • Impact analysis: Know what files are part of a module
  • Refactoring planning: Identify module boundaries

Example Response

module: "Authentication"
symbols: 23
cohesion: 78%

members:
  - name: login
    type: Function
    file: src/auth/login.ts
  - name: logout
    type: Function
    file: src/auth/logout.ts
  - name: AuthProvider
    type: Class
    file: src/auth/provider.ts
  - name: validateToken
    type: Function
    file: src/auth/validate.ts
  - name: refreshToken
    type: Function
    file: src/auth/refresh.ts
  - name: AuthMiddleware
    type: Class
    file: src/middleware/auth.ts
  - name: hashPassword
    type: Function
    file: src/auth/utils.ts
  - name: comparePasswords
    type: Function
    file: src/auth/utils.ts
  # ... and 15 more

Error Response

error: Cluster "InvalidName" not found

Workflow

Typical cluster exploration workflow:
1

List All Clusters

Read gitnexus://repo/{name}/clusters to see available modules
2

Identify Interesting Areas

Look at cluster names and cohesion scores
3

Deep Dive

Read gitnexus://repo/{name}/cluster/{clusterName} for specific modules
4

Analyze Symbols

Use the context tool on specific symbols to understand their relationships

Next Steps

Context Tool

Get 360-degree view of specific symbols

Processes Resource

View execution flows

Build docs developers (and LLMs) love