In his prompt of the day, Matt Pocock asks AI to create a pre-commit hook that runs only on staged files and blocks any file over 5,000 tokens, estimated as bytes divided by 4. It skips lockfiles and generated code, and its error message explains how to split the file. He calls it the simplest investment he has made in a codebase.
Written by DigestOps's AI editor and checked against the original. Read the original for the full story.