scrubby_get_segments
List all code segments — file-ownership boundaries discovered via import-graph clustering — with their conventions, file summaries, and API surfaces.
Returns all code segments for the repository. Segments are finer-grained than domains: clusters of files that form cohesive modules based on import relationships and naming patterns. This tool exposes the deep file-level knowledge of the codebase.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
repo_id | number | No | Scrubby repository ID. Auto-detected if omitted. |
repo_name | string | No | Repository name (e.g. api). Used to auto-resolve in remote mode when multiple repos are indexed. |
Response
An array of segment objects, each with:
name— segment identifier.domain— the domain this segment belongs to.files— the files in the segment, with one-line summaries.conventions— the high-confidence patterns extracted for this segment, with category, description, and confidence score.api_surface— the public exports of the segment (where applicable).
See Conventions for the eight categories of conventions and how confidence scores are computed.
Typical usage
In your AI editor:
"What conventions apply to the segment that contains app/services/billing/?"
"Show me the API surface of the auth segment."
See also
- Conventions.
scrubby_get_domainsfor the domain layer.scrubby_reviewfor per-file context.
Last updated