# pre-commit "check-added-large-files" fails in CI

> Fix pre-commit "check-added-large-files" failing in CI - a committed file exceeds the size limit, so the hook fails the build to keep large blobs out of git.

Source: https://latchkey.dev/learn/ci-integrations/pre-commit-check-added-large-files-fails-in-ci  
Updated: 2026-06-30

The `check-added-large-files` hook from pre-commit-hooks flags any file over its size threshold (default 500 KB). In CI it fails because a large artifact or binary was committed to the repo.

## Diagnose it: did the report reach the service?

Coverage and quality integrations fail in two distinct places: the report was never produced, or it was produced and the upload was rejected. Establish which before touching tokens.

```Terminal
# 1. does the report exist and is it non-empty?
ls -la coverage/ && head -5 coverage/lcov.info

# 2. does it reference paths the service can map to the repo?
grep "^SF:" coverage/lcov.info | head -5

# 3. did the upload actually succeed, or just not fail the step?
# most uploaders exit 0 on a rejected upload unless told otherwise
```

> Absolute paths in an lcov report break file mapping on the service side, so coverage appears as zero even though the upload succeeded. Generate reports with paths relative to the repository root.

## FAQ

### What causes pre-commit "check-added-large-files" fails in CI?

There are 2 common causes: a large binary or artifact was committed and the default threshold is lower than intended. A build output, dataset, or media file over the limit was added to git and the hook catches it.

### How do I fix pre-commit "check-added-large-files" fails in CI?

There are 2 fixes depending on which cause you have: remove the large file or track it with lfs and raise the limit deliberately if needed. Work through them in order, since the first is the most common.

### What does pre-commit "check-added-large-files" fails in CI actually mean?

The hook prints "Failed" and names a file with its size, for example "app.bin (1234 KB) exceeds 500 KB".

### How do I stop pre-commit "check-added-large-files" fails in CI happening again?

Ignore build artifacts so they are never committed. The prevention section lists 3 changes that keep it from recurring.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
