# Git copies detect

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

Detect deterministic Git-style copy pairs while allowing one source to match multiple destinations.

**Use when you need to: detect git copies · find copied file origins · match one source to many additions.**

## Decide before calling

Read the [versioned contract](/v1/tools/git-copies-detect/versions/1.0.0) and the supported scope below. Reuse `git-copies-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-copies-detect@1.0.0` for detect git copies. 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 copies
- find copied file origins
- match one source to many additions
- apply copy similarity cutoff
- resolve ambiguous copy sources
- report unmatched copy destinations

## 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.
- Each destination selects once; a source may be reused for multiple copies.
- Candidates sort by descending score, then source path, then destination path by Unicode scalar value; output pairs sort by destination then source.

## Input

- `source_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
{
  "source_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-copies-detect",
  "version": "1.0.0",
  "input": {
    "source_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-copies-detect/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"source_files":[{"path":"old","content":"a\n"}],"added_files":[{"path":"new","content":"a\n"}],"threshold":50}'
```

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

### CLI

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

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

## Related tools

- [Git renames detect](/tools/git-renames-detect): Detect deterministic one-to-one Git-style rename pairs, unmatched paths, scores, and byte evidence.
- [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.
- [Sql statements split](/tools/sql-statements-split): Split SQL text into exact statement spans with explicit PostgreSQL, MySQL, or SQLite lexical rules.
- [Commit conventional parse](/tools/commit-conventional-parse): Parse one Conventional Commits 1.0.0 message into its header, body, footers, and breaking-change status.
