# Git renames detect

`git-renames-detect` · version 1.0.0 · Developer tools · free, no key needed

Detect deterministic one-to-one Git-style rename pairs, unmatched paths, scores, and byte evidence.

**Use when you need to: detect git renames · pair deleted files with additions · apply rename similarity cutoff.**

## Decide before calling

Read the [versioned contract](/v1/tools/git-renames-detect/versions/1.0.0) and the supported scope below. Reuse `git-renames-detect@1.0.0` when your input, required output and limits match it. Choose another approach for an unsupported operation.

## Explain the choice

"I can use `git-renames-detect@1.0.0` for detect git renames. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

## Supported

- detect git renames
- pair deleted files with additions
- apply rename similarity cutoff
- resolve ambiguous rename candidates
- find deterministic file moves
- report unmatched rename paths

## Not supported

- read a git repository
- perform a filesystem rename

## Behavior

- Every candidate uses git-rename-score semantics and must meet the inclusive integer threshold.
- Greedy selection consumes each source and destination at most once.
- Candidates sort by descending score, then source path, then destination path by Unicode scalar value; output pairs sort by destination then source.

## Input

- `deleted_files` (array of object, required): max items 64
- `added_files` (array of object, required): max items 64
- `threshold` (integer, required): min 0; max 100

## Output

- `reference` (constant "Git 2.51.0 diffcore-rename content similarity model", required)
- `version` (constant "1.0.0", required)
- `threshold` (integer, required): min 0; max 100
- `pairs` (array of object, required): max items 64
- `unmatched_sources` (array of string, required): max items 64
- `unmatched_destinations` (array of string, required): max items 64

## Limits

- max content bytes: 65536
- max files per side: 64
- max comparisons: 4096
- max output bytes: 65536

## Example

Request input:

```json
{
  "deleted_files": [
    {
      "path": "old",
      "content": "a\n"
    }
  ],
  "added_files": [
    {
      "path": "new",
      "content": "a\n"
    }
  ],
  "threshold": 50
}
```

Response:

```json
{
  "result": {
    "reference": "Git 2.51.0 diffcore-rename content similarity model",
    "version": "1.0.0",
    "threshold": 50,
    "pairs": [
      {
        "source_path": "old",
        "destination_path": "new",
        "score": 100,
        "copied_bytes": 2
      }
    ],
    "unmatched_sources": [],
    "unmatched_destinations": []
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "git-renames-detect",
  "version": "1.0.0",
  "input": {
    "deleted_files": [
      {
        "path": "old",
        "content": "a\n"
      }
    ],
    "added_files": [
      {
        "path": "new",
        "content": "a\n"
      }
    ],
    "threshold": 50
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/git-renames-detect/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"deleted_files":[{"path":"old","content":"a\n"}],"added_files":[{"path":"new","content":"a\n"}],"threshold":50}'
```

The machine-readable contract is at [/v1/tools/git-renames-detect/versions/1.0.0](/v1/tools/git-renames-detect/versions/1.0.0).

### CLI

```sh
node cli.mjs run git-renames-detect 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Git copies detect](/tools/git-copies-detect): Detect deterministic Git-style copy pairs while allowing one source to match multiple destinations.
- [Editorconfig resolve](/tools/editorconfig-resolve): Resolve EditorConfig properties for one normalized relative POSIX path from caller-supplied file contents.
- [Git rename score](/tools/git-rename-score): Score Git-style line-chunk content similarity as an exact integer percentage with byte evidence.
- [Chmod mode convert](/tools/chmod-mode-convert): Convert a Unix permission mode and apply explicit chmod symbolic clauses, returning canonical octal and symbolic forms.
- [Mustache template validate](/tools/mustache-template-validate): Check Mustache template syntax (spec v1.4.2) and its partials; returns valid or the first error with line and column.
- [Commit conventional parse](/tools/commit-conventional-parse): Parse one Conventional Commits 1.0.0 message into its header, body, footers, and breaking-change status.
