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.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
threshold | number | No | 0.7 | Similarity threshold for cluster membership (0.0 to 1.0) |
minClusterSize | number | No | 2 | Minimum number of functions to form a cluster |
limit | number | No | 20 | Maximum number of clusters to return |
Group the functions in this project by purpose. What clusters emerge?
Returns automatically discovered clusters with descriptive labels.
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.
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.
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.
Returns a list of clusters, each containing:
Clusters are sorted by size (largest first).
threshold (e.g., 0.5) produces larger, broader clusters; higher values (e.g., 0.9) produce smaller, tighter groupsminClusterSize: 3 or higher to filter out noise from small incidental matches