Stellarion
Tools

stellarion_cluster_symbols [Pro]

Group functions into semantic clusters by purpose
This is a Pro tool. Requires a Stellarion Pro license. A 180-day free trial starts automatically.

Groups functions across the codebase into semantic clusters based on their purpose. Automatically identifies clusters like database access functions, error handlers, authentication checks, data validators, and serialization helpers — without requiring any manual annotation.

When to Use

  • To understand the architecture of an unfamiliar codebase at a glance
  • To find all functions serving a specific purpose (e.g., "show me all auth-related code")
  • To identify opportunities for shared abstractions across scattered similar functions
  • To validate that responsibilities are properly separated across modules

Parameters

ParameterTypeRequiredDefaultDescription
thresholdnumberNo0.7Similarity threshold for cluster membership (0.0 to 1.0)
minClusterSizenumberNo2Minimum number of functions to form a cluster
limitnumberNo20Maximum number of clusters to return

Examples

Discover functional clusters

Group the functions in this project by purpose. What clusters emerge?

Returns automatically discovered clusters with descriptive labels.

Find specific functional groups

Cluster the functions in this project. Are there any groups related to database access?

Returns all clusters — look for the one labeled with database-related terms.

Tight clusters only

Show me tightly-related function clusters — use threshold 0.85 and minimum size 3.

Uses threshold: 0.85 and minClusterSize: 3 to find only highly cohesive groups.

Architecture validation

Cluster all functions. Are there any clusters that span multiple modules? That might indicate misplaced code.

Cross-module clusters may indicate code that belongs together but is scattered.

Output Format

Returns a list of clusters, each containing:

  • Cluster label — auto-generated descriptive name (e.g., "Database queries", "Input validation", "Error handling")
  • Functions — list of functions in the cluster, with file path, line number, and language
  • Cohesion score — how tightly the cluster members relate to each other (0.0 to 1.0)
  • Cluster size — number of functions in the cluster

Clusters are sorted by size (largest first).

Tips

  • Lower threshold (e.g., 0.5) produces larger, broader clusters; higher values (e.g., 0.9) produce smaller, tighter groups
  • Cross-language clustering works naturally — a Python database function will cluster with a similar TypeScript one
  • Clusters that span many modules may indicate a cross-cutting concern that should be extracted into a shared module
  • Single-module clusters with high cohesion confirm good module design
  • Use minClusterSize: 3 or higher to filter out noise from small incidental matches
  • This is useful for onboarding: ask "cluster all functions" to get a high-level map of what the codebase does