co_change
Find files that historically change together with a specified file. Identifies co-changing files from recent commits to help determine what else to review when editing.
Instructions
Read-only. Files that historically change together with the input file — answers "if I edit X, what else should I check?". Mines up to window recent commits that touch file, counts how often each other file appears alongside it, and returns those above threshold, with the co-occurrence count and ratio (count / commits-touching-file), capped at limit. Pure local log mining; no network. Cost is O(window × files-per-commit) — keep window ≤ a few thousand on large repos.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Path inside the target git repo. Defaults to the server's current working directory. | |
| file | Yes | File path relative to the repo root to find co-changing files for. | |
| limit | No | Maximum number of co-changing files to return, highest count first. Default 20. | |
| window | No | How many recent commits touching `file` to mine. Default 1000. | |
| threshold | No | Minimum co-occurrence count for a file to be included. Default 3. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | ||
| co_changed | No | ||
| total_commits_touching | No |