# Git rename score

`git-rename-score` · version 1.0.0 · Developer tools · free, no key needed

Score Git-style line-chunk content similarity as an exact integer percentage with byte evidence.

**Use when you need to: score git rename similarity · compare file content similarity · calculate rename percentage.**

## Decide before calling

Read the [versioned contract](/v1/tools/git-rename-score/versions/1.0.0) and the supported scope below. Reuse `git-rename-score@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-rename-score@1.0.0` for score git rename similarity. 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

- score git rename similarity
- compare file content similarity
- calculate rename percentage
- measure copied content bytes
- git diff similarity score
- estimate rename threshold match

## Not supported

- run git diff
- compare file names

## Behavior

- Models Git diffcore copied-byte scoring: identical newline-preserving byte chunks are counted as a multiset.
- Score is floor(100 * copied_bytes / max(source_bytes, destination_bytes)); two empty contents score 100.
- Text is encoded as UTF-8 without normalization; lone surrogates are rejected.

## Input

- `source` (string, required): max length 65536
- `destination` (string, required): max length 65536

## Output

- `reference` (constant "Git 2.51.0 diffcore-rename content similarity model", required)
- `version` (constant "1.0.0", required)
- `score` (integer, required): min 0; max 100
- `copied_bytes` (integer, required): min 0; max 65536
- `source_bytes` (integer, required): min 0; max 65536
- `destination_bytes` (integer, required): min 0; max 65536

## Limits

- max content bytes: 65536

## Example

Request input:

```json
{
  "source": "a\nb\n",
  "destination": "a\nc\n"
}
```

Response:

```json
{
  "result": {
    "reference": "Git 2.51.0 diffcore-rename content similarity model",
    "version": "1.0.0",
    "score": 50,
    "copied_bytes": 2,
    "source_bytes": 4,
    "destination_bytes": 4
  }
}
```

## How to call it

### MCP

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

```json
{
  "id": "git-rename-score",
  "version": "1.0.0",
  "input": {
    "source": "a\nb\n",
    "destination": "a\nc\n"
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/git-rename-score/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"source":"a\nb\n","destination":"a\nc\n"}'
```

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

### CLI

```sh
node cli.mjs run git-rename-score 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.
- [Git renames detect](/tools/git-renames-detect): Detect deterministic one-to-one Git-style rename pairs, unmatched paths, scores, and 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.
- [Editorconfig resolve](/tools/editorconfig-resolve): Resolve EditorConfig properties for one normalized relative POSIX path from caller-supplied file contents.
- [Har summarize](/tools/har-summarize): Summarize a HAR 1.2 JSON log into deterministic request, status, MIME, host, timing, size, and redaction counts.
- [Commit conventional parse](/tools/commit-conventional-parse): Parse one Conventional Commits 1.0.0 message into its header, body, footers, and breaking-change status.
