The prompt line that should have been a hook
Find the defect in a team's fix for a force-push their agent made, and decide which of five prompt rules become hooks, and at which point in the loop.
On this page
A coding agent force-pushed to main, and the team's fix was to make the rule louder. The fix is the defect.
The situation
A team's coding agent runs about 2,400 sessions a month. Its system prompt ends with five rules:
- "Never force-push, and never push directly to main."
- "Run the tests before you say you are done."
- "Never print the contents of .env files or any API key."
- "Prefer small, focused commits."
- "Ask before deleting files outside the build directory."
Last month's traces show three force-pushes to main, each of which overwrote colleagues' commits and took about three hours to untangle; eleven sessions that ended "done" with tests failing; and one API key pasted into a pull-request comment. The rule that failed sat 1,800 tokens into a 6,000-token prompt, and the worst session was at turn 41 with 90,000 tokens of context.
The proposed fix moves rule 1 to the first line of the prompt, in capitals, followed by "THIS IS VERY IMPORTANT". Nothing else changes.
The question
Find the defect in the proposed fix, then decide for each of the five rules whether it stays a prompt line or becomes a hook, at which point in the loop, and what the hook checks.
A strong answer · Rubric · Where answers go wrong
Write your answer first, then open