PT EN
Install

Diff limits: stop a coding agent from rewriting the repository

File, line, and duplication limits help keep implementation close to the requested scope.

Ler em português Markdown version

A white sheet held by an orange clamp on a steel workbench in a teal hangar.

What a diff ceiling does

A diff ceiling is a configurable limit on implementation size. In T25, max_files_changed caps how many files a task may change, while max_diff_lines caps the changed lines in the diff. max_duplicate_line_ratio adds a check for excessive repetition in production files.

These rules do not understand what the code is meant to do. They flag changes that grow beyond what a project is willing to review in one task. Finding review and the human gate still matter; see why the model's APPROVE is not the merge.

The default limits

The currently documented defaults are:

Key Default What it counts
max_files_changed 40 Files changed by the task
max_diff_lines 2000 Changed diff lines
max_duplicate_line_ratio 0.5 Highest duplicate-line ratio among production files

The duplication ratio is measured per file, and the highest ratio is compared with the ceiling. Test files under test/, tests/, or named .test. and .spec. are left out of that calculation. In bootstrap mode, T25 skips only this metric; file and line limits still apply.

Set limits for your repository

Use the limits block in t25.yaml to adjust these values:

limits:
  max_files_changed: 40
  max_diff_lines: 2000
  max_duplicate_line_ratio: 0.5

These are the documented defaults, not a prescription for every repository. If your team reviews smaller tasks, lower the ceilings. If legitimate work needs more room, consider splitting it into reviewable deliveries before making an exception. A higher ceiling accepts larger diffs; one set too low can reject valid work.

What happens when a limit is exceeded

After implementation, T25 collects workspace statistics and compares each configured metric with its limit. If any rule fails, it writes a handoff.md artifact with the reason and observed numbers, then marks the task as failed. The agent does not quietly proceed to QA as if the diff passed policy.

The handoff explains the block so the team can decide what to do next. You might reduce the scope, split the task, or review the project limit. The factory does not trim files from the diff or change the limits on its own.

T25 records the failure and handoff so the team can decide what to do next. Check the task state and artifacts available in your environment before resuming work.

What this guardrail does not check

A small diff can still contain a serious bug, regression, or security issue. A large change can also be necessary for a migration or bootstrap task. That is why diff ceilings complement the spec, tests, QA, review, and risk controls; they do not replace them.

For task-specific branches and worktrees, see one task, one worktree. The configuration reference lists the option names and descriptions.

FAQ

Does T25 delete or revert the diff when it exceeds a ceiling?

No. The task fails and gets a handoff summary. The team decides whether to reduce scope, split the work, or adjust policy.

Do test-file lines count?

They count toward max_diff_lines. They are excluded only from the max_duplicate_line_ratio calculation.

Does bootstrap mode ignore every limit?

No. It skips the duplication check; file and line ceilings still apply.

Is a diff ready to merge if it stays under the ceiling?

No. The ceiling measures size and, optionally, repetition. QA, review, and the human gate still need to do their jobs.

Should I raise the ceiling for a large task?

Consider splitting the task first. If the larger scope is justified, adjust the project policy deliberately and keep human review of the result.

Run T25 on your own machine.

Access is by invite: a personal download link arrives by e-mail, the installer verifies the package checksum and doctor --evaluation validates the environment. Free for the 30 days of the early evaluators program. The orchestrator, database and worktrees run on your machine; T25 does not collect your code, prompts, logs or credentials. Agent CLIs send data to their own providers, under your account and subject to their policies.

t25 doctor --evaluation
t25 create "Add retry with backoff to the HTTP client"

Request an invite

Semantic decisions in agent pipelines, with Jev

Semantic decisions in agent pipelines: T25 asks Jev for a typed signal, logs every answer, and lets deterministic policy decide the verdict and route.

The model's APPROVE is not the merge

An AI code review agent writes APPROVE, but who decides the merge? How T25 recomputes the verdict from findings, the bug that taught us to, and how to build a human gate that doesn't depend on the model.