Keep every source file small enough to understand, edit, and merge safely.

locguard is a fast physical-line limit for codebases. It works without setup, respects Git and generated-code conventions, and gives coding agents the same simple invariant in every repository.

Physical file length, deliberately.

Comments and blank lines count because locguard is not measuring semantic complexity. It is keeping source files modular, reducing shared edit hotspots, and limiting the amount of context a human or coding agent must load to work safely.

Zero config

Install it and run locguard. A config file exists only when a repository actually needs custom policy.

Changed-file fast path

Bare checks ask Git for current changes so large repositories do not repeatedly rescan unchanged source files.

Stops at the threshold

Once a file is proven to exceed its limit, locguard stops reading it unless exact counts were requested.

Agent-friendly policy

Generated/vendor code is quiet by default and exact legacy exemptions can stay invisible to everyday agents.

Start with no config. Customize only where your repository needs it.