# Inspect Duplicates

Use duplicates to find repeated top-level names and exact declaration copies.
It is useful when many files may contain copied local helpers, duplicated types, or repeated declarations.

Start with summary for broad scopes.
Use locations when you need files/lines.
Use code only for duplicate names you are ready to inspect.

Controls:
scope, detail, limit, offset, kinds, entities, exclude, pathExclude

Specific:
entities    only these duplicate names/selectors
exclude     skip these names/selectors
pathExclude skip files or path/glob-like patterns
kinds       selector kinds, e.g. f, t, c, etc.; kinds=[...]

Summary scan:
Run:
aib inspect --stdin

Input:
{
  "scope": "src",
  "detail": "summary",
  "limit": 20
}

Inspect specific duplicate code:
Run:
aib inspect --stdin

Input:
{
  "scope": "src",
  "detail": "code",
  "entities": ["getBoolean", "WsOptions"]
}

Command shape:
inspect duplicates <scope> [--detail summary|locations|code] [--limit N] [--offset N]

Use JSON when filtering by several names:
Run:
aib inspect --stdin

Input:
{
  "scope": ["src/scripts", "tools"],
  "detail": "locations",
  "entities": ["getBoolean", "getNumberValue"],
  "exclude": ["LegacyOptions"]
}

Use saved output when duplicate results are large:
Run:
aib inspect --stdin

Input:
{
  "scope": "src",
  "detail": "summary",
  "save": "duplicate-summary"
}
