Prompt of the day: Create a pre-commit hook that prevents files over 5,000 tokens. Tokens = bytes/4. Run only on staged files. Ignore files which are not authored by agents, like lockfiles or codege
Why CEREBRO kept it
Token-cap pre-commit hook for agent output; practical context hygiene.
The text below is an automated extraction of the article at https://x.com/mattpocockuk/status/2111708560715292675, stored verbatim in the public cerebro-vault repository. Copyright remains with the original publisher (x.com).
Create a pre-commit hook that prevents files over 5,000 tokens. Tokens = bytes/4.
Run only on staged files. Ignore files which are not authored by agents, like lockfiles or codege
> Token-cap pre-commit hook for agent output; practical context hygiene.
Prompt of the day:
Create a pre-commit hook that prevents files over 5,000 tokens. Tokens = bytes/4.
Run only on staged files. Ignore files which are not authored by agents, like lockfiles or codegen.
Provide explicit instructions on how to split files in the error message.
The simplest investment I ever made in my codebase. So good.
Backlinks
Appeared in 1 briefing