Three exemptions the first cut missed, all of them files no commit could
ever fix:
- Git-ignored files (todo's exported BACKLOG.md, logs, scratch dumps).
These are rewritten wholesale by whatever produces them, so splitting one
is meaningless, and pre-commit never sees them anyway. Applied to
explicitly-named paths as well as --all, so the two modes cannot disagree
about the same file.
- Vendored agent-skill bundles (.agents/skills, .claude/skills). A SKILL.md
is a fixed-name file with frontmatter; splitting one breaks the format.
Matched by directory name wherever it appears, since these get dropped
into any repo.
- .utils, where CI checks out this repo. Without it a repo's lint job fails
on utils' own long files, which that repo cannot fix.
Baseline accordingly drops from 657 to 597. Re-verified all eight fixtures:
over-cap fails, under-cap passes, generated/vendored/wordlist/git-ignored
exempt, prose still capped, and the gate still passes on its own source.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C7yZz45ezmzCB89Cv5gAtZ
Files that cannot be read in one piece force re-reads and partial edits,
which is the largest avoidable cost in an LLM-assisted workflow. This adds
the enforcement side of a 250-line cap covering code AND prose.
- file_length/config.py: single source of truth for the cap and its
exemptions (generated, markup, vendored, data-ish txt), shared by both the
gate and the survey so the two cannot silently disagree.
- file_length/check.py: the check itself. Exits 1 and lists violations;
adjudication is an exit code, not a judgement call.
- scripts/check_file_length.sh: thin wrapper pre-commit calls with staged
files.
Verified against six fixtures: over-cap code fails, under-cap passes,
generated l10n (1417 lines) exempt, vendored pdfjs exempt, the 174800-line
wordlist exempt as data, and a 1101-line CLAUDE.md correctly fails since
prose is capped too.
Baseline at time of writing: 657 files over 250 lines across 29 repos.
Each repo carries a refactor_claude_todo.md prompt with its own list.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C7yZz45ezmzCB89Cv5gAtZ